protected void SELECT_ARCHIVED_GUARDS_STATS() { try { DataTable dt = Archieve_Lists.SELECT_ARCHIVED_GUARDS_STATS("SELECT_ARCHIVED_GUARDS_STATS"); if (dt != null) { this.gdv_statisctics.DataSource = dt; this.gdv_statisctics.Columns[0].HeaderText = "STATUS"; this.gdv_statisctics.Columns[1].HeaderText = "TOTAL"; this.gdv_statisctics.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_statisctics.DefaultCellStyle.SelectionForeColor = Color.Black; this.gdv_statisctics.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_statisctics.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_statisctics.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_statisctics.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_statisctics.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_statisctics.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_statisctics.DefaultCellStyle.SelectionForeColor = Color.Black; } } catch (Exception exception) { MessageBox.Show(exception.ToString()); } }
protected void GET_GUARD_LIST() { try { DataTable dt = Archieve_Lists.RETURN_OFFICER_LIST("SELECT_ARCHIEVED_GUARDS_LIST"); if (dt != null) { this.gdv_guards.DataSource = dt; this.gdv_guards.Columns[0].Visible = false; this.gdv_guards.Columns[1].Visible = false; this.gdv_guards.Columns[2].HeaderText = "NAME"; this.gdv_guards.Columns[3].HeaderText = "BRANCH"; this.gdv_guards.Columns[4].HeaderText = "STATUS"; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; this.gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; } } catch (Exception exception) { MessageBox.Show(exception.ToString()); } }
private void frm_archieved_guard_list_report_Load(object sender, EventArgs e) { string _guard_status = SystemConst._guard_status; if (_guard_status != String.Empty) { try { this.WindowState = System.Windows.Forms.FormWindowState.Maximized; cr_archived_guard_lists report = new cr_archived_guard_lists(); ParameterFields paramFields = new ParameterFields(); ParameterField paramField = new ParameterField(); ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in report.Database.Tables) { Set_Report_logons.SetTableLogin(tbCurrent); } report.SetDataSource(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS", _guard_status)); report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS"); report.SetParameterValue("guard_status", SystemConst._guard_status); cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields; this.cr_viewer_archieved_guards_report.ReportSource = report; //this.crystalReportViewer1.RefreshReport(); } catch (Exception ex) { throw ex; } } else { this.WindowState = System.Windows.Forms.FormWindowState.Maximized; cr_archived_guard_lists report = new cr_archived_guard_lists(); ParameterFields paramFields = new ParameterFields(); ParameterField paramField = new ParameterField(); ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); report.SetDatabaseLogon("sg_admin", "sg_admin123"); //hide the password from the code..get it from configuration file... report.SetDataSource(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_ALL("SELECT_ARCHIEVED_GUARD_LIST_ALL")); report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_ALL"); // report.SetParameterValue("guard_status", SystemConst._guard_status); cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields; this.cr_viewer_archieved_guards_report.ReportSource = report; //this.crystalReportViewer1.RefreshReport(); } }
private void frm_archieved_guard_list_report_Load(object sender, EventArgs e) { string _guard_status = SystemConst._guard_status; if (_guard_status == string.Empty) { base.WindowState = FormWindowState.Maximized; cr_archived_guard_lists report = new cr_archived_guard_lists(); ParameterFields paramFields = new ParameterFields(); ParameterField parameterField1 = new ParameterField(); ParameterDiscreteValue parameterDiscreteValue1 = new ParameterDiscreteValue(); foreach (Table tbCurrent in report.Database.Tables) { Set_Report_logons.SetTableLogin(tbCurrent); } report.SetDataSource(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("SELECT_ARCHIEVED_GUARD_LIST_ALL", _guard_status)); report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_ALL"); report.SetParameterValue("guard_status", SystemConst._guard_status); report.SetParameterValue("client_name", SystemConst.ClientName); this.cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields; this.cr_viewer_archieved_guards_report.ReportSource = report; } else { try { base.WindowState = FormWindowState.Maximized; cr_archived_guard_lists report = new cr_archived_guard_lists(); ParameterFields paramFields = new ParameterFields(); ParameterField parameterField1 = new ParameterField(); ParameterDiscreteValue parameterDiscreteValue1 = new ParameterDiscreteValue(); foreach (Table tbCurrent in report.Database.Tables) { Set_Report_logons.SetTableLogin(tbCurrent); } report.SetDataSource(Archieve_Lists.SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS", _guard_status)); report.SetParameterValue("QueryName", "SELECT_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS"); report.SetParameterValue("guard_status", SystemConst._guard_status); this.cr_viewer_archieved_guards_report.ParameterFieldInfo = paramFields; this.cr_viewer_archieved_guards_report.ReportSource = report; } catch (Exception exception) { throw exception; } } }
private void btn_name_search_Click(object sender, EventArgs e) { if (cbo_guard_status.Text != String.Empty && cbo_branch_search.Text == String.Empty) { DataTable dt = Archieve_Lists.SEARCH_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("FILTER_ARCHIEVE_BY_STATUS", cbo_guard_status.Text); if (dt != null) { gdv_guards.DataSource = dt; gdv_guards.Columns[0].Visible = false; gdv_guards.Columns[1].Visible = false; gdv_guards.Columns[2].HeaderText = "NAME"; gdv_guards.Columns[3].HeaderText = "BRANCH"; gdv_guards.Columns[4].HeaderText = "STATUS"; gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; // Set the row and column header styles. gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; // Set the selection background color for all the cells. gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; } else { DataTable dt_null = null; gdv_statisctics.DataSource = dt_null; } } else if (cbo_guard_status.Text == String.Empty && cbo_branch_search.Text != String.Empty) { DataTable dt = Archieve_Lists.SEARCH_ARCHIEVED_GUARD_LIST_REPORT_BY_BRANCH("FILTER_ARCHIEVE_BY_STATION", cbo_branch_search.Text); if (dt != null) { gdv_guards.DataSource = dt; gdv_guards.Columns[0].Visible = false; gdv_guards.Columns[1].Visible = false; gdv_guards.Columns[2].HeaderText = "NAME"; gdv_guards.Columns[3].HeaderText = "BRANCH"; gdv_guards.Columns[4].HeaderText = "STATUS"; gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; // Set the row and column header styles. gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; // Set the selection background color for all the cells. gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; } else { DataTable dt_null = null; gdv_statisctics.DataSource = dt_null; } } else if (cbo_guard_status.Text != String.Empty && cbo_branch_search.Text != String.Empty) { DataTable dt = Archieve_Lists.SEARCH_ARCHIEVED_GUARD_LIST_REPORT_BY_BRANCH_AND_STATUS("FILTER_ARCHIEVE_BY_STATION", cbo_branch_search.Text, cbo_guard_status.Text); if (dt != null) { gdv_guards.DataSource = dt; gdv_guards.Columns[0].Visible = false; gdv_guards.Columns[1].Visible = false; gdv_guards.Columns[2].HeaderText = "NAME"; gdv_guards.Columns[3].HeaderText = "BRANCH"; gdv_guards.Columns[4].HeaderText = "STATUS"; gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; // Set the row and column header styles. gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; // Set the selection background color for all the cells. gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; } else { DataTable dt_null = null; gdv_statisctics.DataSource = dt_null; } } else { GET_GUARD_LIST(); } }
private void btn_name_search_Click(object sender, EventArgs e) { if (this.cbo_guard_status.Text != string.Empty && this.cbo_branch_search.Text == string.Empty) { DataTable _dt = Archieve_Lists.SEARCH_ARCHIEVED_GUARD_LIST_REPORT_BY_STATUS("FILTER_ARCHIEVE_BY_STATUS", this.cbo_guard_status.Text); if (_dt == null) { this.gdv_statisctics.DataSource = null; return; } this.gdv_guards.DataSource = _dt; this.gdv_guards.Columns[0].Visible = false; this.gdv_guards.Columns[1].Visible = false; this.gdv_guards.Columns[2].HeaderText = "NAME"; this.gdv_guards.Columns[3].HeaderText = "BRANCH"; this.gdv_guards.Columns[4].HeaderText = "STATUS"; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; this.gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; return; } if (this.cbo_guard_status.Text == string.Empty && this.cbo_branch_search.Text != string.Empty) { DataTable _dt = Archieve_Lists.SEARCH_ARCHIEVED_GUARD_LIST_REPORT_BY_BRANCH("FILTER_ARCHIEVE_BY_STATION", this.cbo_branch_search.Text); if (_dt == null) { this.gdv_statisctics.DataSource = null; return; } this.gdv_guards.DataSource = _dt; this.gdv_guards.Columns[0].Visible = false; this.gdv_guards.Columns[1].Visible = false; this.gdv_guards.Columns[2].HeaderText = "NAME"; this.gdv_guards.Columns[3].HeaderText = "BRANCH"; this.gdv_guards.Columns[4].HeaderText = "STATUS"; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; this.gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; return; } if (!(this.cbo_guard_status.Text != string.Empty) || !(this.cbo_branch_search.Text != string.Empty)) { this.GET_GUARD_LIST(); return; } DataTable dt = Archieve_Lists.SEARCH_ARCHIEVED_GUARD_LIST_REPORT_BY_BRANCH_AND_STATUS("FILTER_ARCHIEVE_BY_STATION", this.cbo_branch_search.Text, this.cbo_guard_status.Text); if (dt == null) { this.gdv_statisctics.DataSource = null; return; } this.gdv_guards.DataSource = dt; this.gdv_guards.Columns[0].Visible = false; this.gdv_guards.Columns[1].Visible = false; this.gdv_guards.Columns[2].HeaderText = "NAME"; this.gdv_guards.Columns[3].HeaderText = "BRANCH"; this.gdv_guards.Columns[4].HeaderText = "STATUS"; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; this.gdv_guards.RowsDefaultCellStyle.BackColor = Color.LightGray; this.gdv_guards.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige; this.gdv_guards.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; this.gdv_guards.ColumnHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.RowHeadersDefaultCellStyle.BackColor = Color.Black; this.gdv_guards.DefaultCellStyle.SelectionBackColor = Color.White; this.gdv_guards.DefaultCellStyle.SelectionForeColor = Color.Black; }