private void FormList_Load(object sender, EventArgs e) { Util.SetupGrid(dataGridView1); db = new DataTier(Util.GetCountyId()); toolStripComboBox1.SelectedIndex = 0; db.LoadDataPerson(dataGridView1, Util.ConvertState(toolStripComboBox1.SelectedIndex)); }
public FormMain() { InitializeComponent(); InitializeMembers(); this.CountyId = int.Parse(ConfigurationManager.AppSettings.Get("city")); db = new DataTier(CountyId); toolStripStatusLblCity.Text = db.GetCountyById; }
private void FormAddEvent_Load(object sender, EventArgs e) { db = new DataTier(Util.GetCountyId()); ucAdd1.Txt4Visible = false; ucAdd1.InitializePass( new string[] {Messages.event_name, Messages.event_desc, Messages.event_date }); ucAdd1.ButtonName = Messages.application_add_button; ucAdd1.ButtonClicked += new UcAddEventHandler(ucAdd1_ButtonClicked); }
private void FormAddEvent_Load(object sender, EventArgs e) { db = new DataTier(Util.GetCountyId()); ucAdd1.Txt4Visible = false; ucAdd1.InitializePass( new string[] { Messages.event_name, Messages.event_desc, Messages.event_date }); ucAdd1.ButtonName = Messages.application_add_button; ucAdd1.ButtonClicked += new UcAddEventHandler(ucAdd1_ButtonClicked); }
public static void OpenReportPerson(DataTier db, DataGridView dgv, int rowIndex, int columnIndex) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Report"]) { FormReport fr = new FormReport(); fr.Show(); int personId = int.Parse(dgv.Rows[rowIndex].Cells["Id"].Value.ToString()); fr.ShowReport("ReportPersonEvent.rdlc", "DataSetPersonEvent", db.GetPersonEvent(personId)); } }
private void FormAddPerson_Load(object sender, EventArgs e) { db = new DataTier(Util.GetCountyId()); ucAdd1.Txt4Visible = true; ucAdd1.InitializePass( new string[] { Messages.person_lpk, Messages.person_fname, Messages.person_sname, Messages.person_lname}); ucAdd1.ButtonName = Messages.application_add_button; ucAdd1.ButtonClicked += new UcAddEventHandler(ucAdd1_ButtonClicked); }
private void FormAddPerson_Load(object sender, EventArgs e) { db = new DataTier(Util.GetCountyId()); ucAdd1.Txt4Visible = true; ucAdd1.InitializePass( new string[] { Messages.person_lpk, Messages.person_fname, Messages.person_sname, Messages.person_lname }); ucAdd1.ButtonName = Messages.application_add_button; ucAdd1.ButtonClicked += new UcAddEventHandler(ucAdd1_ButtonClicked); }
private void FormReg_Load(object sender, EventArgs e) { db = new DataTier(Util.GetCountyId()); Util.SetupGrid(dataGridView1); if (!db.LoadRegEvent(lblEvent)) { linkAddEvent.Visible = true; } else { linkAddEvent.Visible = false; db.LoadDataEventPresence(dataGridView1); Util.BarcodePrepare(txtReg); } }
public static void DeleteCellClickEvent(DataTier db, DataGridView dgv, int rowIndex, int columnIndex) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Delete"]) { DialogResult dlg = MessageBox.Show(Messages.event_confirm_delete, Messages.application_confirm, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlg == DialogResult.OK) { db.RemoveEvent((int)dgv.Rows[rowIndex].Cells["Id"].Value); db.LoadDataEvent(dgv); } } }
public static void DeleteCellClickReg(DataTier db, DataGridView dgv, TextBox txtReg, int rowIndex, int columnIndex) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Delete"]) { DialogResult dlg = MessageBox.Show(Messages.reg_confirm, Messages.application_confirm, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlg == DialogResult.OK) { dgv.Rows.RemoveAt(rowIndex); db.CommitGridEventPresence(dgv); Util.BarcodePrepare(txtReg); } } }
public static void DeleteCellClickPerson(DataTier db, DataGridView dgv, int rowIndex, int columnIndex, bool active) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Active"]) { DialogResult dlg = MessageBox.Show(Messages.person_activate, Messages.application_confirm, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlg == DialogResult.OK) { db.ActivateDeactivatePerson((int)dgv.Rows[rowIndex].Cells["Id"].Value, active ? (byte)0 : (byte)1); } db.LoadDataPerson(dgv, active); } }
private void FormEvent_Load(object sender, EventArgs e) { Util.SetupGrid(dataGridView1); db = new DataTier(Util.GetCountyId()); db.LoadDataEvent(dataGridView1); }
public static void OpenReportReg(DataTier db, DataGridView dgv, int rowIndex, int columnIndex) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Report"]) { FormReport fr = new FormReport(); fr.Show(); int eventId = int.Parse(dgv.Rows[rowIndex].Cells["Id"].Value.ToString()); fr.ShowReport("ReportEvent.rdlc", "DataSetReg", db.GetEventReport(eventId)); } }
public static void DeleteCellClickReg(DataTier db, DataGridView dgv, TextBox txtReg,int rowIndex, int columnIndex) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Delete"]) { DialogResult dlg = MessageBox.Show(Messages.reg_confirm, Messages.application_confirm, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlg == DialogResult.OK) { dgv.Rows.RemoveAt(rowIndex); db.CommitGridEventPresence(dgv); Util.BarcodePrepare(txtReg); } } }
public static void DeleteCellClickPerson(DataTier db, DataGridView dgv, int rowIndex,int columnIndex, bool active) { if (rowIndex >= 0 && columnIndex >= 0 && !dgv.Rows[rowIndex].IsNewRow && dgv.Rows[rowIndex].Cells[columnIndex].OwningColumn == dgv.Columns["Active"]) { DialogResult dlg = MessageBox.Show(Messages.person_activate, Messages.application_confirm, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (dlg == DialogResult.OK) { db.ActivateDeactivatePerson((int)dgv.Rows[rowIndex].Cells["Id"].Value, active ? (byte)0 : (byte)1); } db.LoadDataPerson(dgv, active); } }