protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin("|" + typeClss + "|"); if (!IsPostBack) { xClass.NewsTypeData(typeClss, DropDownListClass); classListName.Visible = true; classListName.Text = "如需排序,请选择带有子级分类的父分类并点击 显示所选分类排序 按钮!"; xClass.getTreeList(typeClss, treeList, string.Empty, "top", false, true, false); titleClass.Text = Server.UrlDecode(titleTemp); DataTable dt = db.getDataTable("select Tid from newsTree where treeNameTxt is null"); for (int i = 0; i < dt.Rows.Count; i++) { long cid = xc.SafeNum(dt.Rows[i]["Tid"].ToString().Trim()); xClass.treeNameUpdate(cid); xClass.updateIDs(typeClss, cid); } dt.Dispose(); FormCheck fCheck = new FormCheck(); classUrlRegExpre.ValidationExpression = fCheck.RegExpressionValidator("urlHttp", 0, 0, false); classUrlRegExpre.ErrorMessage = fCheck.RegExpressionValidator("urlHttp", 0, 0, true); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin("|" + typeClss + "|"); if (!IsPostBack) { XabaraClass xClass = new XabaraClass(); xClass.NewsTypeData(typeClss, DropDownListClass); if (!string.IsNullOrEmpty(Session[typeClss] as string)) { this.DropDownListClass.Items.FindByValue(Session[typeClss].ToString().Trim()).Selected = true; } else { this.DropDownListClass.Items.FindByText("== 新增根分类 ==").Selected = true; } xClass.getTreeList(typeClss, treeList, string.Empty, "top", false, true, false); FormCheck fCheck = new FormCheck(); classListRegExpre.ValidationExpression = fCheck.RegExpressionValidator("number", 0, 0, false); classListRegExpre.ErrorMessage = fCheck.RegExpressionValidator("number", 0, 0, true); classUrlRegExpre.ValidationExpression = fCheck.RegExpressionValidator("urlHttp", 0, 0, false); classUrlRegExpre.ErrorMessage = fCheck.RegExpressionValidator("urlHttp", 0, 0, true); titleClass.Text = Server.UrlDecode(xc.SafeSql(Request["title"])); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin("|adsAdd|"); if (!IsPostBack) { FormCheck fCheck = new FormCheck(); pdateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false); pdateRegExpree.ErrorMessage = fCheck.RegExpressionValidator("dateTime", 0, 0, true); eDateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false); eDateRegExpree.ErrorMessage = fCheck.RegExpressionValidator("dateTime", 0, 0, true); httpRegExpree.ValidationExpression = fCheck.RegExpressionValidator("urlHttp", 0, 0, false); httpRegExpree.ErrorMessage = fCheck.RegExpressionValidator("urlHttp", 0, 0, true); wRegExpree.ValidationExpression = fCheck.RegExpressionValidator("number", 0, 0, false); wRegExpree.ErrorMessage = "宽度" + fCheck.RegExpressionValidator("number", 0, 0, true); hRegExpree.ValidationExpression = fCheck.RegExpressionValidator("number", 0, 0, false); hRegExpree.ErrorMessage = "高度" + fCheck.RegExpressionValidator("number", 0, 0, true); DateTime nStr = DateTime.Now; pDate.Text = nStr.ToString("yyyy-MM-dd HH:mm:ss"); eDate.Text = nStr.AddYears(1).ToString("yyyy-MM-dd HH:mm:ss"); XabaraClass xClass = new XabaraClass(); xClass.NewsTypeData("ads", adClass); this.adImg.Items.Add(new ListItem("图片:" + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadImgType"), "Img")); this.adImg.Items.Add(new ListItem("Flash:" + XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadFlashType"), "Flash")); this.adImg.Items.Add(new ListItem("广告代码", "Code")); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin(string.Empty); if (!IsPostBack) { xClass.NewsTypeData("taobaoke", classID); object selectClass = Session["shopClass"]; if (!string.IsNullOrEmpty(selectClass as string)) { this.classID.Items.FindByValue(selectClass.ToString().Trim()).Selected = true; } } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin(string.Empty); long cidTemp = xc.SafeNum(Request["cid"]); string strSql = string.Empty; string ifStr = string.Empty; string keyWordStr = xc.SafeSql(Server.UrlDecode(Request["keyWords"])); if (!IsPostBack) { xClass.NewsTypeData("department", classList); if (cidTemp > 0) //分类读取 { string idNums = xClass.getClassAllID("department", cidTemp); if (!idNums.Equals(cidTemp.ToString())) { string[] ids = idNums.Split(new char[] { ',' }); for (int i = 0; i <= ids.GetUpperBound(0); i++) { ifStr += "classID=" + ids[i].ToString().Trim() + " or "; } ifStr = " and (" + ifStr.Substring(0, ifStr.Length - 3) + ")"; } else { ifStr += " and classID=" + cidTemp.ToString().Trim(); } this.classList.Items.FindByValue(cidTemp.ToString()).Selected = true; } if (!string.IsNullOrEmpty(keyWordStr as string)) { ifStr += " and (UserName like '%" + keyWordStr + "%' or UserId like '%" + keyWordStr + "%') "; keyWord.Text = keyWordStr; } strSql = "select * from AdminUser where classID>0 " + ifStr + " Order By LoginDate desc"; //Response.Write(strSql); lblCurrentPage.Text = new dbDataFunction().RepeaterDB(RepeaterList, strSql, "&keyWords=" + keyWordStr, 20, "page", "center", true); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin(string.Empty); xClass.NewsTypeData("ads", adWhere); string strSql = string.Empty; string ifStr = string.Empty; if (!IsPostBack) { Int64 aidTemp = xc.SafeNum(Request["aid"]); if (aidTemp > 0) { string idNums = xClass.getClassAllID("ads", Convert.ToInt32(aidTemp)); if (!idNums.Equals(aidTemp.ToString())) { string[] ids = idNums.Split(new char[] { ',' }); for (int i = 0; i <= ids.GetUpperBound(0); i++) { ifStr += "classID=" + ids[i].ToString().Trim() + " or "; } ifStr = " and (" + ifStr.Substring(0, ifStr.Length - 3) + ")"; } else { ifStr += " and classID=" + aidTemp.ToString().Trim(); } this.adWhere.Items.FindByValue(aidTemp.ToString()).Selected = true; } strSql = "select * from ads where 1=1 " + ifStr + " order by stopDate DESC,aID desc"; //Response.Write(strSql); lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, "&aid=" + aidTemp, 5, "page", "center", true); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin(string.Empty); XabaraClass xClass = new XabaraClass(); if (!IsPostBack) { string uidTemp = xc.adminID; Uid.Text = uidTemp; xClass.NewsTypeData("department", adminClass); string strSql = "select * from AdminUser where userID='" + uidTemp + "'"; DataTable dt = db.getDataTable(strSql); if (dt.Rows.Count > 0) { adminName.Text = dt.Rows[0]["UserName"].ToString().Trim(); int cID = Convert.ToInt32(dt.Rows[0]["classID"].ToString().Trim()); string cidName = xClass.getClass(cID, string.Empty, string.Empty); if (string.IsNullOrEmpty(cidName as string)) { if (cID > 0) { cidName = "原分类已被删除,请重新选择!"; this.adminClass.Items.Add(new ListItem("== 请选择 ==", "")); this.adminClass.Items.FindByValue(string.Empty).Selected = true; } else { this.adminClass.Items.Add(new ListItem("超级管理员", "0")); this.adminClass.Items.FindByValue(cID.ToString()).Selected = true; } } else { this.adminClass.Items.FindByValue(cID.ToString()).Selected = true; } classLab.Text = cidName; if (dt.Rows[0]["UserAdmin"].ToString().Trim().Equals("xabaraCOM") && !string.IsNullOrEmpty(xc.SafeSql(Request["uid"]) as string)) { adminClass.Visible = true; adminClassValidator.Visible = true; } oldPWHidden.Value = dt.Rows[0]["UserPW"].ToString().Trim(); adminMail.Text = dt.Rows[0]["userEmail"].ToString().Trim(); adminTel.Text = dt.Rows[0]["userTel"].ToString().Trim(); adminMobile.Text = dt.Rows[0]["userMobile"].ToString().Trim(); adminQQ.Text = dt.Rows[0]["userQQ"].ToString().Trim(); } else { xc.divError("", "您的操作有误!", 350, 150, "userList.aspx", "goto"); } dt.Dispose(); FormCheck fCheck = new FormCheck(); adminNameRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("chinese", 0, 0, false); adminNameRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("chinese", 0, 0, true); adminPWRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("passWord", 0, 0, false); adminPWRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("passWord", 0, 0, true); mailRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("email", 0, 0, false); mailRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("email", 0, 0, true); telRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("phone", 0, 0, false); telRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("phone", 0, 0, true); mobileRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("mobile", 0, 0, false); mobileRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("mobile", 0, 0, true); qqRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("qq", 0, 0, false); qqRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("qq", 0, 0, true); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin("|adsEdit|"); if (!IsPostBack) { FormCheck fCheck = new FormCheck(); pdateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false); pdateRegExpree.ErrorMessage = fCheck.RegExpressionValidator("dateTime", 0, 0, true); eDateRegExpree.ValidationExpression = fCheck.RegExpressionValidator("dateTime", 0, 0, false); eDateRegExpree.ErrorMessage = fCheck.RegExpressionValidator("dateTime", 0, 0, true); httpRegExpree.ValidationExpression = fCheck.RegExpressionValidator("urlHttp", 0, 0, false); httpRegExpree.ErrorMessage = fCheck.RegExpressionValidator("urlHttp", 0, 0, true); wRegExpree.ValidationExpression = fCheck.RegExpressionValidator("number", 0, 0, false); wRegExpree.ErrorMessage = "宽度" + fCheck.RegExpressionValidator("number", 0, 0, true); hRegExpree.ValidationExpression = fCheck.RegExpressionValidator("number", 0, 0, false); hRegExpree.ErrorMessage = "高度" + fCheck.RegExpressionValidator("number", 0, 0, true); XabaraClass xClass = new XabaraClass(); xClass.NewsTypeData("ads", adClass); string img = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadImgType"); this.adImg.Items.Add(new ListItem(img, "Img")); string flash = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "UploadFlashType"); this.adImg.Items.Add(new ListItem(flash, "Flash")); this.adImg.Items.Add(new ListItem("广告代码", "Code")); DataTable dt = db.getDataTable("select * from ads where aID=" + xc.SafeNum(Request["id"]).ToString()); if (dt.Rows.Count > 0) { this.adClass.Items.FindByValue(dt.Rows[0]["classID"].ToString().Trim()).Selected = true; string fileName = dt.Rows[0]["adImg"].ToString().Trim(); upImg.Value = fileName; if (!string.IsNullOrEmpty(fileName as string)) { string fileExe = fileName.Substring(fileName.Length - 3); if (img.IndexOf(fileExe) > -1) { this.adImg.Items.FindByValue("Img").Selected = true; } else { this.adImg.Items.FindByValue("Flash").Selected = true; } } else { this.adImg.Items.FindByValue("Code").Selected = true; } adW.Text = dt.Rows[0]["adW"].ToString().Trim(); adH.Text = dt.Rows[0]["adH"].ToString().Trim(); adHttp.Text = dt.Rows[0]["adHttp"].ToString().Trim(); adCode.Text = dt.Rows[0]["adCode"].ToString().Trim(); pDate.Text = Convert.ToDateTime(dt.Rows[0]["starDate"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss"); eDate.Text = Convert.ToDateTime(dt.Rows[0]["stopDate"].ToString().Trim()).ToString("yyyy-MM-dd HH:mm:ss"); adCodeImg.Text = dt.Rows[0]["adCode"].ToString().Trim(); } else { xc.divError("", "您的操作有误!", 350, 150, "default.aspx", "goto"); } dt.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { xc.CheckAdminLogin(string.Empty); if (!IsPostBack) { xClass.NewsTypeData("taobaoke", classID); string ifStr = string.Empty; string pageStr = string.Empty; string searchStr = Server.UrlDecode(Request["keyWord"]); string searchIf = string.Empty; string orderBy = " Order By id desc"; long sale = xc.SafeNum(Request.QueryString["sale"]); if (sale > 0) { orderBy = " Order By volume DESC"; pageStr += "&sale=1"; } if (!string.IsNullOrEmpty(searchStr as string)) { if (xc.SafeNum(searchStr) > 0) { searchIf = " and num_iid=" + searchStr; } else { searchIf = " and title like '%" + searchStr + "%'"; } searchWord.Text = searchStr; pageStr += "&keyWord=" + searchStr; } //显示推荐商品 long isGood = xc.SafeNum(Request.QueryString["isGood"]); if (isGood > 0 || this.goodCheck.Checked) { searchIf += " and isGood>0 "; pageStr += "&isGood=1"; orderBy = " Order By volume DESC"; this.goodCheck.Checked = true; } long ifGood = xc.SafeNum(Request.QueryString["ifGood"]); if (ifGood > 0) //建议推荐商品 { searchIf += " and isGood<1 and commission>10 and volume>1 and classID>0 "; pageStr += "&ifGood=1"; orderBy = " Order By volume DESC"; } if (ifGood < 0) //建议取消推荐商品或删除商品 { searchIf += " and volume<2 and isGood>0 "; pageStr += "&ifGood=-1"; orderBy = " Order By commission ASC"; } long isBad = xc.SafeNum(Request.QueryString["isBad"]); if (isBad > 0) //无效信息列表 { searchIf += " and isBad=0 "; pageStr += "&isBad=1"; } long cidTemp = xc.SafeNum(Request.QueryString["cid"]); if (cidTemp > 0) { this.classID.Items.FindByValue(cidTemp.ToString()).Selected = true; pageStr += "&cid=" + cidTemp.ToString(); } if (cidTemp > 0) { string cidStr = xClass.getClassAllID("taobaoke", cidTemp); //得到所有ID if (cidStr.IndexOf(",") > 0) { string[] ids = cidStr.Split(new char[] { ',' }); for (int i = 0; i <= ids.GetUpperBound(0); i++) { ifStr += " select * from taobaoke where classID=" + ids[i].ToString().Trim() + searchIf + " union "; } } else { ifStr = " select * from taobaoke where classID=" + cidTemp.ToString().Trim() + searchIf + " union "; } } else { ifStr = " select * from taobaoke where 1=1 " + searchIf + " union "; } ifStr = "(" + ifStr.Substring(0, ifStr.Length - 6) + ") as news"; string strSql = "select * from " + ifStr + orderBy; //Response.Write(strSql); //Response.End(); lblCurrentPage.Text = db.RepeaterDB(RepeaterList, strSql, pageStr, 30, "page", "center", true); if (this.RepeaterList.Items.Count < 1) { errInfo.Text = "目前暂没有任何信息!"; errDiv.Visible = true; } else { errDiv.Visible = false; } } }