示例#1
0
 private void Btn_Click(object sender, EventArgs e)
 {
     Guna.UI.WinForms.GunaButton btn = sender as Guna.UI.WinForms.GunaButton;
     if (UserName != "")
     {
         string UserName  = this.UserName;
         string ItemName  = btn.Text;
         float  SalePrice = float.Parse(HomeController.PriceItem(ItemName).Tables[0].Rows[0][0].ToString());
         float  Quantity  = 1;
         bool   check     = OrderItemsController.AddCart(UserName, PassWord, ItemName, SalePrice, Quantity, ref err);
         if (check == true)
         {
             MessageBox.Show("Bạn đã thêm " + ItemName + " vào giỏ hàng thành công");
             this.lblShowCart.Text = OrderItemsController.ShowTotalDetails(UserName, PassWord).Tables[0].Rows[0][0].ToString();
         }
         else
         {
             MessageBox.Show("Bạn đã thêm món ăn vào giỏ hàng thất bại");
         }
     }
     else
     {
         DialogResult dialogResult;
         dialogResult = MessageBox.Show("Mời bạn đăng nhập để sử dụng tính năng này", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
         if (dialogResult == DialogResult.OK)
         {
             this.Hide();
             frmSignIn frmSign = new frmSignIn();
             frmSign.ShowDialog();
             this.Close();
         }
     }
 }
        private void lblLoginStatus_Click(object sender, EventArgs e)
        {
            frmSignIn signIn = new frmSignIn();

            signIn.Show();
            this.Hide();
        }
示例#3
0
        private void btnSignIn_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmSignIn frmSignIn = new frmSignIn();

            frmSignIn.ShowDialog();
            this.Close();
        }
        private void btnSignUp_Click(object sender, EventArgs e)
        {
            string   UserName    = txtAccount.Text.Trim();
            string   PassWord    = txtPassword.Text.Trim();
            string   FullName    = txtFullName.Text.Trim();
            string   Gender      = cbbGender.SelectedItem.ToString();
            DateTime DateofBirth = dtpDateOfBirth.Value;
            string   PhoneNumber = txtPhone.Text.Trim();
            string   Email       = txtEmail.Text.Trim();
            string   Province    = cbbProvince.SelectedItem.ToString();
            string   District    = cbbDistrict.SelectedItem.ToString();
            string   Ward        = cbbWard.SelectedItem.ToString();
            string   Street      = txtStreet.Text.Trim();

            if (iName == "")
            {
                iName = "noImageUser.png";
            }
            string Image = iName;
            bool   check = SignUpController.Register_Customer(UserName, PassWord, FullName, Gender, DateofBirth, PhoneNumber, Email, Image, Province, District, Ward, Street, ref err);

            if (check == true)
            {
                DialogResult dialogResult;
                dialogResult = MessageBox.Show("Bạn đã tạo tài khoản thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (dialogResult == DialogResult.OK)
                {
                    this.Hide();
                    frmSignIn form = new frmSignIn();
                    form.ShowDialog();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Đăng ký thất bại, xin thử lại lần nữa", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#5
0
 private void btnShoppingCart_Click(object sender, EventArgs e)
 {
     if (UserName != "")
     {
         this.Hide();
         frmShoppingCart frmCart = new frmShoppingCart(UserName, PassWord);
         frmCart.ShowDialog();
         this.lblShowCart.Text = OrderItemsController.ShowTotalDetails(UserName, PassWord).Tables[0].Rows[0][0].ToString();
         this.Show();
     }
     else
     {
         DialogResult dialogResult;
         dialogResult = MessageBox.Show("Mời bạn đăng nhập để sử dụng tính năng này", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
         if (dialogResult == DialogResult.OK)
         {
             this.Hide();
             frmSignIn frmSign = new frmSignIn();
             frmSign.ShowDialog();
             this.Close();
         }
     }
 }
示例#6
0
        private void toolStripSignIn_Click(object sender, EventArgs e)
        {
            frmSignIn f = new frmSignIn();

            f.Show();
        }