protected void Search_Guards_by_guard_number() { if (txt_guard_number.Text == string.Empty) { MessageBox.Show("Guard Number cannot be empty", "Search Guards", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } string text = this.cbo_branch.Text; DateTime value = this.dt_deployment_date.Value; DataTable dt = Guard_deployment.select_list_of_deployed_guards_by_guard_number("select_list_of_deployed_guards_by_guard_number", txt_guard_number.Text); if (dt.Rows.Count <= 0) { this.gdv_deployment_summary.DataSource = dt; return; } DataRow item = dt.Rows[0]; this.gdv_deployment_summary.DataSource = dt; this.gdv_deployment_summary.Columns["deploy_type"].Visible = false; this.gdv_deployment_summary.Columns["branch_name"].Visible = false; this.gdv_deployment_summary.Columns["guard_auto_id"].Visible = false; this.gdv_deployment_summary.Columns["firearm_serial"].Visible = false; this.gdv_deployment_summary.Columns["number_of_ammunitions"].Visible = false; this.gdv_deployment_summary.Columns["is_leave_day_for_guard"].Visible = false; this.gdv_deployment_summary.Columns["is_public_holiday"].Visible = false; this.gdv_deployment_summary.Columns["record_guid"].Visible = false; this.gdv_deployment_summary.Columns["is_weekend"].Visible = false; this.gdv_deployment_summary.Columns["guard_name"].HeaderText = "Guard"; this.gdv_deployment_summary.Columns["guard_number"].HeaderText = "Guard"; this.gdv_deployment_summary.Columns["next_deploy_date"].HeaderText = "Day"; this.gdv_deployment_summary.Columns["client_name"].HeaderText = "Client"; this.gdv_deployment_summary.Columns["client_code"].HeaderText = "Client Code"; this.gdv_deployment_summary.Columns["client_location"].HeaderText = "Location"; this.gdv_deployment_summary.Columns["shift_type"].HeaderText = "Shift"; this.gdv_deployment_summary.Columns["guard_name"].Width = 250; this.gdv_deployment_summary.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_deployment_summary.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_deployment_summary.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_deployment_summary.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_deployment_summary.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_deployment_summary.DefaultCellStyle.SelectionBackColor = Color.DeepSkyBlue; this.gdv_deployment_summary.DefaultCellStyle.SelectionForeColor = Color.Black; foreach (DataGridViewColumn c in this.gdv_deployment_summary.Columns) { c.DefaultCellStyle.Font = new System.Drawing.Font("Arial", 11f, GraphicsUnit.Pixel); } this.gdv_deployment_summary.ColumnHeadersDefaultCellStyle.BackColor = Color.CadetBlue; this.gdv_deployment_summary.EnableHeadersVisualStyles = false; this.chk_save_status.Checked = true; }