Esempio n. 1
0
 protected override void OnFormClosing(System.Windows.Forms.FormClosingEventArgs e)
 {
     if (!string.IsNullOrEmpty(MyExcel.DB_PATH))
     {
         MyExcel.CloseExcel();
     }
 }
Esempio n. 2
0
 private void txtSearchExpr_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSearchExpr.Text))
     {
         dataGridEmpList.DataSource = MyExcel.FilterEmpList(cmbSearch.Text.ToString(), txtSearchExpr.Text.ToLower());
     }
     else
     {
         dataGridEmpList.DataSource = MyExcel.EmpList;
     }
 }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Votante emp = new Votante
            {
                Nombres   = textName.Text.ToString(),
                Cedula_ID = textCedulaID.Text.ToString(),
                Apellidos = txtApellidos.Text.ToString(),
                Candidato = cbxCandidato.SelectedItem.ToString()
            };

            MyExcel.WriteToExcel(emp);
            clearAllFields();
            textName.Focus();
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Employee emp = new Employee {
                Name        = textName.Text.ToString(),
                Employee_ID = textEmpID.Text.ToString(),
                Email_ID    = textEmailID.Text.ToString() + "@" +
                              textDomain.Text.ToString(),
                Number = textMobileNo.Text.ToString()
            };

            MyExcel.WriteToExcel(emp);
            clearAllFields();
            MessageBox.Show("Details were successfully added to the excel !!", "Success..", MessageBoxButtons.OK, MessageBoxIcon.Information);
            textName.Focus();
        }
Esempio n. 5
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog ExcelDialog = new OpenFileDialog();

            ExcelDialog.Filter           = "Excel Files (*.xlsx) | *.xlsx";
            ExcelDialog.InitialDirectory = @"D:\";
            ExcelDialog.Title            = "Select your team excel";
            if (ExcelDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                MyExcel.DB_PATH        = ExcelDialog.FileName;
                txtFileName.Text       = ExcelDialog.FileName;
                txtFileName.ReadOnly   = true;
                txtFileName.Click     -= btnLoad_Click;
                tabControl1.Selecting -= tabControl1_Selecting;
                btnLoad.Enabled        = false;
                MyExcel.InitializeExcel();
                dataGridEmpList.DataSource = MyExcel.ReadMyExcel();
                tblLytAddMem.Visible       = true;
            }
        }