예제 #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string username = Request.Cookies["usernameLoginSystem"].Value;
            var    acc      = AccountController.GetByUsername(username);

            if (acc != null)
            {
                if (acc.RoleID == 0)
                {
                    int id = ViewState["ID"].ToString().ToInt(0);
                    if (id > 0)
                    {
                        var d = DiscountGroupController.GetByID(id);
                        if (d != null)
                        {
                            var dc = DiscountController.update(id, txtQuantity.Text.ToInt(), txtDiscountPerProduct.Text.ToInt(), username);
                            if (dc > 0)
                            {
                                PJUtils.ShowMessageBoxSwAlert("Cập nhật thành công", "s", true, Page);
                            }
                            else
                            {
                                PJUtils.ShowMessageBoxSwAlert("Thất bại", "e", false, Page);
                            }
                        }
                    }
                }
            }
        }