コード例 #1
0
        private void FrmInputs_Load(object sender, EventArgs e)
        {
            foreach (Control label in this.Controls)
            {
                if (label.GetType().ToString() == "System.Windows.Forms.Label")
                {
                    label.Font = UI_FontUtil.SetControlFont();
                }
            }
            txtCustoNo.Text = CustoManager.GetRandomCustoNo();

            #region 加载客户类型信息
            List <CustoType> lstSourceGrid = CustoTypeManager.SelectCustoTypesAll();
            this.cbCustoType.DataSource    = lstSourceGrid;
            this.cbCustoType.DisplayMember = "TypeName";
            this.cbCustoType.ValueMember   = "UserType";
            this.cbCustoType.SelectedIndex = 0;
            this.cbCustoType.ReadOnly      = true;
            #endregion

            #region 加载证件类型信息
            List <PassPortType> passPorts = CustoTypeManager.SelectPassPortTypeAll();
            this.cbPassportType.DataSource    = passPorts;
            this.cbPassportType.DisplayMember = "PassportName";
            this.cbPassportType.ValueMember   = "PassportId";
            this.cbPassportType.SelectedIndex = 0;
コード例 #2
0
 private void txtCustoNo_Validated(object sender, EventArgs e)
 {
     try
     {
         Custo c = CustoManager.SelectCustoByCustoNo(txtCustoNo.Text);
         txtCustoName.Text = c.CustoName;
         txtCustoTel.Text  = c.CustoTel;
         txtCustoType.Text = CustoTypeManager.SelectTypeNameByCustoTypeId(c.CustoType);
     }
     catch
     {
         txtCustoName.Text = "";
         txtCustoTel.Text  = "";
         txtCustoType.Text = "";
     }
 }
コード例 #3
0
 public void LoadCustoType()
 {
     cboCustoType.DataSource    = CustoTypeManager.SelectCustoTypesAll();
     cboCustoType.DisplayMember = "TypeName"; //显示的列名
     cboCustoType.ValueMember   = "UserType"; //绑定的值
 }