示例#1
0
        public static void AddAttend(CMSDataContext Db, int PeopleId, int OrgId, bool Present, int MeetingId, DateTime dt)
        {
            var a = new Attend
            {
                AttendanceFlag   = Present,
                AttendanceTypeId = AttendTypeCode.Member,
                MemberTypeId     = MemberTypeCode.Member,
                MeetingId        = MeetingId,
                MeetingDate      = dt,
                PeopleId         = PeopleId,
                OrganizationId   = OrgId,
                CreatedDate      = DateTime.Now,
            };

            Db.Attends.InsertOnSubmit(a);
        }
示例#2
0
文件: Attend.cs 项目: rossspoon/bvcms
 public static Attend AddAttend(CMSDataContext Db, int PeopleId, int OrgId, bool Present, int attendtype, int membertype, DateTime dt)
 {
     var meeting = Meeting.FetchOrCreateMeeting(Db, OrgId, dt, noautoabsents: true);
     var a = new Attend
     {
         AttendanceFlag = Present,
         AttendanceTypeId = attendtype,
         MemberTypeId = membertype,
         MeetingId = meeting.MeetingId,
         MeetingDate = dt,
         PeopleId = PeopleId,
         OrganizationId = OrgId,
         CreatedDate = DateTime.Now,
     };
     Db.Attends.InsertOnSubmit(a);
     return a;
 }
示例#3
0
        public static Attend AddAttend(CMSDataContext Db, int PeopleId, int OrgId, bool Present, int attendtype, int membertype, DateTime dt)
        {
            var meeting = Meeting.FetchOrCreateMeeting(Db, OrgId, dt, noautoabsents: true);
            var a       = new Attend
            {
                AttendanceFlag   = Present,
                AttendanceTypeId = attendtype,
                MemberTypeId     = membertype,
                MeetingId        = meeting.MeetingId,
                MeetingDate      = dt,
                PeopleId         = PeopleId,
                OrganizationId   = OrgId,
                CreatedDate      = DateTime.Now,
            };

            Db.Attends.InsertOnSubmit(a);
            return(a);
        }
示例#4
0
        public static int AddAttend(CMSDataContext Db, int PeopleId, int OrgId, bool Present, DateTime dt)
        {
            var meeting = Meeting.FetchOrCreateMeeting(Db, OrgId, dt);
            var a       = new Attend
            {
                AttendanceFlag   = Present,
                AttendanceTypeId = AttendTypeCode.Member,
                MemberTypeId     = Codes.MemberTypeCode.Member,
                MeetingId        = meeting.MeetingId,
                MeetingDate      = dt,
                PeopleId         = PeopleId,
                OrganizationId   = OrgId,
                CreatedDate      = DateTime.Now,
            };

            Db.Attends.InsertOnSubmit(a);
            return(meeting.MeetingId);
        }
示例#5
0
        public static void MarkRegistered(CMSDataContext Db, int PeopleId, int MeetingId, int?CommitId, bool AvoidRegrets = false)
        {
            var i = (from m in Db.Meetings
                     where m.MeetingId == MeetingId
                     let om = Db.OrganizationMembers.SingleOrDefault(mm => mm.OrganizationId == m.OrganizationId && mm.PeopleId == PeopleId)
                              let a = Db.Attends.SingleOrDefault(aa => aa.PeopleId == PeopleId && aa.MeetingId == MeetingId)
                                      select new
            {
                a,
                m.OrganizationId,
                MeetingDate = m.MeetingDate.Value,
                MemberTypeId = om == null ? CmsData.Codes.MemberTypeCode.Visitor : om.MemberTypeId,
            }).Single();

            if (i.a == null)
            {
                var a = new Attend
                {
                    OrganizationId   = i.OrganizationId,
                    PeopleId         = PeopleId,
                    MeetingDate      = i.MeetingDate,
                    AttendanceFlag   = false,
                    CreatedDate      = Util.Now,
                    CreatedBy        = Util.UserId1,
                    AttendanceTypeId = null,
                    BFCAttendance    = null,
                    OtherAttends     = 0,
                    MemberTypeId     = i.MemberTypeId,
                    OtherOrgId       = 0,
                    Commitment       = CommitId,
                    MeetingId        = MeetingId
                };
                Db.Attends.InsertOnSubmit(a);
            }
            else if (AvoidRegrets == false || i.a.Commitment == 1 || i.a.Commitment == null)
            {
                i.a.Commitment = CommitId;
            }
            Db.SubmitChanges();
        }
示例#6
0
 private void detach_Attends(Attend entity)
 {
     this.SendPropertyChanging();
     entity.MemberType = null;
 }
示例#7
0
 private void attach_Attends(Attend entity)
 {
     this.SendPropertyChanging();
     entity.MemberType = this;
 }
示例#8
0
 private void detach_Attends(Attend entity)
 {
     this.SendPropertyChanging();
     entity.AttendType = null;
 }
示例#9
0
 private void attach_Attends(Attend entity)
 {
     this.SendPropertyChanging();
     entity.AttendType = this;
 }
示例#10
0
		private void detach_Attends(Attend entity)
		{
			this.SendPropertyChanging();
			entity.Person = null;
		}
示例#11
0
		private void attach_Attends(Attend entity)
		{
			this.SendPropertyChanging();
			entity.Person = this;
		}
示例#12
0
		public static void MarkRegistered(CMSDataContext Db, int PeopleId, int MeetingId, int? CommitId, bool AvoidRegrets = false)
		{
			var i = (from m in Db.Meetings
					 where m.MeetingId == MeetingId
					 let om = Db.OrganizationMembers.SingleOrDefault(mm => mm.OrganizationId == m.OrganizationId && mm.PeopleId == PeopleId)
					 let a = Db.Attends.SingleOrDefault(aa => aa.PeopleId == PeopleId && aa.MeetingId == MeetingId)
					 select new
					 {
						 a,
						 m.OrganizationId,
						 MeetingDate = m.MeetingDate.Value,
						 MemberTypeId = om == null ? CmsData.Codes.MemberTypeCode.Visitor : om.MemberTypeId,
					 }).Single();
			if (i.a == null)
			{
				var a = new Attend
				{
					OrganizationId = i.OrganizationId,
					PeopleId = PeopleId,
					MeetingDate = i.MeetingDate,
					AttendanceFlag = false,
					CreatedDate = Util.Now,
					CreatedBy = Util.UserId1,
					AttendanceTypeId = null,
					BFCAttendance = null,
					OtherAttends = 0,
					MemberTypeId = i.MemberTypeId,
					OtherOrgId = 0,
					Commitment = CommitId,
					MeetingId = MeetingId
				};
				Db.Attends.InsertOnSubmit(a);
			}
			else if (AvoidRegrets == false || i.a.Commitment == 1 || i.a.Commitment == null)
				i.a.Commitment = CommitId;
			Db.SubmitChanges();
		}
示例#13
0
        public static void AddAttend(CMSDataContext Db, int PeopleId, int OrgId, bool Present, int MeetingId, DateTime dt)
		{
			var a = new Attend
			{
				AttendanceFlag = Present,
				AttendanceTypeId = AttendTypeCode.Member,
				MemberTypeId = MemberTypeCode.Member,
				MeetingId = MeetingId,
				MeetingDate = dt,
				PeopleId = PeopleId,
				OrganizationId = OrgId,
				CreatedDate = DateTime.Now,
			};
			Db.Attends.InsertOnSubmit(a);
		}
示例#14
0
 private void detach_Attends(Attend entity)
 {
     this.SendPropertyChanging();
     entity.Organization = null;
 }