示例#1
0
        //删除一个成员
        public void  Delete(int mmid)
        {
            MeetMember mm = GetModel(mmid);

            db.MeetMember.DeleteOnSubmit(mm);
            db.SubmitChanges();
        }
示例#2
0
        /// <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();
        }
示例#3
0
        /// <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"));
        }
示例#4
0
        /// <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"));
        }