private void PopulateCombos() { try { DataTable dt = new DataTable(); DAL.Departments obj = new DAL.Departments(); obj.connectionstring = connectionString; dt = obj.getRecord(string.Empty); DataRow dr = dt.NewRow(); dr["DepartmentID"] = "0"; dr["DepartmentTitle"] = "ALL"; dt.Rows.Add(dr); cboDepartment.DataSource = dt; cboDepartment.ValueMember = "DepartmentID"; cboDepartment.DisplayMember = "DepartmentTitle"; cboDepartment.SelectedValue = "0"; cboDepartment.SelectedText = "ALL"; } catch (Exception exc) { MessageBox.Show(exc.Message); } }
private void PopuldateDepartmentFilter() { try { DataTable dt = new DataTable(); DAL.Departments obj = new DAL.Departments(); obj.connectionstring = objDAL.connectionstring; dt = obj.getRecord(string.Empty); DataRow dr = dt.NewRow(); dr["DepartmentID"] = 0; dr["DepartmentTitle"] = "All"; dt.Rows.Add(dr); cboDepartmentFilter.DataSource = dt; cboDepartmentFilter.ValueMember = "DepartmentID"; cboDepartmentFilter.DisplayMember = "DepartmentTitle"; cboDepartmentFilter.SelectedValue = 0; cboDepartmentFilter.SelectedText = "All"; } catch (Exception exc) { Message.ShowMessage(MyMessages.MessageType.Error, exc.Message); } }
private void LoadGrid() { try { //Grid.Rows.Clear(); string vWhere = string.Empty; if (!string.IsNullOrEmpty(txtFilter.Text)) { vWhere = " AND DepartmentTitle Like '%" + txtFilter.Text + "%'"; } DataTable dt = objDAL.getRecord(vWhere); Grid.AutoGenerateColumns = false; Grid.DataSource = dt; } catch (Exception exc) { Message.ShowMessage(MyMessages.MessageType.Error, exc.Message); } }
private void PopulateCombos() { try { DataTable dt = new DataTable(); DAL.Departments obj = new DAL.Departments(); obj.connectionstring = objDAL.connectionstring; dt = obj.getRecord(string.Empty); cboDepartment.DataSource = dt; cboDepartment.ValueMember = "DepartmentID"; cboDepartment.DisplayMember = "DepartmentTitle"; DAL.Designation objD = new DAL.Designation(); objD.connectionstring = objDAL.connectionstring; dt = objD.getRecord(string.Empty); DataRow dr = dt.NewRow(); dr["DesignationID"] = 0; dr["DesignationTitle"] = "All"; dt.Rows.Add(dr); cboDesignation.DataSource = dt; cboDesignation.ValueMember = "DesignationID"; cboDesignation.DisplayMember = "DesignationTitle"; cboDesignation.SelectedValue = 0; cboDesignation.SelectedText = "All"; DAL.Shifts objS = new DAL.Shifts(); objS.connectionstring = objDAL.connectionstring; dt = objS.getRecord(string.Empty); DataRow dr1 = dt.NewRow(); dr1["ShiftID"] = 0; dr1["ShiftTitle"] = "All"; dt.Rows.Add(dr1); cboShift.DataSource = dt; cboShift.ValueMember = "ShiftID"; cboShift.DisplayMember = "ShiftTitle"; cboShift.SelectedValue = 0; cboShift.SelectedText = "All"; } catch (Exception exc) { Message.ShowMessage(MyMessages.MessageType.Error, exc.Message); } }
private void PopulateCombos() { try { DataTable dt = new DataTable(); DAL.Departments obj = new DAL.Departments(); obj.connectionstring = objDAL.connectionstring; dt = obj.getRecord(string.Empty); cboDepartment.DataSource = dt; cboDepartment.ValueMember = "DepartmentID"; cboDepartment.DisplayMember = "DepartmentTitle"; DAL.Designation objD = new DAL.Designation(); objD.connectionstring = objDAL.connectionstring; dt = objD.getRecord(string.Empty); cboDesignation.DataSource = dt; cboDesignation.ValueMember = "DesignationID"; cboDesignation.DisplayMember = "DesignationTitle"; DAL.Shifts objS = new DAL.Shifts(); objS.connectionstring = objDAL.connectionstring; dt = objS.getRecord(string.Empty); cboShift.DataSource = dt; cboShift.ValueMember = "ShiftID"; cboShift.DisplayMember = "ShiftTitle"; } catch (Exception exc) { Message.ShowMessage(MyMessages.MessageType.Error, exc.Message); } }