Esempio n. 1
0
        private void backBtn_Click(object sender, EventArgs e)
        {
            HomeScreen hs = new HomeScreen();

            MainClass.showWindow(hs, this, MDI.ActiveForm);
        }
Esempio n. 2
0
 public override void saveBtn_Click(object sender, EventArgs e)
 {
     if (nameTxt.Text == "")
     {
         nameErrorLabel.Visible = true;
     }
     else
     {
         nameErrorLabel.Visible = false;
     }
     if (usernameTxt.Text == "")
     {
         usernameErrorLabel.Visible = true;
     }
     else
     {
         usernameErrorLabel.Visible = false;
     }
     if (PasswordTxt.Text == "")
     {
         passErrorLabel.Visible = true;
     }
     else
     {
         passErrorLabel.Visible = false;
     }
     if (cpassTxt.Text == "")
     {
         cpassErrorLabel.Visible = true;
     }
     else
     {
         cpassErrorLabel.Visible = false;
     }
     //For Password Not Matching Confirm Password
     if (PasswordTxt.Text != cpassTxt.Text)
     {
         mismatchedErrorLabel.Visible = true;
     }
     else
     {
         mismatchedErrorLabel.Visible = false;
     }
     if (phoneTxt.Text == "")
     {
         phone1ErrorLabel.Visible = true;
     }
     else
     {
         phone1ErrorLabel.Visible = false;
     }
     if (roleCBTxt.SelectedIndex == -1)
     {
         roleErrorLabel.Visible = true;
     }
     else
     {
         roleErrorLabel.Visible = false;
     }
     if (statusDD.SelectedIndex == -1)
     {
         statusErrorLabel.Visible = true;
     }
     else
     {
         statusErrorLabel.Visible = false;
     }
     if (nameErrorLabel.Visible || usernameErrorLabel.Visible || passErrorLabel.Visible || cpassErrorLabel.Visible || mismatchedErrorLabel.Visible || phone1ErrorLabel.Visible || roleErrorLabel.Visible || statusErrorLabel.Visible)
     {
         MainClass.showMSG("Fields with * are mandatory.", "Stop", "Error");
     }
     else
     {
         //Code for SAVE Operation
         if (edit == 0)
         {
             if (imagePathTxt.Text == "")
             {
                 byte stat = statusDD.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0);
                 obj.st_insertStaffWithOutImage(nameTxt.Text, usernameTxt.Text, usernameTxt.Text, phoneTxt.Text, phone2Txt.Text, Convert.ToByte(roleCBTxt.SelectedValue.ToString()), stat);
                 MainClass.showMSG(nameTxt.Text + " added successfully to the system", "Success", "Success");
             }
             else
             {
                 /*
                  * MemoryStream ms = new MemoryStream();
                  * i.Save(ms, ImageFormat.Jpeg);
                  * byte[] arr = ms.ToArray();
                  * byte stat = statusDD.SelectedIndex == 0 ? Convert.ToByte(1) : Convert.ToByte(0);
                  * string rol = Convert.ToInt32(roleCBTxt.SelectedValue.ToString());
                  * obj.st_insertStaff(nameTxt.Text, usernameTxt.Text, usernameTxt.Text, phoneTxt.Text, phone2Txt.Text, rol, stat, arr);
                  * MainClass.showMSG(nameTxt.Text + " added successfully to the system", "Success", "Success");
                  */
             }
         }
         //Code for UPDATE Operation
         else if (edit == 1)
         {
         }
     }
 }
Esempio n. 3
0
 public override void addBtn_Click(object sender, EventArgs e)
 {
     MainClass.enable_reset(panel6);
     imagePathTxt.Enabled = false;
     edit = 0;
 }
Esempio n. 4
0
 public override void editBtn_Click(object sender, EventArgs e)
 {
     edit = 1;
     MainClass.enable(panel6);
     imagePathTxt.Enabled = false;
 }
Esempio n. 5
0
 private void Staff_Load(object sender, EventArgs e)
 {
     MainClass.disable_reset(panel6);
 }