Ejemplo n.º 1
0
        private void NStaffHomeBtn_Click(object sender, EventArgs e)
        {
            TeacherMyProfile tchrProfile = new TeacherMyProfile();

            this.Hide();
            tchrProfile.ShowDialog();
        }
        private void MngStaffImgBtn_Click(object sender, System.EventArgs e)
        {
            TeacherMyProfile myPro = new TeacherMyProfile();

            this.Hide();
            myPro.ShowDialog();
        }
Ejemplo n.º 3
0
        private void updateBtnOperation()
        {
            string genderValue     = "";
            bool   genderisChecked = maleRadioButton2.Checked;

            if (genderisChecked)
            {
                genderValue = maleRadioButton2.Text;
            }
            else
            {
                genderValue = femaleRadioButton1.Text;
            }

            DialogResult dlgResult = MessageBox.Show("Are You Sure You Want To Update?", "Update!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dlgResult == DialogResult.Yes)
            {
                con.Open();
                SqlCommand cmd = con.CreateCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = "UPDATE staff SET fullName = '" + NametextBox1.Text + "',name = '" + nameTextBox2.Text + "',gender = '" + genderValue + "',NIC = '" + NICTextBox.Text + "',DOB = '" + dateTimePicker1.Value + "',address = '" + addressTextBox.Text + "',phoneNo = '" + phNoTextBox.Text + "',email = '" + emailTextBox1.Text + "',subject = '" + subTextBox1.Text + "',pastSchool = '" + pastSchTextBox.Text + "',serviceYears = '" + Int32.Parse(serviceYrsTextBox.Text) + "',salary = '" + Convert.ToDouble(salaryTextBox.Text) + "',subject2 = '" + subTextBox2.Text + "' WHERE staffID = '" + GetSetInfo.getsetusrId + "'";
                cmd.ExecuteNonQuery();
                con.Close();
                GetSetInfo.userName = nameTextBox2.Text;

                MessageBox.Show("Updated Succesfully");

                TeacherMyProfile teacherMyProfile = new TeacherMyProfile();
                this.Hide();
                teacherMyProfile.ShowDialog();
            }
        }