Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Что это за хрень в коде рабочего плагина?
- //using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\1\sa.txt"))
- //{
- // using (var orgContext = new OrganizationServiceContext(service))
- // {
- // var saCount = 0;
- // const int numberOfObjectsPerPage = 50;
- // for (var i = 0; ; i++)
- // {
- // var sa = (from a in orgContext.CreateQuery<ServiceAppointment>()
- // select a).Skip(numberOfObjectsPerPage * i).Take(numberOfObjectsPerPage).ToList();
- // saCount += numberOfObjectsPerPage;
- // Console.WriteLine(saCount);
- // if (sa.Count == 0)
- // {
- // break;
- // }
- // foreach (ServiceAppointment serviceAppointment in sa)
- // {
- // file.WriteLine(serviceAppointment.Id);
- // }
- // }
- // //foreach (ServiceAppointment serviceAppointment in sa)
- // //{
- // // file.WriteLine(serviceAppointment.Id);
- // //}
- // }
- //}
- //return;
- //var saCount = 0;
- //using (var orgContext = new OrganizationServiceContext(service))
- //{
- // const int numberOfObjectsPerPage = 50;
- // DateTime startDateTime = new DateTime(2015, 10, 5);
- // //for (var i = 0; ; i++)
- // {
- // //var sa = (from a in orgContext.CreateQuery<ServiceAppointment>()
- // // where a.ScheduledStart >= startDateTime.ToUniversalTime() &&
- // // a.ScheduledStart < startDateTime.ToUniversalTime().AddDays(1)
- // // select a).Skip(numberOfObjectsPerPage * i).Take(numberOfObjectsPerPage).ToList();
- // var sa = (from a in orgContext.CreateQuery<ServiceAppointment>()
- // where a.ScheduledStart >= startDateTime.ToUniversalTime() &&
- // a.ScheduledStart < startDateTime.ToUniversalTime().AddDays(89)
- // select a).ToList();
- // saCount += numberOfObjectsPerPage;
- // Console.WriteLine(saCount);
- // //if (sa.Count == 0)
- // //{
- // // break;
- // //}
- // UpdateSa(sa, service);
- // }
- //}
- //return;
- //var contactsForTeam = (from c in orgContext.CreateQuery<Contact>()
- // join s in orgContext.CreateQuery<SystemUser>() on c.OwnerId.Id equals s.SystemUserId
- // join b in orgContext.CreateQuery<BusinessUnit>() on s.BusinessUnitId.Id equals b.BusinessUnitId
- // //join d in orgContext.CreateQuery("principalobjectaccess") on c["contactid"] equals d["objectid"] into pr
- // //from prJoined in pr.DefaultIfEmpty(new Contact())
- // where b.new_account_dilerId == null
- // //where prJoined == null || ((Guid)prJoined["principalid"] == teamOwner.Id && (int)prJoined["accessrightsmask"] == 0)
- // select c);
- //select count(1),sa.StatusCode
- //from ServiceAppointment sa
- //inner join uds_share s on s.uds_shareid=sa.uds_shareid
- //inner join Connection c on c.Record1Id=s.uds_shareId
- //inner join Account a on a.AccountId=c.Record2Id and a.uds_isowncompany=1
- //group by sa.StatusCode
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement