Exemple #1
0
        private void AddDummyAppointmentForFileContacts(atriumDB.AttendeeRow fcr)
        {
            //TODO only add if contactid not in timeline table
            var tx = from t in myFM.DB.TimeLine
                     where t.ContactId == fcr.ContactId
                     select t;

            if (tx.Count() == 0)
            {
                atriumDB.TimeLineRow appr = myFM.DB.TimeLine.NewTimeLineRow();
                appr.ContactId      = fcr.ContactId;
                appr.StartDate      = DateTime.Today.AddYears(-1);
                appr.EndDate        = DateTime.Today.AddYears(-1);
                appr.StartDateLocal = DateTime.Today.AddYears(-1);
                appr.EndDateLocal   = DateTime.Today.AddYears(-1);
                myFM.DB.TimeLine.AddTimeLineRow(appr);
            }
        }
Exemple #2
0
        private void LoadOutlookFreeBusy(int ContactId, DateTime startDate, DateTime endDate)
        {
            //get email for contact
            officeDB.OfficerRow or = myA.AtMng.OfficeMng.DB.Officer.FindByOfficerId(ContactId);
            if (or == null)
            {
                or = myA.AtMng.OfficeMng.GetOfficer().Load(ContactId);
            }

            if (or != null)
            {
                string sEmail = or.EmailAddress;

                //get addressentry from RDO
                Redemption.RDOSession sess = DocumentBE.RDOSession();
                sess.Logon(missing, missing, missing, missing, missing, missing);
                //Redemption.RDOAddressList gal = sess.AddressBook.GAL;
                Redemption.RDOAddressEntry ae = sess.AddressBook.ResolveName(sEmail);
                //get free busy
                if (ae.Type == "EX")
                {
                    string s = ae.GetFreeBusy(startDate, 30);
                    Redemption.RDOFreeBusyRange fbr = ae.FreeBusyList;
                    //loop over array
                    foreach (Redemption.RDOFreeBusySlot fbs in fbr)
                    {
                        //load myTimelineDT
                        atriumDB.TimeLineRow tlr = myTimelineDT.NewTimeLineRow();
                        tlr.ContactId = ContactId;
                        tlr.StartDate = fbs.Start;
                        tlr.EndDate   = fbs.End;
                        myTimelineDT.AddTimeLineRow(tlr);
                    }
                }
            }
        }