public void LoadByContactId(int ContactId) { DataSet ds = new atriumDB(); PreRefresh(); myA.GetAttendee().PreRefresh(); if (myA.AtMng.AppMan.UseService) { ds = BEManager.DecompressDataSet(myA.AtMng.AppMan.AtriumX().AppointmentLoadByContactId(ContactId, myA.AtMng.AppMan.AtriumXCon), ds); } else { try { ds = BEManager.DecompressDataSet(myDAL.LoadAllForOfficer(ContactId), ds); } catch (System.Runtime.Serialization.SerializationException x) { RecoverDAL(); ds = BEManager.DecompressDataSet(myDAL.LoadAllForOfficer(ContactId), ds); } } Fill(ds.Tables["Appointment"]); myA.GetApptRecurrence().Fill(ds.Tables["ApptRecurrence"]); myA.GetAttendee().Fill(ds.Tables["Attendee"]); SetLocalDates(); ds.Clear(); ds.Dispose(); }
private void AddRecurringAppointment() { atriumDB.AppointmentRow newApptRow; atriumDB.AttendeeRow newAttRow; newApptRow = (atriumDB.AppointmentRow)myA.GetAppointment().Add(null); newApptRow.FileId = originalApptRow.FileId; if (!originalApptRow.IsActivityIdNull()) { newApptRow.ActivityId = originalApptRow.ActivityId; } newApptRow.StartDateLocal = trackDate; newApptRow.EndDateLocal = trackDate + tsAppointmentLength; if (!originalApptRow.IsTypeNull()) { newApptRow.Type = originalApptRow.Type; } if (!originalApptRow.IsSubjectNull()) { newApptRow.Subject = originalApptRow.Subject; } newApptRow.ShowAsBusy = originalApptRow.ShowAsBusy; newApptRow.AllDayEvent = originalApptRow.AllDayEvent; if (!originalApptRow.IsDescriptionNull()) { newApptRow.Description = originalApptRow.Description; } if (!originalApptRow.IsLocationNull()) { newApptRow.Location = originalApptRow.Location; } newApptRow.Tentative = originalApptRow.Tentative; newApptRow.Vacation = originalApptRow.Vacation; newApptRow.ApptRecurrenceId = originalApptRow.ApptRecurrenceId; // add attendees to new recurring appointment foreach (atriumDB.AttendeeRow originalAttRow in originalAttRows) { newAttRow = (atriumDB.AttendeeRow)myA.GetAttendee().Add(newApptRow); newAttRow.FileId = originalAttRow.FileId; newAttRow.ContactId = originalAttRow.ContactId; newAttRow.Accepted = originalAttRow.Accepted; newAttRow.Declined = originalAttRow.Declined; newAttRow.Required = originalAttRow.Required; newAttRow.Tentative = originalAttRow.Tentative; } }