Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (isEmpty())
     {
         if (eIsupdateP)
         {
             UpdateMethod();
             this.Hide();
             EmployeeShowForm obj = new EmployeeShowForm();
             obj.Show();
         }
         else
         {
             SaveMethod();
             this.Hide();
             EmployeeShowForm obj = new EmployeeShowForm();
             obj.Show();
         }
     }
 }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string        c1    = ConfigurationManager.ConnectionStrings["edb"].ConnectionString;
            SqlConnection conn1 = new SqlConnection(c1);
            SqlCommand    cm    = new SqlCommand("select * from [EmployeeTbl] where [EmpName]='" + nametext.Text.Trim() + "'", conn1);

            SqlDataAdapter adapter = new SqlDataAdapter(cm);

            adapter.Fill(ds);
            int i = ds.Tables[0].Rows.Count;

            if (i > 0)
            {
                string        c    = ConfigurationManager.ConnectionStrings["edb"].ConnectionString;
                SqlConnection conn = new SqlConnection(c);
                SqlCommand    cmd  = new SqlCommand("spEdel", conn);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@n", nametext.Text.Trim());
                cmd.Parameters.AddWithValue("@designation", designationComboBox1.Text);
                cmd.Parameters.AddWithValue("@epwd", passwordtextbox.Text.Trim());
                cmd.Parameters.AddWithValue("@edate", joiningdate.Value.Date);

                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();
                MessageBox.Show("Delete Record Successfully", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
                EmployeeShowForm obj = new EmployeeShowForm();
                obj.Show();
            }
            else
            {
                MessageBox.Show("Employee Name " + nametext.Text + " is Not Exist", "ERROR!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
        private void employeesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EmployeeShowForm obj = new EmployeeShowForm();

            obj.ShowDialog();
        }