C#的系统查看

using  System.Drawing;
using  System.Collections;
using  System.ComponentModel;
using  System.Windows.Forms;
using  System.Data;
using  System.Data.SqlClient;

namespace  Example_1
...
{
    
/**//// <summary>
    
/// Summary description for Form1.
    
/// </summary>

    public class frmProject : System.Windows.Forms.Form
    ...
{
        
private System.Windows.Forms.Button btnCreate;
        
private System.Windows.Forms.Button btnClose;
        
private System.Windows.Forms.ListBox lstProjectValues;
        
private System.Windows.Forms.Button btnView;
        
/**//// <summary>
        
/// Required designer variable.
        
/// </summary>

        private System.ComponentModel.Container components = null;

        
//Data related variables
        private DataSet objDataSet;
        
private DataTable objProjectTable;
        
private DataRow objDataRow;
        
private System.Windows.Forms.HelpProvider HelpForForm;
        
private System.Windows.Forms.Button btnRemove;
        
        
public frmProject()
        ...
{
            
//
            
// Required for Windows Form Designer support
            
//
            InitializeComponent();

            
//
            
// TODO: Add any constructor code after InitializeComponent call
            
//
        }


        
/**//// <summary>
        
/// Clean up any resources being used.
        
/// </summary>

        protected override void Dispose( bool disposing )
        ...
{
            
if( disposing )
            ...
{
                
if (components != null
                ...
{
                    components.Dispose();
                }

            }

            
base.Dispose( disposing );
        }


        Windows Form Designer generated code
Windows Form Designer generated code

        
/**//// <summary>
        
/// The main entry point for the application.
        
/// </summary>

        [STAThread]
        
static void Main() 
        ...
{
            Application.Run(
new frmProject());
        }


        
private void btnCreate_Click(object sender, System.EventArgs e)
        ...
{
            
//create dataset
            objDataSet = new DataSet();
            
//create a datatable
            objProjectTable = new DataTable("Project");
            
//adding the columns
            objProjectTable.Columns.Add(new DataColumn("ProjectID",typeof(int)));

            
//adding the primary key
            objProjectTable.PrimaryKey = new DataColumn[1]...{objProjectTable.Columns["ProjectID"]};
            objProjectTable.Columns.Add(
new DataColumn("ProjectName",typeof(string)));
            objProjectTable.Columns.Add(
new DataColumn("ProjectDescription",typeof(string)));
            objProjectTable.Columns.Add(
new DataColumn("ClientID",typeof(string)));
            objProjectTable.Columns.Add(
new DataColumn("EmployeeID",typeof(string)));

            
//adding the table to dataset
            objDataSet.Tables.Add(objProjectTable);
        
            
//creating a new row
            objDataRow = objProjectTable.NewRow();
            objDataRow[
"ProjectID"]=101;
            objDataRow[
"ProjectName"]="Visual C# Inventory Project";
            objDataRow[
"ProjectDescription"]="For ABC Compnay";
            objDataRow[
"ClientID"]="C101";
            objDataRow[
"EmployeeID"]="E01";

            
//adding the row to the table
            objProjectTable.Rows.Add(objDataRow);
            
            
//creating a new row
            objDataRow = objProjectTable.NewRow();
            objDataRow[
"ProjectID"]=102;
            objDataRow[
"ProjectName"]="Funding Project";
            objDataRow[
"ProjectDescription"]="Developed in EJB, STRUTS";
            objDataRow[
"ClientID"]="C102";
            objDataRow[
"EmployeeID"]="E03";
            
//adding the row to the table
            objProjectTable.Rows.Add(objDataRow);

            MessageBox.Show(
"Project Table created with "+objProjectTable.Rows.Count.ToString() + " rows","Total Rows");

            
//enabling and disabling the controls
            this.btnView.Enabled = true;
            
this.lstProjectValues.Enabled = true;
            
this.btnCreate.Enabled = false;
            
        }


        
private void btnClose_Click(object sender, System.EventArgs e)
        ...
{
            
this.Close();
        }


        
private void btnView_Click(object sender, System.EventArgs e)
        ...
{
            
//displaying the rows in the List Box
            foreach(DataRow row in objDataSet.Tables["Project"].Rows)
            ...
{
                
foreach(DataColumn column in objDataSet.Tables["Project"].Columns)
                ...
{
                    
this.lstProjectValues.Items.Add(row[column].ToString());
                }

                
this.lstProjectValues.Items.Add("");
            }


            
this.btnView.Enabled=false;
            
this.btnRemove.Enabled = true;
            
        }


        
private void btnRemove_Click(object sender, System.EventArgs e)
        ...
{
            objProjectTable.Rows.Remove(objDataSet.Tables[
0].Rows[0]);
            
this.lstProjectValues.Items.Clear();
            MessageBox.Show(
"Project Table has "+objProjectTable.Rows.Count.ToString() + " rows",    " Total Rows");
            btnView_Click(sender,e);
        }

    }

}

 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一、系统说明 | ----------------------------------- 本系统是在Microsoft Visual Studio 2003环境下用C#语言编写的个人信息管理系统。 其主要功能有: ------------- 1.文章管理模块  (1)用户发表新文章,可以将文章设为公开或不公开,如果设置为公开的,则所 有使用本系统的用户都可以浏览到你的文章。 (2)用户可以新建文章分类,在文章查询时,文章分类可以做为查询的一个依据。 (3)用户可以查询本人的所有文章,也可以查询其它用户公开的文章,查询条件可以为: 根据文章标题、内容、文章类别、发表时间、修改时间、用户名。 (4)用户可以删除、修改、改变文章是否公开、导出为WORD,但对于其它用户的文章,这些功能有所限制。 -------------- 2.日记管理模块 (1)用户发表新日记,可以将日记设为公开或不公开,如果设置为公开的,则所 有使用本系统的用户都可以浏览到你的日记。 (2)用户可以新建日记分类。 (3)用户可以查询本人的所有日记,也可以查询其它用户公开的日记,查询条件可以为: 根据日记标题、内容、类别、发表时间、修改时间、用户名、心情、天气。 (4)用户可以删除、修改、改变日记是否公开、导出为WORD,但对于其它用户的文章,这些功能有所限制。 -------------- 3.相册管理模块 (1)用户可以上传新图片,可以将图片设为公开或不公开,如果设置为公开的,则所 有使用本系统的用户都可以浏览到你的图片。 (2)用户可以新建相册分类。 (3)用户可以浏览本人的所有图片,以及其它用户公开的图片。 (4)用户可以删除、更新、导出图片,但对于其它用户的图片,这些功能有所限制。 -------------- 4.备忘管理模块 (1)用户可以写新备忘,可以设置备忘提醒时间、是否提醒、备忘分类、紧急程度、查看阴阳历。 (2)用户可以新建备忘分类。 (3)用户可以查询本人的所有备忘,查询条件有:备忘标题、内容、提醒时间、是否完成、紧急程度、备忘分类。 (4)用户可以删除、更新备忘。 -------------- 5.费用管理模块 (1)用户可以写新费用,可以填写费用名称,说明,数量,单价。 (2)用户可以查询本人的所有费用,可以统计查询到的费用情况,并可以将查询记录导出到EXCEL中保存。 (3)用户可以删除、修改费用。 ---------------------------- 6.信息管理模块 (1) 用户可以更改密码。 (2) 提供管理日常联系人的信息功能,可以批量从EXCEL中导入联系人,也可以批量导出联系人。 ---------------------------- |

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值