/// <summary> /// 添加成员到学习班 /// </summary> /// <param name="classId"></param> /// <param name="userIds"></param> public void AddStudentsToClass(int classId, params int[] userIds) { if (userIds == null || userIds.Length == 0) { return; } //var deleteWhere = "Len_Students.ClassId=" + classId;// +" AND Len_Students.UserId IN (" + userIds.GetString() + ")"; //_dataAccess.DeleteEntities<LenStudents>(deleteWhere); var students = new List <LenStudents>(); foreach (var userId in userIds) { var student = new LenStudents { ClassId = classId, UserId = userId, IsCreater = false, IsDeleted = false, JoinTime = DateTime.Now }; students.Add(student); } _dataAccess.AddEntities(students); }
/// <summary> /// 新增LenStudents /// </summary> /// <param name="lenstudents"></param> /// <returns></returns> public int AddLenStudents(LenStudents lenstudents) { return(_dataAccess.AddEntity(lenstudents)); }
/// <summary> /// 修改LenStudents /// </summary> /// <param name="lenstudents"></param> /// <returns></returns> public int UpdateLenStudents(LenStudents lenstudents) { return(_dataAccess.UpdateEntity(lenstudents)); }