Ejemplo n.º 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)
                {
                    string phone     = txtCustomerName.Text.ToLower().Trim();
                    var    checkname = VariableController.GetByName(phone);
                    if (checkname != null)
                    {
                        lblError.Text    = "Tên danh mục đã tồn tại vui lòng chọn tên khác.";
                        lblError.Visible = true;
                    }
                    else
                    {
                        lblError.Visible = false;
                        VariableController.Insert(txtCustomerName.Text, "", chkIsHidden.Checked, DateTime.Now, username);
                        PJUtils.ShowMessageBoxSwAlert("Tạo mới thành công", "s", true, Page);
                    }
                }
            }
        }