Exemplo n.º 1
0
 //Create new account
 private void btSignIn_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(MyConnect.getString("select Email from LogIn where Email=N'" + txNewEmail.Text + "'")))
     {
         MyChecker.setErr(txNewEmail, errorEmail, "Email Invailable!", Properties.Resources.ERROR); email = false; txNewEmail.Focus(); return;
     }
     if (!username)
     {
         txNewUserName.Focus(); return;
     }
     else if (!email)
     {
         txNewEmail.Focus(); return;
     }
     else if (!password)
     {
         txNewPassword.Focus(); return;
     }
     else if (!confirompw)
     {
         txConfiromPw.Focus(); return;
     }
     else
     {
         if (ac.AddObject(new Account(txNewUserName.Text, StringPassword.EncrytString(txNewPassword.Text, Properties.Resources.KeyCrypt), cbManager.Checked, txNewEmail.Text)))
         {
             MessageBox.Show("Create new account successfully!");
         }
         else
         {
             MessageBox.Show("Can't create account!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         setAutoCompleteCollection();
     }
 }
Exemplo n.º 2
0
 bool checkPrimaryKey(string sql)
 {
     if (String.IsNullOrEmpty(MyConnect.getString(sql)))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 public string getUserName(string email)
 {
     return(MyConnect.getString("select UserName from LogIn where Email = N'" + email + "'"));
 }
Exemplo n.º 4
0
 public bool checkID(string id)
 {
     return(!String.IsNullOrEmpty(MyConnect.getString("select ID_Supplier from Suppliers where ID_Supplier = '" + id + "'")));
 }
Exemplo n.º 5
0
 public bool checkID(string id)
 {
     return(!String.IsNullOrEmpty(MyConnect.getString("select ID_Purchase from Purchase where ID_Purchase='" + id + "'")));
 }
Exemplo n.º 6
0
 public bool checkID(string id)
 {
     return(!String.IsNullOrEmpty(MyConnect.getString("select ID_Type from ProductTypes where ID_Type ='" + id + "'")));
 }
Exemplo n.º 7
0
 public bool checkID(string id)
 {
     return(!String.IsNullOrEmpty(MyConnect.getString("select ID_Emp from Employee where ID_Emp=N'" + id + "'")));
 }