当前位置: 首页>>代码示例>>C#>>正文


C# CMSDataContext.AttendUpdateN方法代码示例

本文整理汇总了C#中CmsData.CMSDataContext.AttendUpdateN方法的典型用法代码示例。如果您正苦于以下问题:C# CMSDataContext.AttendUpdateN方法的具体用法?C# CMSDataContext.AttendUpdateN怎么用?C# CMSDataContext.AttendUpdateN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CmsData.CMSDataContext的用法示例。


在下文中一共展示了CMSDataContext.AttendUpdateN方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MovePersonStuff

        public void MovePersonStuff(CMSDataContext db, int targetid)
        {
            var toperson = db.People.Single(p => p.PeopleId == targetid);
            foreach (var om in this.OrganizationMembers)
            {
                var om2 = OrganizationMember.InsertOrgMembers(db, om.OrganizationId, targetid, om.MemberTypeId, om.EnrollmentDate.Value, om.InactiveDate, om.Pending ?? false);
                db.UpdateMainFellowship(om.OrganizationId);
                om2.CreatedBy = om.CreatedBy;
                om2.CreatedDate = om.CreatedDate;
                om2.AttendPct = om.AttendPct;
                om2.AttendStr = om.AttendStr;
                om2.LastAttended = om.LastAttended;
                om2.Request = om.Request;
                om2.Grade = om.Grade;
                om2.Amount = om.Amount;
                om2.TranId = om.TranId;
                om2.AmountPaid = om.AmountPaid;
                om2.PayLink = om.PayLink;
                om2.Moved = om.Moved;
                om2.InactiveDate = om.InactiveDate;
                om.Pending = om.Pending;
                om.Request = om.Request;
                om2.RegisterEmail = om.RegisterEmail;
                om2.ShirtSize = om.ShirtSize;
                om2.Tickets = om.Tickets;
                om2.UserData = om.UserData;
                om2.OnlineRegData = om.OnlineRegData;
                db.SubmitChanges();
                foreach (var m in om.OrgMemMemTags)
                    if (!om2.OrgMemMemTags.Any(mm => mm.MemberTagId == m.MemberTagId))
                        om2.OrgMemMemTags.Add(new OrgMemMemTag { MemberTagId = m.MemberTagId });
                db.SubmitChanges();
                db.OrgMemMemTags.DeleteAllOnSubmit(om.OrgMemMemTags);
                db.SubmitChanges();
                TrySubmit(db, $"Organizations (orgid:{om.OrganizationId})");
            }
            db.OrganizationMembers.DeleteAllOnSubmit(this.OrganizationMembers);
            TrySubmit(db, "DeletingMemberships");

            foreach (var et in this.EnrollmentTransactions)
                et.PeopleId = targetid;
            TrySubmit(db, "EnrollmentTransactions");

            var tplist = TransactionPeople.ToList();
            if (tplist.Any())
            {
                db.TransactionPeople.DeleteAllOnSubmit(TransactionPeople);
                TrySubmit(db, "Delete TransactionPeople");

                foreach (var tp in tplist)
                    db.TransactionPeople.InsertOnSubmit(new TransactionPerson
                    {
                        OrgId = tp.OrgId,
                        Amt = tp.Amt,
                        Id = tp.Id,
                        PeopleId = targetid
                    });
                TrySubmit(db, "Add TransactionPeople");
            }

            var q = from a in db.Attends
                    where a.AttendanceFlag == true
                    where a.PeopleId == this.PeopleId
                    select a;
            foreach (var a in q)
                Attend.RecordAttendance(db, targetid, a.MeetingId, true);
            db.AttendUpdateN(targetid, 10);

            foreach (var c in this.Contributions)
                c.PeopleId = targetid;
            TrySubmit(db, "Contributions");

            foreach (var u in this.Users)
                u.PeopleId = targetid;
            TrySubmit(db, "Users");

            if (this.Volunteers.Any() && !toperson.Volunteers.Any())
                foreach (var v in this.Volunteers)
                {
                    var vv = new Volunteer
                    {
                        PeopleId = targetid,
                        Children = v.Children,
                        Comments = v.Comments,
                        Leader = v.Leader,
                        ProcessedDate = v.ProcessedDate,
                        Standard = v.Standard,
                        StatusId = v.StatusId,
                    };
                    db.Volunteers.InsertOnSubmit(vv);
                }
            TrySubmit(db, "Volunteers");

            foreach (var v in this.VolunteerForms)
                v.PeopleId = targetid;
            TrySubmit(db, "VolunteerForms");

            foreach (var c in this.contactsMade)
            {
                var cp = db.Contactors.SingleOrDefault(c2 => c2.PeopleId == targetid && c.ContactId == c2.ContactId);
//.........这里部分代码省略.........
开发者ID:alexserdyuk,项目名称:bvcms,代码行数:101,代码来源:Person.cs


注:本文中的CmsData.CMSDataContext.AttendUpdateN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。