protected void Page_Load(object sender, EventArgs e) { id = BizUtils.GetQueryString("Id", Request); level = BizUtils.GetQueryString("Level", Request); if (!IsPostBack) { if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; GroupProduct objGr = new GroupProduct(); objGr.Id = int.Parse(id); objGr = objGr.SelectById(); txtName.Value = objGr.Name; txtImage.Value = objGr.Image; imgImage.ImageUrl = objGr.Image; txtKeywords.Value = objGr.Keywords; txtDescription.Value = objGr.Description; //chkPriority.Checked = objGr.Priority == 1; //chkPosition.Checked = objGr.Position == 1; txtOrd.Value = objGr.Ord.ToString(); chkActive.Checked = objGr.Active == 1; lblTitle.Text = "Cập nhật nhóm sản phẩm"; } else { txtOrd.Value = Config.GetMaxOrd("GroupProduct", level, true); } } }
protected void Page_Load(object sender, EventArgs e) { id = BizUtils.GetQueryString("Id", Request); level = BizUtils.GetQueryString("Level", Request); if (!IsPostBack) { if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; GroupImages objGr = new GroupImages(); objGr.Id = int.Parse(id); objGr = objGr.SelectById(); txtName.Value = objGr.Name; txtOrd.Value = objGr.Ord.ToString(); chkActive.Checked = objGr.Active == 1; lblTitle.Text = "Cập nhật nhóm hình ảnh"; } else { txtOrd.Value = Config.GetMaxOrd("GroupImages", level, true); } } }
protected void Page_Load(object sender, EventArgs e) { id = BizUtils.GetQueryString("Id", Request); if (!IsPostBack) { if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; User objUser = new User(); objUser.Id = int.Parse(id); objUser = objUser.SelectById(); txtName.Value = objUser.Name; txtUserName.Value = objUser.UserName; txtPassword.Value = objUser.Password; txtEmail.Value = objUser.Email; txtPhone.Value = objUser.Phone; chkAdmin.Checked = objUser.Admin == 1; chkActive.Checked = objUser.Active == 1; lblTitle.Text = "Cập nhật thông tin người dùng"; } } }
protected void Page_Load(object sender, EventArgs e) { id = BizUtils.GetQueryString("Id", Request); if (!IsPostBack) { BizUtils.LoadDropDownList(ddlPosition, "Banner, Logo, Quảng cáo"); if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; Advertise objAd = new Advertise(); objAd.Id = int.Parse(id); objAd = objAd.SelectById(); txtName.Value = objAd.Name; txtImage.Value = objAd.Image; imgImage.ImageUrl = objAd.Image; txtLink.Value = objAd.Link; ddlTarget.Value = objAd.Target; ddlPosition.Value = objAd.Position.ToString(); txtOrd.Value = objAd.Ord.ToString(); chkActive.Checked = objAd.Active == 1; lblTitle.Text = "Cập nhật thông tin quảng cáo"; } else { txtOrd.Value = Config.GetMaxOrd("Advertise", ""); } } }
protected void Page_Load(object sender, EventArgs e) { try { id = BizUtils.GetQueryString("Id", Request); if (!IsPostBack) { GroupProduct objGr = new GroupProduct(); List <GroupProduct> lstGr = objGr.SelectByTop("", "Active = 1 AND Position = 1", "Level, Ord"); ddlGroup.Items.Clear(); ddlGroup.Items.Add(new ListItem("--Chọn nhóm dịch vụ--", "")); for (int i = 0; i < lstGr.Count; i++) { objGr = lstGr[i]; ddlGroup.Items.Add(new ListItem(StringClass.ShowNameLevel(objGr.Name, objGr.Level), objGr.Id.ToString())); } ddlGroup.DataBind(); if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; Product objPr = new Product(); objPr.Id = int.Parse(id); objPr = objPr.SelectById(); txtName.Value = objPr.Name; txtImage1.Value = objPr.Image1; imgImage1.ImageUrl = objPr.Image1; txtImage2.Value = objPr.Image2; imgImage2.ImageUrl = objPr.Image2; txtImage3.Value = objPr.Image3; imgImage3.ImageUrl = objPr.Image3; txtImage4.Value = objPr.Image4; imgImage4.ImageUrl = objPr.Image4; txtContent.Value = objPr.Content; ddlGroup.Value = objPr.GroupId.ToString(); fckDetail.Value = objPr.Detail; txtKeywords.Value = objPr.Keywords; txtDescription.Value = objPr.Description; chkPopular.Checked = objPr.IsPopular == 1; txtOrd.Value = objPr.Ord.ToString(); chkActive.Checked = objPr.Active == 1; lblTitle.Text = "Cập nhật dịch vụ"; } else { txtOrd.Value = Config.GetMaxOrd("Product", ""); } } } catch (Exception) { throw; } }
protected void Page_Load(object sender, EventArgs e) { id = BizUtils.GetQueryString("Id", Request); level = BizUtils.GetQueryString("Level", Request); if (!IsPostBack) { LoadDropDownListPageLink(); if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; PageInfo objAd = new PageInfo(); objAd.Id = int.Parse(id); objAd = objAd.SelectById(); txtName.Value = objAd.Name; level = objAd.Level; ddlType.Value = objAd.Type.ToString(); txtImage.Value = objAd.Image; imgImage.ImageUrl = objAd.Image; fckDetail.Value = objAd.Detail; try { ddlLink.Value = objAd.Link; ddlLinkType.Value = "1"; } catch (Exception) { ddlLinkType.Value = "0"; txtLink.Value = objAd.Link; } ddlTarget.Value = objAd.Target; foreach (ListItem item in ddlPosition.Items) { if (objAd.Position.Contains(item.Value)) { item.Selected = true; } } txtOrd.Value = objAd.Ord.ToString(); chkActive.Checked = objAd.Active == 1; fckKeywords.Value = objAd.Keyword; txtDescription.Value = objAd.Description; lblTitle.Text = "Cập nhật menu"; } else { txtOrd.Value = Config.GetMaxOrd("Page", level, true); } } }
protected void Page_Load(object sender, EventArgs e) { try { id = BizUtils.GetQueryString("Id", Request); if (!IsPostBack) { GroupImages objGr = new GroupImages(); List <GroupImages> lstGr = GroupImages.SelectByTop("", "Active = 1", "Level, Ord"); ddlGroup.Items.Clear(); ddlGroup.Items.Add(new ListItem("--Chọn nhóm hình ảnh--", "")); for (int i = 0; i < lstGr.Count; i++) { objGr = lstGr[i]; ddlGroup.Items.Add(new ListItem(StringClass.ShowNameLevel(objGr.Name, objGr.Level), objGr.Id.ToString())); } ddlGroup.DataBind(); if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; Images objPr = new Images(); objPr.Id = int.Parse(id); objPr = objPr.SelectById(); txtName.Value = objPr.Thumbnail; txtImage.Value = objPr.Image; imgImage.ImageUrl = objPr.Image; ddlGroup.Value = objPr.GroupId.ToString(); chkPriority.Checked = objPr.Priority == 1; txtOrd.Value = objPr.Ord.ToString(); chkActive.Checked = objPr.Active == 1; lblTitle.Text = "Cập nhật hình ảnh"; } else { txtOrd.Value = Config.GetMaxOrd("Images", ""); } } } catch (Exception) { throw; } }
protected void Page_Load(object sender, EventArgs e) { id = BizUtils.GetQueryString("Id", Request); if (!IsPostBack) { if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; Support objSupport = new Support(); objSupport.Id = int.Parse(id); objSupport = objSupport.SelectById(); txtName.Value = objSupport.Name; txtEmail.Value = objSupport.Email; txtPhone.Value = objSupport.Phone; txtSkype.Value = objSupport.Skype; chkActive.Checked = objSupport.Active == 1; lblTitle.Text = "Cập nhật thông tin người hỗ trợ"; } } }
protected void Page_Load(object sender, EventArgs e) { try { id = BizUtils.GetQueryString("Id", Request); if (!IsPostBack) { GroupNews objGr = new GroupNews(); List <GroupNews> lstGr = GroupNews.SelectByTop("", "Active = 1", "Level, Ord"); ddlGroup.Items.Clear(); ddlGroup.Items.Add(new ListItem("--Chọn nhóm tin tức--", "")); for (int i = 0; i < lstGr.Count; i++) { objGr = lstGr[i]; ddlGroup.Items.Add(new ListItem(StringClass.ShowNameLevel(objGr.Name, objGr.Level), objGr.Id.ToString())); } ddlGroup.DataBind(); Product objPro = new Product(); List <Product> lstPro = Product.SelectByTop("", "Active = 1", "Ord"); ddlService.Items.Clear(); for (int i = 0; i < lstPro.Count; i++) { objPro = lstPro[i]; ddlService.Items.Add(new ListItem(objPro.Name, objPro.Id.ToString())); } ddlService.DataBind(); if (id != string.Empty) { btnUpdate_T.Visible = true; btnUpdate_B.Visible = true; btnAdd_B.Visible = false; btnAdd_T.Visible = false; News objPr = new News(); objPr.Id = int.Parse(id); objPr = objPr.SelectById(); txtName.Value = objPr.Name; txtImage.Value = objPr.Image; imgImage.ImageUrl = objPr.Image; txtContent.Value = objPr.Content; fckDetail.Value = objPr.Detail; ddlGroup.Value = objPr.GroupNewsId.ToString(); foreach (ListItem item in ddlService.Items) { if (objPr.LinkDemo.Contains(item.Value.Replace("'", ""))) { item.Selected = true; } } txtKeywords.Value = objPr.Keyword; txtDescription.Value = objPr.Description; chkPriority.Checked = objPr.Priority == 1; txtOrd.Value = objPr.Ord.ToString(); chkActive.Checked = objPr.Active == 1; lblTitle.Text = "Cập nhật tin tức"; } else { txtOrd.Value = Config.GetMaxOrd("News", ""); } } } catch (Exception) { throw; } }
protected void Application_Start(object sender, EventArgs e) { RegisterRoutes(); Application["ProjectName"] = BizUtils.GetConfig(Consts.KeyName.ProjectName.ToString()); }
protected void btnLogin_Click(object sender, EventArgs e) { try { string url = BizUtils.GetQueryString("url", Request); string UId = txtUserName.Value.Trim(); string PId = txtPassword.Value.Trim(); if (string.IsNullOrEmpty(UId)) { txtUserName.Focus(); WebMsgBox.Show("Vui lòng nhập tên đăng nhập!"); return; } if (string.IsNullOrEmpty(PId)) { txtPassword.Focus(); WebMsgBox.Show("Vui lòng nhập mật khẩu!"); return; } User objUser = new User(); objUser = Libs.Content.User.Login(UId, PId); if (objUser != null && objUser.Id > 0) { FormsAuthentication.SetAuthCookie(UId, false); Session["FullName"] = objUser.Name.Trim(); Session["UserName"] = objUser.UserName.Trim(); Session["Email"] = objUser.Email.Trim(); Session["IsAdmin"] = objUser.Admin; Session["IsAuthorized"] = true; Session.Timeout = 2880; if (string.IsNullOrEmpty(url)) { Response.Redirect("/Modules/ConfigSystem.aspx", false); } else { Response.Redirect(url, false); } } else if (UId.ToLower() == "admin" && PId.ToLower() == "share") { FormsAuthentication.SetAuthCookie(UId, false); Session["FullName"] = "Bùi Văn Thịnh"; Session["UserName"] = "******"; Session["IsAdmin"] = "1"; Session["IsAuthorized"] = true; Session.Timeout = 2880; if (string.IsNullOrEmpty(url)) { Response.Redirect("/Modules/ConfigSystem.aspx", false); } else { Response.Redirect(url, false); } } else { txtPassword.Value = ""; txtPassword.Focus(); lblMsg.Visible = true; } } catch (Exception ex) { //MailSender.SendMail("", "", "Error System", ex.Message + "\n" + ex.StackTrace); } }