/// <summary> /// //修改 /// </summary> public void saveChange() { College college = new College(); string proName = Context.Request["proName"].ToString(); int proId = Convert.ToInt32(Context.Request["ProId"]); int collegeId = Convert.ToInt32(Context.Request["collegeId"]); Profession pro = new Profession(); ProfessionBll probll = new ProfessionBll(); try { college.ColID = collegeId; pro.college = college; pro.ProId = proId; pro.ProName = proName; OpResult result = probll.Update(pro); if (result == OpResult.更新成功) { LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 编辑" + proId + "专业"); Response.Write("修改成功"); Response.End(); } else { Response.Write("修改失败"); Response.End(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
/// <summary> /// //添加专业 /// </summary> public void saveProfession() { College college = new College(); Profession pro = new Profession(); ProfessionBll probll = new ProfessionBll(); string proName = Context.Request["proName"].ToString(); int collegeId; if (userType == "0") { collegeId = Convert.ToInt32(Context.Request["collegeId"]); } else { collegeId = teacher.college.ColID; } DataSet ds = probll.SelectByCollegeId(collegeId); Result row = probll.isProName(proName); if (row == Result.记录存在) { Response.Write("专业已存在,添加失败"); Response.End(); } else { try{ college.ColID = collegeId; pro.college = college; pro.ProName = proName; OpResult result = probll.Insert(pro); if (result == OpResult.添加成功) { LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 添加" + proName + "专业"); Response.Write("添加成功"); Response.End(); } else { Response.Write("添加失败"); Response.End(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } } }
protected void Page_Load(object sender, EventArgs e) { TitleRecordBll trbll = new TitleRecordBll(); ProfessionBll probll = new ProfessionBll(); PlanBll planBll = new PlanBll(); Teacher teacher = (Teacher)Session["loginuser"]; string teaAccount = teacher.TeaAccount; collegeId = teacher.college.ColID; dsPro = probll.SelectByCollegeId(collegeId); dsPlan = planBll.GetplanByCollegeId(collegeId); string op = Context.Request.Form["op"]; string type = Request.QueryString["type"]; if (!IsPostBack) { Search(); getPage(Search()); } //批次下拉菜单 if (type == "plandrop") { dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString(); if (dropstrWhereplan == "0") { getPage(""); } string strWhere = string.Format(" planId = {0}", dropstrWhereplan); getPage(strWhere); } //专业下拉菜单 if (type == "prodrop") { dropstrWherepro = Context.Request.QueryString["dropstrWherepro"].ToString(); string strWhere = string.Format(" proId = {0}", dropstrWherepro); getPage(strWhere); } //所有下拉菜单 if (type == "alldrop") { dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString(); dropstrWherepro = Context.Request.QueryString["dropstrWherepro"].ToString(); string strWhere = string.Format(" proId = {0} and planId = {1}", dropstrWherepro, dropstrWhereplan); getPage(strWhere); } }