예제 #1
0
 private void ok_Click(object sender, EventArgs e)
 {
     if (passwordBox.Text != password2Box.Text)
     {
         label2.ForeColor = System.Drawing.Color.Red;
         label2.Text      = "Passwordet nuk jane te njejta";
     }
     else
     {
         AllChanges ac = new AllChanges();
         UserMapper um = new UserMapper();
         u.Emri     = emriBox.Text;
         u.Mbiemri  = mbiemriBox.Text;
         u.Username = usernameBox.Text;
         u.E_Mail   = emailBox.Text;
         u.Password = um.EncodePasswordToBase64(passwordBox.Text);
         ac.ndryshoTeDhenat(u);
     }
 }
        private void ok_Click(object sender, EventArgs e)
        {
            UserMapper um = new UserMapper();

            if (emriBox.Text.Trim() == "" || mbiemriBox.Text.Trim() == "" ||
                shtetiBox.Text.Trim() == "" || qytetiBox.Text.Trim() == "" ||
                usernameBox.Text.Trim() == "" || emailBox.Text.Trim() == "" ||
                bunifuDropdown1.Text.Trim() == "" || !um.checkPassowrd(pwBox.Text) || !pwBox.Text.Equals(cpwBox.Text))
            {
                label7.ForeColor = System.Drawing.Color.Red;
                label7.Text      = "Te dhenat nuk jane mire";
            }
            else
            {
                User u = new User();
                u.Emri     = emriBox.Text;
                u.Mbiemri  = mbiemriBox.Text;
                u.Gjinia   = bunifuDropdown1.Text[0] + "";
                u.Shteti   = shtetiBox.Text;
                u.Qyteti   = qytetiBox.Text;
                u.Username = usernameBox.Text;
                u.Password = um.EncodePasswordToBase64(pwBox.Text);
                u.E_Mail   = emailBox.Text;
                DateTime date = DateTime.Parse(datePick.Text);
                u.Data_e_lindjes = date;
                if (roli.Equals("prof"))
                {
                    u.Statusi = 1;
                }
                else
                {
                    u.Statusi = bunifuDropdown2.SelectedIndex + 1;
                }
                um.shtoStudent(u);
            }
        }