Advertisement
Guest User

Untitled

a guest
May 27th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.05 KB | None | 0 0
  1.  
  2.             #region Что это за хрень в коде рабочего плагина?
  3.             //using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\1\sa.txt"))
  4.             //{
  5.             //    using (var orgContext = new OrganizationServiceContext(service))
  6.             //    {
  7.             //        var saCount = 0;
  8.             //        const int numberOfObjectsPerPage = 50;
  9.  
  10.             //        for (var i = 0; ; i++)
  11.             //        {
  12.             //            var sa = (from a in orgContext.CreateQuery<ServiceAppointment>()
  13.             //                      select a).Skip(numberOfObjectsPerPage * i).Take(numberOfObjectsPerPage).ToList();
  14.  
  15.             //            saCount += numberOfObjectsPerPage;
  16.             //            Console.WriteLine(saCount);
  17.  
  18.             //            if (sa.Count == 0)
  19.             //            {
  20.             //                break;
  21.             //            }
  22.             //            foreach (ServiceAppointment serviceAppointment in sa)
  23.             //            {
  24.             //                file.WriteLine(serviceAppointment.Id);
  25.             //            }
  26.             //        }
  27.  
  28.             //        //foreach (ServiceAppointment serviceAppointment in sa)
  29.             //        //{
  30.             //        //    file.WriteLine(serviceAppointment.Id);
  31.             //        //}
  32.             //    }
  33.             //}
  34.  
  35.             //return;
  36.  
  37.             //var saCount = 0;
  38.  
  39.             //using (var orgContext = new OrganizationServiceContext(service))
  40.             //{
  41.             //    const int numberOfObjectsPerPage = 50;
  42.  
  43.             //    DateTime startDateTime = new DateTime(2015, 10, 5);
  44.  
  45.             //    //for (var i = 0; ; i++)
  46.             //    {
  47.             //        //var sa = (from a in orgContext.CreateQuery<ServiceAppointment>()
  48.             //        //          where a.ScheduledStart >= startDateTime.ToUniversalTime() &&
  49.             //        //                    a.ScheduledStart < startDateTime.ToUniversalTime().AddDays(1)
  50.             //        //          select a).Skip(numberOfObjectsPerPage * i).Take(numberOfObjectsPerPage).ToList();
  51.  
  52.             //        var sa = (from a in orgContext.CreateQuery<ServiceAppointment>()
  53.             //                  where a.ScheduledStart >= startDateTime.ToUniversalTime() &&
  54.             //                            a.ScheduledStart < startDateTime.ToUniversalTime().AddDays(89)
  55.             //                  select a).ToList();
  56.  
  57.             //        saCount += numberOfObjectsPerPage;
  58.             //        Console.WriteLine(saCount);
  59.  
  60.             //        //if (sa.Count == 0)
  61.             //        //{
  62.             //        //    break;
  63.             //        //}
  64.             //        UpdateSa(sa, service);
  65.             //    }
  66.             //}
  67.  
  68.             //return;
  69.  
  70.  
  71.  
  72.  
  73.  
  74.             //var contactsForTeam = (from c in orgContext.CreateQuery<Contact>()
  75.             //                       join s in orgContext.CreateQuery<SystemUser>() on c.OwnerId.Id equals s.SystemUserId
  76.             //                       join b in orgContext.CreateQuery<BusinessUnit>() on s.BusinessUnitId.Id equals b.BusinessUnitId
  77.             //                       //join d in orgContext.CreateQuery("principalobjectaccess") on c["contactid"] equals d["objectid"] into pr
  78.             //                       //from prJoined in pr.DefaultIfEmpty(new Contact())
  79.             //                       where b.new_account_dilerId == null
  80.             //                       //where prJoined == null || ((Guid)prJoined["principalid"] == teamOwner.Id && (int)prJoined["accessrightsmask"] == 0)
  81.             //                       select c);
  82.  
  83.  
  84.             //select count(1),sa.StatusCode
  85.             //from ServiceAppointment sa
  86.             //inner join uds_share s on s.uds_shareid=sa.uds_shareid
  87.             //inner join Connection c on c.Record1Id=s.uds_shareId
  88.             //inner join Account a on a.AccountId=c.Record2Id and a.uds_isowncompany=1
  89.  
  90.             //group by sa.StatusCode
  91.             #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement