public RemarkController() { rb = new RemarkBll(); pb = new ProjectBll(); sb = new StudentBll(); cb = new ClassBll(); }
//save protected void Button1_Click(object sender, EventArgs e) { bool b = false; foreach (RepeaterItem Item in Repeater1.Items) { TextBox txtSeoTitle = (TextBox)Item.FindControl("txtSeoTitle"); TextBox txtKeyWord = (TextBox)Item.FindControl("txtKeyWord"); TextBox txtSeoDescription = (TextBox)Item.FindControl("txtSeoDescription"); HiddenField txtid = (HiddenField)Item.FindControl("HiddenField1"); ClassModel cm = new ClassModel(); cm.SeoTitle = txtSeoTitle.Text; cm.SeoKeyWord = txtKeyWord.Text; cm.SeoDescription = txtSeoDescription.Text; cm.id = int.Parse(txtid.Value); b = new ClassBll().Updateseo(cm); } if (b) { BasePage.JscriptPrint(Page, "批量保存成功!", "SeoAll.aspx?action=" + Request.QueryString["action"]); } }
//GetClassName protected string GetClassName(string PicUrl, string tid) { string ClassName = ""; //根据是否上传了图片显示不同的图标 if (!String.IsNullOrEmpty(PicUrl)) { ClassName = "<span class=\"listpic\">"; } else { ClassName = "<span class=\"listonpic\">"; } //根据新闻ID取得栏目名称 bool b = new CommonBll().Exists("GL_Class", int.Parse(tid)); if (b) { ClassModel cm = new ClassBll().GetModel(int.Parse(tid)); ClassName += "[<a href=\"Products.aspx?mid=" + mid + "&cid=" + tid + "\">" + cm.ClassName + "</a>]</span> "; } return(ClassName); }
public StudentController() { sb = new StudentBll(); tub = new TeacherUserBll(); cb = new ClassBll(); }
protected void Page_Load(object sender, EventArgs e) { mid = BasePage.GetRequestId(Request.QueryString["mid"]); if (mid == 0) { mid = 2; } //根据模型找出数据表名 ModelModel mo = new ModelBll().GetModel(mid); datatable = mo.ModelTable; ItemName = mo.ItemName; if (!Page.IsPostBack) { string checklogin = new AdminBll().CheckLogin("m" + mid); if (checklogin != "true") { BasePage.Alertback(checklogin); Response.End(); } ac = Request.QueryString["ac"]; verific = BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "ms" + mid); del = BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "md" + mid); cid = BasePage.GetRequestId(Request.QueryString["cid"]); string company = Request.QueryString["company"];//按公司搜索 int companyId = BasePage.GetRequestId(Request.QueryString["companyid"]); txtCompany.Text = company; if (!String.IsNullOrEmpty(mo.ModeContent)) { //0模型内容可选字段`1模型栏目可选字段`2(以后添加)`3(以后添加)`4提示语`5发表审核选择 string[] a = mo.ModeContent.Split('`'); //下拉属性 if (BasePage.ArrayExist(a[0], "4")) { //推荐属性 sxddl = true; ddlshuxi.Items.Insert(0, new ListItem("推荐", "1")); } if (BasePage.ArrayExist(a[0], "11")) { //热卖属性 sxddl = true; //ddlshuxi.Items.Insert(0, new ListItem("热门", "2")); ddlshuxi.Items.Insert(0, new ListItem("热门", "2")); } if (BasePage.ArrayExist(a[0], "26")) { //最新属性 sxddl = true; ddlshuxi.Items.Insert(0, new ListItem("最新", "3")); } if (BasePage.ArrayExist(a[0], "27")) { //最新属性 sxddl = true; ddlshuxi.Items.Insert(0, new ListItem("特价", "4")); } if (sxddl) { ddlshuxi.Items.Insert(0, new ListItem("按属性查看", "")); } showhidelistvalue = a[3]; //0录入3添加时间4修改时间5属于6点击7优先 if (a[5] == "0") //模型不需要审核,隐藏审核链接 { verific = true; } } if (!String.IsNullOrEmpty(Request.QueryString["language"])) { Language = BasePage.GetRequestId(Request.QueryString["language"]).ToString(); lansql = " and Languagen=" + BasePage.GetRequestId(Language); } string strwhere = "id is not null"; int sx = BasePage.GetRequestId(Request.QueryString["sx"]);//属性 ddlshuxi.SelectedValue = sx.ToString(); DrLanguage.SelectedValue = Language.ToString(); string keywords = Request.QueryString["keywords"]; if (String.IsNullOrEmpty(ac)) { strwhere += " and IsDel=0 and Verific=0"; } else if (ac == "del") { //回收站 strwhere += " and IsDel=1"; // actxt.InnerHtml = ItemName + "回收站列表"; } else if (ac == "sh") { strwhere += " and Verific=1"; //actxt.InnerHtml = ItemName + "审核列表"; } if (cid != 0) { strwhere += " and (Tid=" + cid; //读取所有子级 if (showhidelist("8")) { DataTable dt = new ClassBll().GetListTree(mid, cid, ""); string allid = ""; if (dt.Rows.Count > 0) { foreach (DataRow drt in dt.Rows) { allid += drt["id"].ToString() + ","; } allid = allid.Substring(0, allid.Length - 1); strwhere += " or Tid in (" + allid + ")"; } } strwhere += ")"; } else { strwhere += lansql; } if (sx != 0) { string sht = ""; switch (sx) { case 1: sht = "IsRecommend=1"; break; case 2: sht = "IsPopular=1"; break; case 3: sht = "IsNew=1"; break; case 4: sht = "IsSpecial='1'"; break; } strwhere += " and " + sht + ""; } //按公司查看 if (companyId != 0) { strwhere += " and ShopId=" + companyId; } if (!String.IsNullOrEmpty(keywords)) { strwhere += " and Title like '%" + keywords + "%'"; } ////列出所有栏目 //string allclass = "ParentId=" + cid + " and ModelId=" + mid + lansql; //Repeater2.DataSource = new CommonBll().GetList("", "GL_Class", allclass, "px desc,id desc"); //Repeater2.DataBind(); // Response.Write(strwhere); //Response.End(); //绑定栏目下拉 ClassTreeBind(0, "所有栏目", mid, this.ddlclassname, "ClassType=0" + lansql); ClassTreeBind(0, "请选择栏目", mid, this.changclass, "ClassType=0" + lansql); if (!string.IsNullOrEmpty(Request.Params["Cid"])) { ddlclassname.SelectedValue = Request.Params["Cid"].Trim(); } //批量处理的ID articleid.Text = Request.QueryString["allid"]; int PageSize = 20; int PageIndex = BasePage.GetRequestId(Request.QueryString["Page"]); //当前第几页 Repeater1.DataSource = new CommonBll().GetListPage("", datatable, strwhere, "px desc,EditDate desc", PageSize, PageIndex); Repeater1.DataBind(); int totalrecord = new CommonBll().GetRecordCount(datatable, strwhere);//总记录数 if (totalrecord == 0) { txtpage.Text = "<p align=\"left\" class=\"red\">暂无产品</p>"; } else if (totalrecord > PageSize) { txtpage.Text = GL.Utility.GetPage.GetAspxPager(totalrecord, PageSize, PageIndex); } string bx = "<a href=\"Products.aspx?mid=" + mid + "\" class=\"home\">" + ItemName + "管理</a>"; bx += "<a href=\"ProductsAdd.aspx?mid=" + mid + "&language=" + Language + "\" class=\"add\">添加" + ItemName + "</a>"; if (!verific) { bx += "<a href=\"?mid=" + mid + "&language=" + Language + "&ac=sh\" class=\"sh\">审核" + ItemName + "</a>"; } if (del) { bx += "<a href=\"?ac=del&mid=" + mid + "&language=" + Language + "\" class=\"del\">" + ItemName + "回收站</a>"; } ((Literal)Master.FindControl("breadcrumbs")).Text = bx; } }
public ClassController() { cb = new ClassBll(); }
public TeacherController() { rb = new ReviewBll(); tb = new TeacherBll(); cb = new ClassBll(); }
//add or edit protected void Button1_Click(object sender, EventArgs e) { //根据ID取得父级相关信息 int tid_ClassLayer = 0; if (tid != 0) { tid_ClassLayer = BasePage.GetRequestId(new CommonBll().GetTitle(datatable, "ClassLayer", tid)); } ClassModel cm = new ClassModel(); cm.ModelId = mid; cm.ParentId = tid; cm.ClassLayer = tid_ClassLayer + 1; if (!String.IsNullOrEmpty(txtseotitle.Text)) { cm.SeoTitle = txtseotitle.Text; } else { cm.SeoTitle = txtClassName.Text; } cm.SeoKeyWord = txtKeyWord.Text; cm.SeoDescription = txtDescription.Text; cm.ClassIntro = txtClassIntro.Text; cm.Languagen = int.Parse(DropDownList1.SelectedValue); cm.Hide = int.Parse(txtHide.SelectedValue); cm.InputA = int.Parse(rinputa.SelectedValue); cm.AllowComment = int.Parse(rallowcomment.SelectedValue); cm.ClassPic = txtClassPic.Text; cm.InputUser = int.Parse(rinputuser.SelectedValue); cm.Contents = txtcon1.Text.Replace("~", "") + "~" + txtcon2.Text.Replace("~", "") + "~" + txtcon3.Text.Replace("~", ""); cm.AddDate = DateTime.Now; cm.id = id; cm.ClassName = txtClassName.Text; cm.Px = BasePage.GetRequestId(txtPx.Text); if (id == 0) { if (GetPower("ca")) { string[] classname = txtClassName.Text.Split(','); string[] px = txtPx.Text.Split(','); if (classname.Length > 1) { int ii = 0; //批量添加 for (int i = 0; i < classname.Length; i++) { cm.ClassName = classname[i]; cm.SeoTitle = classname[i]; if (classname.Length == px.Length) { cm.Px = BasePage.GetRequestId(px[i]); } else { cm.Px = BasePage.GetRequestId(txtPx.Text); } ii = new ClassBll().Add(cm); } if (ii > 0) { BasePage.JscriptPrint(Page, "栏目批量添加成功!", "Class.aspx?mid=" + mid + "&language=" + Language + ""); } } else { int i = new ClassBll().Add(cm); if (i > 0) { BasePage.JscriptPrint(Page, "栏目添加成功!", "Class.aspx?mid=" + mid + "&language=" + Language + ""); } } } else { BasePage.Alertback("您没有添加栏目的权限"); } } else { bool b = new ClassBll().Update(cm); if (b) { BasePage.JscriptPrint(Page, "栏目修改成功!", "Class.aspx?mid=" + mid + "&language=" + Language + ""); } } }
protected string modelclass = "";//可选字段显示 protected void Page_Load(object sender, EventArgs e) { id = BasePage.GetRequestId(Request.QueryString["id"]); tid = BasePage.GetRequestId(Request.QueryString["tid"]); mid = BasePage.GetRequestId(Request.QueryString["mid"]); string lansql = ""; if (!String.IsNullOrEmpty(Request.QueryString["language"])) { Language = BasePage.GetRequestId(Request.QueryString["language"]).ToString(); lansql = "Languagen=" + BasePage.GetRequestId(Language); } if (mid == 0) { mid = 1; } ac = Request.QueryString["ac"]; if (!Page.IsPostBack) { string bx = "<a href=\"class.aspx?mid=" + mid + "&language=" + Language + "\" class=\"home\">栏目管理</a>"; if (GetPower("ca")) { bx += "<a href=\"?ac=add&mid=" + mid + "&language=" + Language + "\" class=\"add\">添加新栏目</a>"; } ((Literal)Master.FindControl("breadcrumbs")).Text = bx; string checklogin = new AdminBll().CheckLogin("ce" + mid);//栏目管理编辑是前提,有编辑权限才可能进来查看,添加和删除 if (checklogin != "true") { BasePage.Alertback(checklogin); Response.End(); } if (String.IsNullOrEmpty(ac)) { DrLanguage.SelectedValue = Language.ToString(); DataTable ds = new DataTable(); ds = new ClassBll().GetListTree(mid, 0, lansql); Repeater1.DataSource = ds; Repeater1.DataBind(); } else if (ac == "add") { //显示可选栏目字段 ModelModel m = new ModelBll().GetModel(mid); modelclass = m.ModeContent; if (tid == 0) { txtTid.Text = "顶级分类"; DropDownList1.SelectedValue = Language; } else { ClassModel tcm = new ClassBll().GetModel(tid); txtTid.Text = tcm.ClassName; DropDownList1.SelectedValue = tcm.Languagen.ToString(); DropDownList1.Enabled = false; txtClassPic.Text = tcm.ClassPic; } if (id != 0) { Button1.Text = "确认修改"; ClassModel cm = new ClassBll().GetModel(id); DropDownList1.SelectedValue = cm.Languagen.ToString(); DropDownList1.Enabled = false; if (cm.ParentId == 0) { //顶级 txtTid.Text = "顶级分类"; } else { txtTid.Text = new CommonBll().GetTitle(datatable, "ClassName", int.Parse(cm.ParentId.ToString ())); } txtClassName.Text = cm.ClassName; txtPx.Text = cm.Px.ToString(); txtHide.SelectedValue = cm.Hide.ToString(); rinputa.SelectedValue = cm.InputA.ToString(); rinputuser.SelectedValue = cm.InputUser.ToString(); rallowcomment.SelectedValue = cm.AllowComment.ToString(); txtClassPic.Text = cm.ClassPic; txtClassIntro.Text = cm.ClassIntro; txtseotitle.Text = cm.SeoTitle; txtKeyWord.Text = cm.SeoKeyWord; txtDescription.Text = cm.SeoDescription; string[] con = cm.Contents.Split('~'); txtcon1.Text = con[0]; txtcon2.Text = con[1]; txtcon3.Text = con[2]; } } } }
private string showhidelistvalue = ""; //列表可选字段值 protected void Page_Load(object sender, EventArgs e) { mid = BasePage.GetRequestId(Request.QueryString["mid"]); tid = BasePage.GetRequestId(Request.QueryString["tid"]); if (mid == 0) { mid = 1; } if (!String.IsNullOrEmpty(Request.QueryString["language"])) { Language = BasePage.GetRequestId(Request.QueryString["language"]).ToString(); lansql = " and Languagen=" + BasePage.GetRequestId(Language); } ac = Request.QueryString["ac"]; ModelModel mo = new ModelBll().GetModel(mid); datatable = mo.ModelTable; ItemName = mo.ItemName; if (!Page.IsPostBack) { string checklogin = new AdminBll().CheckLogin("m" + mid); if (checklogin != "true") { BasePage.Alertback(checklogin); Response.End(); } verific = BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "ms" + mid);//不需要审核的管理员,显示审核,审核其它需要审核的文章 del = BasePage.ArrayExist(Cookies.GetCookie("ModelPower"), "md" + mid); if (!String.IsNullOrEmpty(mo.ModeContent)) { //0模型内容可选字段`1模型栏目可选字段`2内容字段名称`3模型列表可选字段`4提示语`5发表审核选择 string[] a = mo.ModeContent.Split('`'); //下拉属性 if (BasePage.ArrayExist(a[0], "9")) { //推荐属性 sxddl = true; ddlshuxi.Items.Insert(0, new ListItem("推荐", "1")); } if (BasePage.ArrayExist(a[0], "11")) { //热门属性 sxddl = true; ddlshuxi.Items.Insert(0, new ListItem("热门", "2")); } if (BasePage.ArrayExist(a[0], "12")) { //最新属性 sxddl = true; ddlshuxi.Items.Insert(0, new ListItem("最新", "3")); } if (sxddl) { ddlshuxi.Items.Insert(0, new ListItem("按属性查看", "")); } showhidelistvalue = a[3]; if (!BasePage.ArrayExist(a[0], "19")) { //按栏目查看 ddlclassname.Visible = false; } if (a[5] == "0")//模型不需要审核,隐藏审核链接 { verific = true; } } DrLanguage.SelectedValue = Language; int sh = BasePage.GetRequestId(Request.QueryString["sh"]);; //审核 int sx = BasePage.GetRequestId(Request.QueryString["sx"]); //属性 ddlshuxi.SelectedValue = sx.ToString(); string keywords = Request.QueryString["keywords"]; string strwhere = "id is not null "; if (String.IsNullOrEmpty(ac)) { strwhere += " and IsDel=0 and Verific=0"; } else if (ac == "del") //回收站 { strwhere += " and IsDel=1"; //actxt.InnerHtml = ItemName + "回收站列表"; } else if (ac == "sh")//审核 { strwhere += " and Verific=1"; //actxt.InnerHtml = ItemName + "审核列表"; } if (tid != 0) { strwhere += " and (Tid=" + tid + ""; //读取所有子级 if (showhidelist("8")) { DataTable dt = new ClassBll().GetListTree(mid, tid, ""); string allid = ""; if (dt.Rows.Count > 0) { foreach (DataRow drt in dt.Rows) { allid += drt["id"].ToString() + ","; } allid = allid.Substring(0, allid.Length - 1); strwhere += " or Tid in (" + allid + ")"; } } strwhere += ")"; } else { strwhere += lansql;//按栏目查看了就不需要语言了 } if (sx != 0) { string sht = ""; switch (sx) { case 1: sht = "IsRecommend=1"; break; case 2: sht = "IsPopular=1"; break; case 3: sht = "IsNew=1"; break; } strwhere += " and " + sht + ""; } if (!String.IsNullOrEmpty(keywords)) { strwhere += " and Title like '%" + keywords + "%'"; } //列出所有栏目 //string allclass = "ParentId=" + tid + " and ModelId=" + mid + lansql; //Repeater2.DataSource = new CommonBll().GetList("", "GL_Class", allclass, "Languagen asc,px desc,id desc"); //Repeater2.DataBind(); //批量处理时列出栏目 ClassTreeBind(0, "请选择栏目", mid, this.ddlclassforall, "ClassType=0" + lansql); //按栏目查看下拉 ClassTreeBind(0, "所有栏目", mid, this.ddlclassname, "ClassType=0" + lansql); ddlclassname.SelectedValue = tid.ToString(); int pagesize = 25; int pageindex = BasePage.GetRequestId(Request.QueryString["page"]); int all = new CommonBll().GetRecordCount(datatable, strwhere); Repeater1.DataSource = new CommonBll().GetListPage("", datatable, strwhere, "px desc,id desc", pagesize, pageindex); Repeater1.DataBind(); if (all > pagesize) { txtpage.Text = GetPage.GetAspxPager(all, pagesize, pageindex); } if (all == 0) { txtpage.Text = "<p align=\"left\" class=red>暂无相关内容</p>"; } //txtpage.Text = strwhere; string bx = "<a href=\"Article.aspx?mid=" + mid + "\" class=\"home\">" + ItemName + "管理</ a > "; bx += "<a href=\"ArticleAdd.aspx?mid=" + mid + "&language=" + Language + "\" class=\"add\">添加" + ItemName + "</a>"; if (del) { bx += "<a href=\"Article.aspx?ac=del&mid=" + mid + "&language=" + Language + "\" class=\"del\">" + ItemName + "回收站</a>"; } if (!verific) { bx += "<a href=\"Article.aspx?mid=" + mid + "&language=" + Language + "&ac=sh\" class=\"sh\">审核" + ItemName + "</a>"; } ((Literal)Master.FindControl("breadcrumbs")).Text = bx; } }