//删除一个成员 public void Delete(int mmid) { MeetMember mm = GetModel(mmid); db.MeetMember.DeleteOnSubmit(mm); db.SubmitChanges(); }
/// <summary> /// 修改出席状态 /// </summary> /// <param name="id"></param> public void JoinChange(int id) { MeetMember mm = GetModel(id); if (mm.Joined == 0) { mm.Joined = 1; } else { mm.Joined = 0; } db.SubmitChanges(); }
/// <summary> /// 添加一个成员 /// </summary> /// <param name="meetId"></param> /// <param name="empId"></param> /// <returns></returns> public JsonResult addOneMember(int meetId, int empId) { var member = od.MeetMember.Where(n => n.MeetId == meetId && n.EmpId == empId).ToList(); if (member.Count != 0) { return(Json("No")); } MeetMember mm = new MeetMember(); mm.MeetId = meetId; mm.EmpId = empId; mm.Joined = 0; od.MeetMember.InsertOnSubmit(mm); od.SubmitChanges(); return(Json("Ok")); }
/// <summary> /// 批量加入成员 /// </summary> /// <param name="members">成员的id数组</param> /// <param name="meetId">会议Id</param> /// <returns></returns> public JsonResult sureAdd(int[] members, int meetId) { List <MeetMember> metMembers = new List <MeetMember>(); if (members != null) { foreach (int empId in members) { var metmeb = md.GetOneMM(empId, meetId); if (metmeb.Count != 0) { continue; } MeetMember mm = new MeetMember(); mm.EmpId = empId; mm.MeetId = meetId; mm.Joined = 0; metMembers.Add(mm); } md.SaveAllMM(metMembers); } return(Json("Ok")); }