/// <summary> /// 获取数据 /// </summary> /// <param name="strWhere">查询条件</param> public void getdata(String strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } TitleBll titbll = new TitleBll(); Teacher tea = (Teacher)Session["loginuser"]; string teaAccount = tea.TeaAccount; string account = "teaAccount = '" + teaAccount + "'"; string Account = "teaAccount = '" + teaAccount + "' and "; TableBuilder tabuilder = new TableBuilder(); tabuilder.StrTable = "V_Title"; tabuilder.StrWhere = (strWhere == null || strWhere == "" ? account : Account + strWhere); tabuilder.IntColType = 0; tabuilder.IntOrder = 1; tabuilder.IntPageNum = int.Parse(currentPage); tabuilder.IntPageSize = pagesize; tabuilder.StrColumn = "titleId"; tabuilder.StrColumnlist = "*"; getCurrentPage = int.Parse(currentPage); ds = titbll.SelectBypage(tabuilder, out count); //加载所有分院 colds = colbll.Select(); //加载登录教师所在分院的专业 TableBuilder tabuilderPro = new TableBuilder(); tabuilderPro.StrTable = "T_Profession"; tabuilderPro.StrWhere = "collegeId = '" + tea.college.ColID + "'"; tabuilderPro.IntColType = 0; tabuilderPro.IntOrder = 0; tabuilderPro.IntPageNum = 1; tabuilderPro.IntPageSize = 100; tabuilderPro.StrColumn = "proId"; tabuilderPro.StrColumnlist = "*"; prods = probll.SelectBypage(tabuilderPro, out count); //加载登录教师所在分院的批次 TableBuilder tabuilderPlan = new TableBuilder(); tabuilderPlan.StrTable = "T_Plan"; tabuilderPlan.StrWhere = "collegeId = '" + tea.college.ColID + "'"; tabuilderPlan.IntColType = 0; tabuilderPlan.IntOrder = 0; tabuilderPlan.IntPageNum = 1; tabuilderPlan.IntPageSize = 100; tabuilderPlan.StrColumn = "planId"; tabuilderPlan.StrColumnlist = "*"; plads = plabll.SelectBypage(tabuilderPlan, out count); }
protected void Page_Load(object sender, EventArgs e) { string op = Context.Request["op"]; article = Request.QueryString["article"]; //调用下拉菜单数据 TeacherBll teabll = new TeacherBll(); //TODO 获取当前登录的教师账号 Teacher tea = (Teacher)Session["loginuser"]; //加载登录教师所在分院的专业 TableBuilder tabuilderPro = new TableBuilder(); tabuilderPro.StrTable = "T_Profession"; tabuilderPro.StrWhere = "collegeId = '" + tea.college.ColID + "'"; tabuilderPro.IntColType = 0; tabuilderPro.IntOrder = 0; tabuilderPro.IntPageNum = 1; tabuilderPro.IntPageSize = 100; tabuilderPro.StrColumn = "proId"; tabuilderPro.StrColumnlist = "*"; prods = probll.SelectBypage(tabuilderPro, out count); //加载登录教师所在分院的批次 TableBuilder tabuilderPlan = new TableBuilder(); tabuilderPlan.StrTable = "T_Plan"; tabuilderPlan.StrWhere = "collegeId = '" + tea.college.ColID + "'"; tabuilderPlan.IntColType = 0; tabuilderPlan.IntOrder = 0; tabuilderPlan.IntPageNum = 1; tabuilderPlan.IntPageSize = 100; tabuilderPlan.StrColumn = "planId"; tabuilderPlan.StrColumnlist = "*"; plands = pbll.SelectBypage(tabuilderPlan, out count); if (article == "edit") { string titleId = Request.QueryString["titleId"]; Session["titleId"] = titleId; TitleBll titBll = new TitleBll(); titleEdit = titBll.GetTitle(Convert.ToInt32(titleId)); //string ti = title.Limit.ToString(); } else { TitleBll titlebll = new TitleBll(); Title title = new Title(); if (op == "new") { try { string paperTitle = Request["paperTitle"].ToString(); string profession = Request["profession"].ToString(); string plans = Request["plan"].ToString(); string numMax = Request["numMax"].ToString(); string paperContent = Request["paperContent"].ToString(); title.title = paperTitle; title.TitleContent = HttpUtility.UrlDecode(paperContent); title.CreateTime = DateTime.Now; //TODO 专业批次选定人数为固定值,需重新改动 title.Selected = 0; title.Limit = int.Parse(numMax); title.teacher = (Teacher)Session["loginuser"]; title.plan = new Plan { PlanId = Convert.ToInt32(plans) }; title.profession = new Profession { ProId = Convert.ToInt32(profession) }; Result result = titlebll.Insert(title); if (result == Result.添加成功) { LogHelper.Info(this.GetType(), tea.TeaAccount + " - " + tea.TeaName + " - 发布论文"); Response.Write("添加成功"); Response.End(); } else { Response.Write("添加失败"); Response.End(); } }catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } } else if (op == "edit") { try { string paperTitle = Request["paperTitle"].ToString(); string profession = Request["profession"].ToString(); string plans = Request["plan"].ToString(); string numMax = Request["numMax"].ToString(); string paperContent = Request["paperContent"].ToString(); title.TitleId = Convert.ToInt32(Session["titleId"].ToString()); title.title = paperTitle; title.TitleContent = HttpUtility.UrlDecode(paperContent); title.CreateTime = DateTime.Now; //TODO 专业批次选定人数为固定值,需重新改动 title.Selected = 0; title.Limit = int.Parse(numMax); title.teacher = tea; title.plan = new Plan { PlanId = 1 }; title.profession = new Profession { ProId = 1 }; Result result = titlebll.Update(title); if (result == Result.更新成功) { LogHelper.Info(this.GetType(), tea.TeaAccount + " - " + tea.TeaName + " - 修改" + Session["titleId"].ToString() + "论文"); Response.Write("更新成功"); Response.End(); } else { Response.Write("更新失败"); Response.End(); } }catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } } } }
/// <summary> /// 获取数据 /// </summary> /// <param name="strWhere">查询条件</param> public void getdata(String strWhere) { string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } TitleBll titbll = new TitleBll(); string account = "defenGroupId = " + defenGroupId; string Account = account + " and "; string type = Request.QueryString["type"]; //选择文本 if (type == "textSelect") { strWhere = Search(); } //批次下拉菜单 if (type == "plandrop") { dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString(); if (dropstrWhereplan == "0") { strWhere = ""; } strWhere = string.Format(" planId = {0}", dropstrWhereplan); } //专业下拉菜单 if (type == "prodrop") { dropstrWherepro = Request["dropstrWherepro"]; strWhere = string.Format(" proId = {0}", dropstrWherepro); } //学院下拉菜单 if (type == "colldrop") { dropstrWherecoll = Request["dropstrWherecoll"]; strWhere = string.Format(" collegeId = {0}", dropstrWherecoll); //加载超管所选分院的所有专业 TableBuilder tabuilderPro = new TableBuilder(); tabuilderPro.StrTable = "T_Profession"; tabuilderPro.StrWhere = "collegeId = '" + dropstrWherecoll + "'"; tabuilderPro.IntColType = 0; tabuilderPro.IntOrder = 0; tabuilderPro.IntPageNum = 1; tabuilderPro.IntPageSize = 100; tabuilderPro.StrColumn = "proId"; tabuilderPro.StrColumnlist = "*"; prods = probll.SelectBypage(tabuilderPro, out count); //加载超管所选分院的所有批次 TableBuilder tabuilderPlan = new TableBuilder(); tabuilderPlan.StrTable = "T_Plan"; tabuilderPlan.StrWhere = "collegeId = '" + dropstrWherecoll + "'"; tabuilderPlan.IntColType = 0; tabuilderPlan.IntOrder = 0; tabuilderPlan.IntPageNum = 1; tabuilderPlan.IntPageSize = 100; tabuilderPlan.StrColumn = "planId"; tabuilderPlan.StrColumnlist = "*"; plads = plabll.SelectBypage(tabuilderPlan, out count); } //所有下拉菜单 if (type == "alldrop") { dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString(); dropstrWherepro = Context.Request.QueryString["dropstrWherepro"].ToString(); strWhere = string.Format(" proId = {0} and planId = {1}", dropstrWherepro, dropstrWhereplan); } TableBuilder tabuilder = new TableBuilder(); tabuilder.StrTable = "V_DefenceRecord"; tabuilder.StrWhere = (strWhere == null || strWhere == "" ? account : Account + strWhere); tabuilder.IntColType = 0; tabuilder.IntOrder = 0; tabuilder.IntPageNum = int.Parse(currentPage); tabuilder.IntPageSize = pagesize; tabuilder.StrColumn = "defenRecordId"; tabuilder.StrColumnlist = "*"; getCurrentPage = int.Parse(currentPage); ds = titbll.SelectBypage(tabuilder, out count); //加载所有分院 if (state == 2 || state == 1) { //加载登录教师所在分院的专业 TableBuilder tabuilderPro = new TableBuilder(); tabuilderPro.StrTable = "T_Profession"; tabuilderPro.StrWhere = "collegeId = '" + tea.college.ColID + "'"; tabuilderPro.IntColType = 0; tabuilderPro.IntOrder = 0; tabuilderPro.IntPageNum = 1; tabuilderPro.IntPageSize = 100; tabuilderPro.StrColumn = "proId"; tabuilderPro.StrColumnlist = "*"; prods = probll.SelectBypage(tabuilderPro, out count); //加载登录教师所在分院的批次 TableBuilder tabuilderPlan = new TableBuilder(); tabuilderPlan.StrTable = "T_Plan"; tabuilderPlan.StrWhere = "collegeId = '" + tea.college.ColID + "'"; tabuilderPlan.IntColType = 0; tabuilderPlan.IntOrder = 0; tabuilderPlan.IntPageNum = 1; tabuilderPlan.IntPageSize = 100; tabuilderPlan.StrColumn = "planId"; tabuilderPlan.StrColumnlist = "*"; plads = plabll.SelectBypage(tabuilderPlan, out count); } else if (state == 0) { dropstrWherecoll = Request["dropstrWherecoll"]; dropstrWherepro = Request["dropstrWherepro"]; dropstrWhereplan = Request["dropstrWhereplan"]; //加载超管所选分院的所有专业 TableBuilder tabuilderPro = new TableBuilder(); tabuilderPro.StrTable = "T_Profession"; tabuilderPro.StrWhere = "collegeId = '" + dropstrWherecoll + "'"; tabuilderPro.IntColType = 0; tabuilderPro.IntOrder = 0; tabuilderPro.IntPageNum = 1; tabuilderPro.IntPageSize = 100; tabuilderPro.StrColumn = "proId"; tabuilderPro.StrColumnlist = "*"; prods = probll.SelectBypage(tabuilderPro, out count); //加载超管所选分院的所有批次 TableBuilder tabuilderPlan = new TableBuilder(); tabuilderPlan.StrTable = "T_Plan"; tabuilderPlan.StrWhere = "collegeId = '" + dropstrWherecoll + "'"; tabuilderPlan.IntColType = 0; tabuilderPlan.IntOrder = 0; tabuilderPlan.IntPageNum = 1; tabuilderPlan.IntPageSize = 100; tabuilderPlan.StrColumn = "planId"; tabuilderPlan.StrColumnlist = "*"; plads = plabll.SelectBypage(tabuilderPlan, out count); } }
public void getpage(string strWhere, int pageNum) { TableBuilder tBuilder = new TableBuilder("V_Plan", "planId", 0, 0, "*", 1, pageNum, strWhere); plands = planBll.SelectBypage(tBuilder, out intPageCount); }