本文整理汇总了C#中CmsData.CMSDataContext.UpdateMainFellowship方法的典型用法代码示例。如果您正苦于以下问题:C# CMSDataContext.UpdateMainFellowship方法的具体用法?C# CMSDataContext.UpdateMainFellowship怎么用?C# CMSDataContext.UpdateMainFellowship使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CmsData.CMSDataContext
的用法示例。
在下文中一共展示了CMSDataContext.UpdateMainFellowship方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public ActionResult Start(int tag, int meetingid, bool addasmembers)
{
var runningtotals = new AddToOrgFromTagRun
{
Started = DateTime.Now,
Count = 0,
Processed = 0,
Orgid = meetingid
};
DbUtil.Db.AddToOrgFromTagRuns.InsertOnSubmit(runningtotals);
DbUtil.Db.SubmitChanges();
var host = Util.Host;
var qid = DbUtil.Db.FetchLastQuery().Id;
System.Threading.Tasks.Task.Factory.StartNew(() =>
{
System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.BelowNormal;
var Db = new CMSDataContext(Util.GetConnectionString(host));
IEnumerable<int> q = null;
if (tag == -1) // (last query)
q = Db.PeopleQuery(qid).Select(pp => pp.PeopleId);
else
q = from t in Db.TagPeople
where t.Id == tag
select t.PeopleId;
var pids = q.ToList();
var meeting = Db.Meetings.SingleOrDefault(mm => mm.MeetingId == meetingid);
var joindate = meeting.MeetingDate.Value.AddMinutes(-1);
var orgid = meeting.OrganizationId;
foreach (var pid in pids)
{
Db.Dispose();
Db = new CMSDataContext(Util.GetConnectionString(host));
if (addasmembers)
OrganizationMember.InsertOrgMembers(Db,
orgid, pid, MemberTypeCode.Member, joindate, null, false);
Db.RecordAttendance(meetingid, pid, true);
var r = Db.AddToOrgFromTagRuns.Where(mm => mm.Orgid == meetingid).OrderByDescending(mm => mm.Id).First();
r.Processed++;
r.Count = pids.Count;
Db.SubmitChanges();
}
var rr = Db.AddToOrgFromTagRuns.Where(mm => mm.Orgid == meetingid).OrderByDescending(mm => mm.Id).First();
rr.Completed = DateTime.Now;
Db.SubmitChanges();
Db.UpdateMainFellowship(orgid);
});
return Redirect("/AddAttendeesFromTag/Progress/" + meetingid);
}
示例2: 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);
//.........这里部分代码省略.........
示例3: Start
public ActionResult Start(int tag, int orgid)
{
var runningtotals = new AddToOrgFromTagRun
{
Started = DateTime.Now,
Count = 0,
Processed = 0,
Orgid = orgid
};
DbUtil.Db.AddToOrgFromTagRuns.InsertOnSubmit(runningtotals);
DbUtil.Db.SubmitChanges();
var host = Util.Host;
var qid = DbUtil.Db.FetchLastQuery().Id;
System.Threading.Tasks.Task.Factory.StartNew(() =>
{
Thread.CurrentThread.Priority = ThreadPriority.BelowNormal;
var Db = new CMSDataContext(Util.GetConnectionString(host));
var cul = Db.Setting("Culture", "en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo(cul);
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cul);
IEnumerable<int> q = null;
if (tag == -1) // (last query)
q = Db.PeopleQuery(qid).Select(pp => pp.PeopleId);
else
q = from t in Db.TagPeople
where t.Id == tag
select t.PeopleId;
var pids = q.ToList();
foreach (var pid in pids)
{
Db.Dispose();
Db = new CMSDataContext(Util.GetConnectionString(host));
OrganizationMember.InsertOrgMembers(Db,
orgid, pid, MemberTypeCode.Member, DateTime.Now, null, false);
var r = Db.AddToOrgFromTagRuns.Where(mm => mm.Orgid == orgid).OrderByDescending(mm => mm.Id).First();
r.Processed++;
r.Count = pids.Count;
Db.SubmitChanges();
}
var rr = Db.AddToOrgFromTagRuns.Where(mm => mm.Orgid == orgid).OrderByDescending(mm => mm.Id).First();
rr.Completed = DateTime.Now;
Db.SubmitChanges();
Db.UpdateMainFellowship(orgid);
});
return Redirect("/AddToOrgPrevFromTag/Progress/" + orgid);
}