Beispiel #1
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (LoggedUser != null)
     {
         SqlConn.UpdateCart(LoggedUser);
     }
 }
Beispiel #2
0
        private async void tbUsername_Validating(object sender, CancelEventArgs e)
        {
            if (tbUsername.Text.Trim().Length == 0)
            {
                e.Cancel = true;
                errorProvider1.SetError(tbUsername, "Корисничкото име е задолжително");
            }
            else
            {
                bool userExists = await SqlConn.userExists(tbUsername.Text);

                if (userExists)
                {
                    e.Cancel = true;
                    errorProvider1.SetError(tbUsername, "Корисничкото име е во употреба, внесете друго");
                }
                else
                {
                    errorProvider1.SetError(tbUsername, null);
                }
            }
        }
Beispiel #3
0
 private void bwSignIn_DoWork(object sender, DoWorkEventArgs e)
 {
     pbLoading.Image = Properties.Resources.loading;
     e.Result        = SqlConn.SignIn(tbName.Text);
 }
Beispiel #4
0
 private void bwSignUp_DoWork(object sender, DoWorkEventArgs e)
 {
     pbLoading.Image = Properties.Resources.loading;
     e.Result        = SqlConn.SignUp(new User(tbUsername.Text, tbPassword.Text, tbName.Text, tbSurname.Text, tbEmail.Text, ""));
 }
Beispiel #5
0
 private void bwUpdateDB_DoWork(object sender, DoWorkEventArgs e)
 {
     e.Result = SqlConn.UpdateCart(LoggedUser);
 }