Ejemplo n.º 1
0
        private void UPDATE_Click(object sender, EventArgs e)
        {
            if (Basic_Pay.Text == "" || Deduction.Text == "")
            {
                MessageBox.Show("PLZ_FILL_RECOMMENDED_DATA__!!");
            }
            else
            {
                con.Open();
                SqlDataAdapter sda = new SqlDataAdapter("UPDATE SALARY SET Emp_ID='" + Emp_ID.Text + "',Date_Of_Joining='" + DOJ.Text + "',Date_Of_Retirement='" + DOR.Text + "',Basic_Pay='" + Basic_Pay.Text + "',Deduction='" + Deduction.Text + "',E_Salary_Code='" + ESC.Text + "' WHERE Salary_ID='" + Salary_ID.Text + "'", con);
                sda.SelectCommand.ExecuteNonQuery();
                con.Close();

                MessageBox.Show("UPDATED_SUCCESSFULLY!!");

                Salary_ID.Text = "";
                Emp_ID.Text    = "";
                DOJ.Text       = "";
                DOR.Text       = "";
                Basic_Pay.Text = "";
                Deduction.Text = "";
                ESC.Text       = "";
                Date.Text      = "";

                Emp_ID.Focus();
            }
        }
        private void CLEAR_Click(object sender, EventArgs e)
        {
            Status.Text = "";
            Emp_ID.Text = "";

            Emp_ID.Focus();

            MessageBox.Show("ALL_DATA_CLEARED__!!!");
        }
Ejemplo n.º 3
0
        private void CLEAR_Click(object sender, EventArgs e)
        {
            Salary_ID.Text = "";
            Emp_ID.Text    = "";
            DOJ.Text       = "";
            DOR.Text       = "";
            Basic_Pay.Text = "";
            Deduction.Text = "";
            ESC.Text       = "";
            Date.Text      = "";

            Emp_ID.Focus();

            MessageBox.Show("All_CLEAR__");
        }
        private void Delete_Click(object sender, EventArgs e)
        {
            if (Status.Text == "" || Emp_ID.Text == "")
            {
                MessageBox.Show("PLEASE_FILL_ALL_RECOMMENDED_DATA_FIRST_!!");
            }
            else
            {
                con.Open();
                SqlCommand scd = new SqlCommand("DELETE FROM Employees WHERE Status='" + Status.Text + "' and Emp_ID='" + Emp_ID.Text + "'", con);
                scd.ExecuteNonQuery();
                con.Close();

                Status.Text = "";
                Emp_ID.Text = "";

                Emp_ID.Focus();


                MessageBox.Show("DATA_DELETED_SUCCESSFULLY___!!!");
            }
        }