//申请加入班级 public void Class_Apply() { M_Group groupMod = groupBll.GetByID(mu.GroupID); int roomid = Convert.ToInt32(Request["roomid_hid"]); DataTable dt = ClassBll.SelByUid(mu.UserID, -1, roomid); if (dt.Rows.Count > 0) { function.WriteErrMsg("你已经申请过班级了!"); return; } M_Student stuMod = new M_Student(); stuMod.Addtime = DateTime.Now; stuMod.UserID = mu.UserID; stuMod.UserName = mu.UserName; stuMod.StudentType = 1; if (groupMod.Enroll.Contains("isteach")) { stuMod.StudentType = 2; } if (groupMod.Enroll.Contains("isfamily")) { stuMod.StudentType = 3; } stuMod.AuditingContext = Request["remind_t"]; stuMod.RoomID = roomid; stuBll.insert(stuMod); function.WriteSuccessMsg("申请班级成功!", "/User/Exam/ClassManage"); return; }
/// <summary> ///不存在则添加否则更新 /// </summary> /// <param name="Student"></param> /// <returns></returns> public bool InsertUpdate(M_Student model) { if (model.Noteid > 0) { GetUpdate(model); } else { GetInsert(model); } return(true); }
//添加班级时,创建者也是教师成员 private void InsertTearcher(M_UserInfo mu, int roomid) { M_Student stuMod = new M_Student(); stuMod.Addtime = DateTime.Now; stuMod.UserID = mu.UserID; stuMod.UserName = mu.UserName; stuMod.StudentType = 2; stuMod.Auditing = -1; stuMod.AuditingContext = "班主任"; stuMod.RoomID = roomid; stuBll.insert(stuMod); }
/// <summary> ///更新记录 /// </summary> /// <param name="Student"></param> /// <returns></returns> public bool GetUpdate(M_Student model) { return(DBCenter.UpdateByID(model, model.Noteid)); }
/// <summary> ///添加记录 /// </summary> /// <param name="Student"></param> /// <returns></returns> public bool GetInsert(M_Student model) { return(DBCenter.Insert(model) > 0); }
public int insert(M_Student model) { return(DBCenter.Insert(model)); }
/// <summary> ///更新记录 /// </summary> /// <param name="Student"></param> /// <returns></returns> public bool GetUpdate(M_Student model) { return(Sql.UpdateByIDs(TbName, PK, model.Noteid.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters(model))); }
/// <summary> ///添加记录 /// </summary> /// <param name="Student"></param> /// <returns></returns> public bool GetInsert(M_Student model) { return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0); }