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


C# CMSDataContext.RecordAttendance方法代码示例

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


在下文中一共展示了CMSDataContext.RecordAttendance方法的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);
 }
开发者ID:hkouns,项目名称:bvcms,代码行数:48,代码来源:AddAttendeesFromTagController.cs

示例2: RecordAttendance

		public static string RecordAttendance(CMSDataContext Db, int PeopleId, int MeetingId, bool attended)
		{
			int ntries = 6;
			while (true)
			{
				try
				{
        			return Db.RecordAttendance(MeetingId, PeopleId, attended);
				}
				catch (SqlException ex)
				{
					if (ex.Number == 1205)
						if (--ntries > 0)
						{
							System.Threading.Thread.Sleep(500);
							continue;
						}
					throw;
				}
			}
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:21,代码来源:Attend.cs

示例3: RecordAttend

		public static void RecordAttend(CMSDataContext Db, int PeopleId, int OrgId, bool Present, DateTime dt)
		{
			var q = from o in Db.Organizations
					where o.OrganizationId == OrgId
					let p = Db.People.Single(pp => pp.PeopleId == PeopleId)
					select new
					{
						o.Location,
						OrgEntryPoint = o.EntryPointId,
						p.EntryPointId,
					};
			var info = q.Single();
			if (info.EntryPointId == null)
			{
				var p = Db.LoadPersonById(PeopleId);
			    if (info.OrgEntryPoint > 0)
			    {
			        p.EntryPointId = info.OrgEntryPoint;
			        Db.SubmitChanges();
			    }
			}
			int ntries = 6;
			while (true)
			{
				try
				{
        		    Db.RecordAttendance(OrgId, PeopleId, dt, Present, info.Location);
				    return;
				}
				catch (SqlException ex)
				{
					if (ex.Number == 1205)
						if (--ntries > 0)
						{
							System.Threading.Thread.Sleep(500);
							continue;
						}
					throw;
				}
			}
		}
开发者ID:stevesloka,项目名称:bvcms,代码行数:41,代码来源:Attend.cs


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