Exemplo n.º 1
0
        public static List <CustomAppointment> GetAppointments(List <CustomResource> resources)
        {
            List <CustomAppointment> appointments = new List <CustomAppointment>();

            foreach (CustomResource item in resources)
            {
                string subjPrefix = item.Name + "'s ";
                appointments.Add(CustomAppointment.CreateCustomAppointment("meeting", item.ResID, 2, 5, lastInsertedID++));
                appointments.Add(CustomAppointment.CreateCustomAppointment("travel", item.ResID, 3, 6, lastInsertedID++));
                appointments.Add(CustomAppointment.CreateCustomAppointment("phone call", item.ResID, 0, 10, lastInsertedID++));
            }
            return(appointments);
        }
Exemplo n.º 2
0
        public static CustomAppointment CreateCustomAppointment(string subject, object resourceId, int status, int label, int id)
        {
            CustomAppointment apt = new CustomAppointment();

            apt.ID        = id;
            apt.Subject   = subject;
            apt.OwnerId   = String.Format("<ResourceIds>\r\n<ResourceId Type=\"System.Int32\" Value=\"{0}\"/>\r\n</ResourceIds>", resourceId);
            apt.StartTime = DateTime.Now.AddHours(id);
            apt.EndTime   = apt.StartTime.AddHours(3);
            apt.Status    = status;
            apt.Label     = label;
            return(apt);
        }
Exemplo n.º 3
0
        public static CustomAppointment CreateCustomAppointment(string subject, object resourceId, int status, int label, int id)
        {
            CustomAppointment apt = new CustomAppointment();

            apt.ID        = id;
            apt.Subject   = subject;
            apt.OwnerId   = Convert.ToInt32(resourceId);
            apt.StartTime = DateTime.Now.AddHours(id);
            apt.EndTime   = apt.StartTime.AddHours(3);
            apt.Status    = status;
            apt.Label     = label;
            return(apt);
        }
        public static CustomAppointment CreateCustomAppointment(string subject, object resourceId, int status, int label, int id)
        {
            CustomAppointment apt = new CustomAppointment();

            apt.ID          = id;
            apt.Subject     = subject;
            apt.OwnerId     = resourceId;
            apt.StartTime   = DateTime.Now.AddHours(id);
            apt.EndTime     = apt.StartTime.AddHours(3);
            apt.Status      = status;
            apt.Label       = label;
            apt.Description = "Some detailed information about " + apt.Subject;
            return(apt);
        }
Exemplo n.º 5
0
        public static void RemoveAppointments(CustomAppointment[] appts)
        {
            if (appts.Length == 0)
            {
                return;
            }

            List <CustomAppointment> appointmnets = HttpContext.Current.Session["AppointmentsList"] as List <CustomAppointment>;

            for (int i = 0; i < appts.Length; i++)
            {
                CustomAppointment sourceObject = appointmnets.First <CustomAppointment>(apt => apt.ID == appts[i].ID);
                appointmnets.Remove(sourceObject);
            }
        }
 public ModelAppointment(CustomAppointment source)
 {
     if (source != null)
     {
         StartTime      = source.StartTime;
         EndTime        = source.EndTime;
         Subject        = source.Subject;
         Status         = source.Status;
         Description    = source.Description;
         Label          = source.Label;
         Location       = source.Location;
         AllDay         = source.AllDay;
         EventType      = source.EventType;
         RecurrenceInfo = source.RecurrenceInfo;
         ReminderInfo   = source.ReminderInfo;
         OwnerId        = source.OwnerId;
         CustomInfo     = source.CustomInfo;
         ID             = source.ID;
     }
 }