protected void GET_POSITIONS() { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_POSITIONS"); if (dt != null) { gdv_positions.DataSource = dt; gdv_positions.Columns[0].Visible = false; gdv_positions.Columns[1].Visible = false; gdv_positions.Columns[2].HeaderText = "Position Name"; gdv_positions.Columns[3].HeaderText = "Position Active?"; gdv_positions.DefaultCellStyle.SelectionBackColor = Color.White; gdv_positions.DefaultCellStyle.SelectionForeColor = Color.Black; gdv_positions.RowsDefaultCellStyle.BackColor = Color.LightGray; gdv_positions.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; // Set the row and column header styles. gdv_positions.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; gdv_positions.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; gdv_positions.RowHeadersDefaultCellStyle.BackColor = Color.Black; // Set the selection background color for all the cells. gdv_positions.DefaultCellStyle.SelectionBackColor = Color.White; gdv_positions.DefaultCellStyle.SelectionForeColor = Color.Black; } }
protected void GET_BRANCHES() { frm_finance_bank_salary_payment_sheet_report_selector.dt_stations = System_lookups.SELECT_LOOKUP_VALUES("SELECT_BRANCHES"); if (frm_finance_bank_salary_payment_sheet_report_selector.dt_stations != null) { for (int i = 0; i < frm_finance_bank_salary_payment_sheet_report_selector.dt_stations.Rows.Count; i++) { this.chklist_branches.Items.Add(frm_finance_bank_salary_payment_sheet_report_selector.dt_stations.Rows[i]["branch"].ToString()); } } }
//protected void GET_BRANCHES() //{ // DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_BRANCHES"); // if (dt != null) // { // DataRow dtRow = dt.NewRow(); // dtRow["record_guid"] = string.Empty; // dtRow["auto_id"] = -1; // dtRow["accounts_code"] = "-1"; // dtRow["branch"] = "select branch"; // dtRow["active"] = true; // dt.Rows.InsertAt(dtRow, 0); // this.cbo_branch.DataSource = dt; // this.cbo_branch.DisplayMember = "branch"; // this.cbo_branch.ValueMember = "accounts_code"; // cbo_branch.SelectedIndex = 0; // } //} protected void GET_BRANCHES() { dt_stations = System_lookups.SELECT_LOOKUP_VALUES("SELECT_BRANCHES"); if (dt_stations != null) { for (int i = 0; i < dt_stations.Rows.Count; i++) { this.chklist_branches.Items.Add(dt_stations.Rows[i]["branch"].ToString()); } } }
protected void GET_DEPARTMENTS() { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_DEPARTMENTS"); if (dt != null) { DataRow dtRow = dt.NewRow(); dtRow["department_name"] = string.Empty; dtRow["auto_id"] = -99; dt.Rows.InsertAt(dtRow, 0); this.cbo_department.DisplayMember = "department_name"; this.cbo_department.ValueMember = "auto_id"; this.cbo_department.DataSource = dt; } }
protected void GET_ACTIVE_GUARDS_BY_BRANCH(String branch_name) { DataTable dt = System_lookups.SELECT_LIST_OF_ACTIVE_GUARDS_BY_BRANCH("SELECT_LIST_OF_ACTIVE_GUARDS_BY_BRANCH", branch_name); if (dt != null) { DataRow dtRow = dt.NewRow(); dtRow["full_name"] = String.Empty; dtRow["guard_number"] = String.Empty; dt.Rows.InsertAt(dtRow, 0); cbo_guard_name.DataSource = dt; cbo_guard_name.DisplayMember = "full_name"; cbo_guard_name.ValueMember = "guard_number"; } }
protected void GET_BRANCHES() { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_BRANCHES"); if (dt != null) { DataRow dtRow = dt.NewRow(); dtRow["record_guid"] = string.Empty; dtRow["auto_id"] = -1; dtRow["branch"] = string.Empty; dtRow["active"] = true; dt.Rows.InsertAt(dtRow, 0); this.cbo_branch.DataSource = dt; this.cbo_branch.DisplayMember = "branch"; this.cbo_branch.ValueMember = "branch_code"; } }
protected void GET_POSITIONS() { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_POSITIONS"); if (dt != null) { DataRow dtRow = dt.NewRow(); dtRow["record_guid"] = string.Empty; dtRow["auto_id"] = -1; dtRow["position_code"] = string.Empty; dtRow["active"] = true; dt.Rows.InsertAt(dtRow, 0); this.cboRank.DataSource = dt; this.cboRank.ValueMember = "position_code"; this.cboRank.DisplayMember = "position_name"; } }
private void btnsave_Click(object sender, EventArgs e) { if (this.txt_branch_name.Text == string.Empty) { MessageBox.Show("Branch name required"); return; } if (this.txt_branch_id.Text == string.Empty) { System_lookups.NEW_LOOKUP_DETAILS("SAVE_NEW_BRANCH_DETAILS", this.txt_branch_name.Text, (this.chk_branch_active.Checked ? true : false), this.txt_branch_code.Text); MessageBox.Show("Successfully saved branch details"); this.GET_BRANCHES(); return; } System_lookups.UPDATE_LOOKUP_DETAILS("UPDATE_BRANCH_DETAILS", this.txt_branch_name.Text, (this.chk_branch_active.Checked ? true : false), Convert.ToInt32(this.txt_branch_id.Text), this.txt_branch_code.Text); MessageBox.Show("Successfully updated branch details"); this.GET_BRANCHES(); }
private void btn_save_dept_Click(object sender, EventArgs e) { if (this.txt_dept_name.Text == string.Empty) { MessageBox.Show("Department name required"); return; } if (this.txt_dept_id.Text == string.Empty) { System_lookups.NEW_LOOKUP_DETAILS("SAVE_NEW_DEPARTMENT_DETAILS", this.txt_dept_name.Text, (this.chk_dept_active.Checked ? true : false), this.txt_department_code.Text); MessageBox.Show("Successfully saved department details"); this.GET_DEPARTMENTS(); return; } System_lookups.UPDATE_LOOKUP_DETAILS("UPDATE_DEPARTMENT_DETAILS", this.txt_dept_name.Text, (this.chk_dept_active.Checked ? true : false), Convert.ToInt32(this.txt_dept_id.Text), this.txt_department_code.Text); MessageBox.Show("Successfully updated department details"); this.GET_DEPARTMENTS(); }
private void btn_position_save_Click(object sender, EventArgs e) { if (this.txt_position_name.Text == string.Empty) { MessageBox.Show("Position name required"); return; } if (this.txt_position_id.Text == string.Empty) { System_lookups.NEW_LOOKUP_DETAILS("SAVE_NEW_POSITION_DETAILS", this.txt_position_name.Text, (this.chk_position_active.Checked ? true : false), this.txt_position_code.Text); MessageBox.Show("Successfully saved position details"); this.GET_POSITIONS(); return; } System_lookups.UPDATE_LOOKUP_DETAILS("UPDATE_POSITION_DETAILS", this.txt_position_name.Text, (this.chk_position_active.Checked ? true : false), Convert.ToInt32(this.txt_position_id.Text), this.txt_position_code.Text); MessageBox.Show("Successfully updated position details"); this.GET_POSITIONS(); }
protected void GET_BRANCHES_SEARCH() //FOR THE SEARCH COMBO { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_BRANCHES"); if (dt != null) { DataRow dtRow = dt.NewRow(); dtRow["record_guid"] = String.Empty; dtRow["auto_id"] = -1; dtRow["branch"] = String.Empty; dtRow["active"] = true; dt.Rows.InsertAt(dtRow, 0); cbo_branch_search.DataSource = dt; cbo_branch_search.DisplayMember = "branch"; cbo_branch_search.ValueMember = "auto_id"; } }
protected void GET_ACTIVE_GUARDS() { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_LIST_OF_ACTIVE_GUARDS"); if (dt != null) { DataRow dtRow = dt.NewRow(); dtRow["full_name"] = string.Empty; dtRow["guard_number"] = string.Empty; dt.Rows.InsertAt(dtRow, 0); this.cbo_guard_name.DataSource = dt; this.cbo_guard_name.DisplayMember = "full_name"; this.cbo_guard_name.ValueMember = "guard_number"; this.cbo_guard_name.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.cbo_guard_name.AutoCompleteSource = AutoCompleteSource.ListItems; } }
protected void GET_DEPARTMENTS() { DataTable dt = System_lookups.SELECT_LOOKUP_VALUES("SELECT_DEPARTMENTS"); if (dt != null) { this.gdv_departments.DataSource = dt; this.gdv_departments.Columns[0].Visible = false; this.gdv_departments.Columns[1].Visible = false; this.gdv_departments.Columns[2].HeaderText = "Department Name"; this.gdv_departments.Columns[3].HeaderText = "Department Active?"; this.gdv_departments.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_departments.DefaultCellStyle.SelectionForeColor = Color.Black; this.gdv_departments.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_departments.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_departments.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_departments.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_departments.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_departments.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_departments.DefaultCellStyle.SelectionForeColor = Color.Black; } }