protected void Page_Load(object sender, EventArgs e) { B_ARoleAuth.CheckEx(ZLEnum.Auth.content, "ContentMange"); if (!IsPostBack) { int id = DataConverter.CLng(Request.QueryString["id"]); M_Course mcourse = bcourse.GetSelect(id); if (mcourse != null && mcourse.id > 0) { liCoures.Text = "修改课程"; txt_Courename.Text = mcourse.CourseName; PYtitle.Text = mcourse.CoureseThrun; txt_Code.Text = mcourse.CoureseCode; hfid.Value = mcourse.CoureseClass.ToString(); txtClassname.Text = GetClassname(mcourse.CoureseClass); txt_Creidt.Text = mcourse.CoureseCredit.ToString(); rblHot.Checked = mcourse.Hot == 1 ? true : false; txtRemark.Text = mcourse.CoureseRemark; coureId.Value = mcourse.id.ToString(); Button2.Enabled = true; Button2.OnClientClick = "location.href='AddCourseware.aspx?CourseID=" + id + "'; return false;"; } else { liCoures.Text = "添加课程"; Button2.Enabled = false; } Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li> <li><a href='Papers_System_Manage.aspx'>教育模块</a></li><li><a href='QuestionManage.aspx'>考试管理</a></li><li><a href='CoureseManage.aspx'>课程管理</a></li><li>" + liCoures.Text + "</li>"); txtClassname.Enabled = false; } }
public ActionResult AddCourse() { M_Course courMod = courBll.GetSelect(Mid); C_TreeTlpDP treeMod = GetTreeMod(); if (courMod.CoureseClass > 0) { treeMod.seled = courMod.CoureseClass.ToString(); } ViewBag.treeMod = treeMod; return(View(courMod)); }
private string GetCourese(int courseid) { M_Course mcourse = bcourse.GetSelect(courseid); if (mcourse != null && mcourse.id > 0) { return(mcourse.CourseName); } else { return(""); } }
private static M_Course GetInfoFromReader(SqlDataReader rdr) { M_Course info = new M_Course(); info.id = DataConverter.CLng(rdr["id"].ToString()); info.CourseName = rdr["CourseName"].ToString(); info.CoureseThrun = rdr["CoureseThrun"].ToString(); info.CoureseCode = rdr["CoureseCode"].ToString(); info.CoureseCredit = DataConverter.CDouble(rdr["CoureseCredit"].ToString()); info.CoureseRemark = rdr["CoureseRemark"].ToString(); info.Hot = DataConverter.CLng(rdr["Hot"].ToString()); info.CoureseClass = DataConverter.CLng(rdr["CoureseClass"].ToString()); info.AddTime = DataConverter.CDate(rdr["AddTime"].ToString()); info.AddUser = DataConverter.CLng(rdr["AddUser"].ToString()); rdr.Close(); rdr.Dispose(); return(info); }
protected void EBtnSubmit_Click(object sender, EventArgs e) { int id = DataConverter.CLng(coureId.Value); M_Course mcourse = bcourse.GetSelect(id); mcourse.AddUser = B_Admin.GetLogin().AdminId; mcourse.CoureseClass = DataConverter.CLng(hfid.Value); mcourse.CoureseCode = txt_Code.Text; mcourse.CoureseCredit = DataConverter.CDouble(txt_Creidt.Text); mcourse.CoureseRemark = txtRemark.Text; mcourse.CoureseThrun = PYtitle.Text; mcourse.CourseName = txt_Courename.Text; mcourse.Hot = rblHot.Checked ? 1 : 0; if (mcourse != null && mcourse.id > 0) { bool result = bcourse.GetUpdate(mcourse); if (result) { function.WriteSuccessMsg("修改成功!"); } else { function.WriteErrMsg("修改失败!"); } } else { mcourse.AddTime = DateTime.Now; int ids = bcourse.GetInsert(mcourse); if (ids > 0) { Button2.Enabled = true; Button2.OnClientClick = "location.href='AddCourseware.aspx?CourseID=" + ids + "'; return false;"; function.WriteSuccessMsg("添加成功!"); } else { function.WriteErrMsg("添加失败!"); } } }
public void Course_Add() { M_Course courMod = courBll.GetSelect(Mid); courMod.CoureseClass = DataConverter.CLng(Request.Form["TreeTlp_hid"]); courMod.CoureseCode = Request.Form["CoureseCode"]; courMod.CoureseCredit = DataConverter.CDouble(Request.Form["CoureseCredit"]); courMod.CoureseRemark = Request.Form["CoureseRemark"]; courMod.CoureseThrun = Request.Form["CoureseThrun"]; courMod.CourseName = Request.Form["CourseName"]; courMod.Hot = string.IsNullOrEmpty(Request.Form["Hot"]) ? 0 : 1; if (courMod.id > 0) { courBll.GetUpdate(courMod); function.WriteSuccessMsg("修改成功", "CourseManage"); return; } else { courMod.AddUser = badmin.GetAdminLogin().AdminId; courMod.AddTime = DateTime.Now; courBll.GetInsert(courMod); function.WriteSuccessMsg("添加成功", "CourseManage"); return; } }
public IActionResult Course_Add() { M_Course courMod = courBll.GetSelect(Mid); courMod.CoureseClass = DataConverter.CLng(RequestEx["TreeTlp_hid"]); courMod.CoureseCode = RequestEx["CoureseCode"]; courMod.CoureseCredit = DataConverter.CDouble(RequestEx["CoureseCredit"]); courMod.CoureseRemark = RequestEx["CoureseRemark"]; courMod.CoureseThrun = RequestEx["CoureseThrun"]; courMod.CourseName = RequestEx["CourseName"]; courMod.Hot = string.IsNullOrEmpty(RequestEx["Hot"]) ? 0 : 1; if (courMod.id > 0) { courBll.GetUpdate(courMod); return(WriteOK("修改成功", "CourseManage")); } else { courMod.AddUser = adminMod.AdminId; courMod.AddTime = DateTime.Now; courBll.GetInsert(courMod); return(WriteOK("添加成功", "CourseManage")); } }
/// <summary> ///更新记录 /// </summary> /// <param name="Course"></param> /// <returns></returns> public bool GetUpdate(M_Course model) { return(DBCenter.UpdateByID(model, model.id)); }
/// <summary> ///添加记录 /// </summary> /// <param name="Course"></param> /// <returns></returns> public int GetInsert(M_Course model) { return(DBCenter.Insert(model)); }