示例#1
0
        private void InitForm()
        {
            label1.Text = DateTime.Now.ToString("yyyyMMddHHmmss");
            BaseHelper baseHelper = new BaseHelper();

            comboBox1.DataSource    = baseHelper.GetAreaList(); //绑定数据源
            comboBox1.DisplayMember = "Name";                   //主要是设置下拉框显示的值
            comboBox1.ValueMember   = "ID";                     //实际值
        }
        private void InitForm()
        {
            lblContent.Text        = DateTime.Now.ToString("yyyyMMddHHmmss");
            txtName.Text           = "";
            txtCompany.Text        = "";
            txtIdentityNumber.Text = "";
            cbArea.DataSource      = null;
            BaseHelper baseHelper = new BaseHelper();

            cbArea.DataSource    = baseHelper.GetAreaList(); //绑定数据源
            cbArea.DisplayMember = "Name";                   //主要是设置下拉框显示的值
            cbArea.ValueMember   = "ID";                     //实际值
        }
        private void InitForm(EditProjectRequest model)
        {
            BaseHelper baseHelper = new BaseHelper();

            cbArea.DataSource    = baseHelper.GetAreaList(); //绑定数据源
            cbArea.DisplayMember = "Name";                   //主要是设置下拉框显示的值
            cbArea.ValueMember   = "ID";                     //实际值

            projectId              = model.ID;
            lblContent.Text        = model.Number;
            txtName.Text           = model.Name;
            txtCompany.Text        = model.DevelopCompany;
            txtIdentityNumber.Text = model.IdentityNumber;
            cbArea.Text            = model.ProjectArea;
        }
        private void InitForm()
        {
            BaseHelper baseHelper = new BaseHelper();

            comboBox1.DataSource    = baseHelper.GetAreaList(); //绑定数据源
            comboBox1.DisplayMember = "Name";                   //主要是设置下拉框显示的值
            comboBox1.ValueMember   = "ID";                     //实际值

            frmProjectManagement fm = new frmProjectManagement();

            projectId      = fm.model.ID;
            label1.Text    = fm.model.Number;
            textBox1.Text  = fm.model.Name;
            textBox2.Text  = fm.model.DevelopCompany;
            textBox3.Text  = fm.model.IdentityNumber;
            comboBox1.Text = fm.model.ProjectArea;
        }