예제 #1
0
 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));
 }
예제 #2
0
 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));
 }
예제 #3
0
 public FormMain()
 {
     InitializeComponent();
     InitializeMembers();
     this.CountyId = int.Parse(ConfigurationManager.AppSettings.Get("city"));
     db = new DataTier(CountyId);
     toolStripStatusLblCity.Text = db.GetCountyById;
 }
예제 #4
0
 public FormMain()
 {
     InitializeComponent();
     InitializeMembers();
     this.CountyId = int.Parse(ConfigurationManager.AppSettings.Get("city"));
     db            = new DataTier(CountyId);
     toolStripStatusLblCity.Text = db.GetCountyById;
 }
예제 #5
0
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
 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));
     }
 }
예제 #8
0
 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);
 }
예제 #9
0
 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);
 }
예제 #10
0
 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);
     }
 }
예제 #11
0
 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);
     }
 }
예제 #12
0
 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);
         }
     }
 }
예제 #13
0
 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);
         }
     }
 }
예제 #14
0
 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);
     }
 }
예제 #15
0
 private void FormEvent_Load(object sender, EventArgs e)
 {
     Util.SetupGrid(dataGridView1);
     db = new DataTier(Util.GetCountyId());
     db.LoadDataEvent(dataGridView1);
 }
예제 #16
0
 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);
         }
     }
 }
예제 #17
0
 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));
     }
 }
예제 #18
0
 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);
         }
     }
 }
예제 #19
0
 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);
     }
 }
예제 #20
0
 private void FormEvent_Load(object sender, EventArgs e)
 {
     Util.SetupGrid(dataGridView1);
     db = new DataTier(Util.GetCountyId());
     db.LoadDataEvent(dataGridView1);
 }