Example #1
0
 private void cbo_Way_Of_Search_SelectedValueChanged(object sender, EventArgs e)
 {
     txtEmpID.Text      = "";
     txtEmpName.Text    = "";
     cmbDept.DataSource = null;
     PgdDGV.DataSource  = null;
     if (cmbSrchWay.SelectedItem == "All")
     {
         groupBox1.Enabled = false;
         btn_Search_Click(null, null);
     }
     else if (cmbSrchWay.SelectedItem == "Search By")
     {
         groupBox1.Enabled = true;
         try
         {
             _bll.FillCmbDepartment(ref cmbDept);
             txtEmpID.AutoCompleteCustomSource   = _bll.FillAutoCompleteStringCollectionWithEmpId();
             txtEmpName.AutoCompleteCustomSource = _bll.FillAutoCompleteStringCollectionWithEmpName();
             cmbDept.AutoCompleteCustomSource    = _bll.FillAutoCompleteStringCollectionWithDeptName();
         }
         catch (Exception ex)
         {
             _messageBoxes.ErrorMsgBox(ex.Message);
         }
     }
 }
        public frmEmpAddEdit(Mode mode, DataTable dt = null)
        {
            InitializeComponent();
            if (dt != null)
            {
                _dt = dt;
                BindProperities();
            }
            _bll.FillCmbDepartment(ref cbo_Dept_Name);
            cbo_Dept_Name.AutoCompleteCustomSource = _bll.FillAutoCompleteStringCollectionWithDeptName();
            switch (mode)
            {
            case  Mode.Detail:
                pnlMaster.Enabled = false;
                break;

            default:
                pnlMaster.Enabled = true;
                break;
            }
        }