public DropFolderICalBulkUploadFileHandlerConfig(JToken node) : base(node) { if (node["eventsType"] != null) { this._EventsType = (ScheduleEventType)ParseEnum(typeof(ScheduleEventType), node["eventsType"].Value <string>()); } }
public BulkUploadICalJobData(JToken node) : base(node) { if (node["eventsType"] != null) { this._EventsType = (ScheduleEventType)ParseEnum(typeof(ScheduleEventType), node["eventsType"].Value <string>()); } }
private int CheckStepWherePatientQuit(List <ScheduleEvent> scheduleEventsInSession) { scheduleEventsInSession.Sort((x, y) => DateTime.Compare(y.TimeStamp, x.TimeStamp)); if (scheduleEventsInSession.ElementAtOrDefault(1) == null) { return(0); } ScheduleEventType typeEventBeforeQuit = scheduleEventsInSession[1].EventType; if (typeEventBeforeQuit == ScheduleEventType.JOIN || typeEventBeforeQuit == ScheduleEventType.FROMDOCTORTOSPEC) { return(0); } else if (typeEventBeforeQuit == ScheduleEventType.FROMSPECTODOCTOR || typeEventBeforeQuit == ScheduleEventType.FROMDATEPICKERTODOCTOR) { return(1); } else if (typeEventBeforeQuit == ScheduleEventType.FROMDOCTORTODATEPICKER || typeEventBeforeQuit == ScheduleEventType.FROMPERIODTODATEPICKER) { return(2); } else { return(3); } }
protected void SaveClicked(object o, EventArgs e) { var b = new ScheduleEventType(); if (SelectedEvent != null) { b = SelectedEvent; } b.Name = tbName.Text; b.Description = tbDescription.Text; new ScheduleEventTypeServices().Save(b); }
public BulkUploadICalJobData(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "eventsType": this._EventsType = (ScheduleEventType)ParseEnum(typeof(ScheduleEventType), propertyNode.InnerText); continue; } } }
public DropFolderICalBulkUploadFileHandlerConfig(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "eventsType": this._EventsType = (ScheduleEventType)ParseEnum(typeof(ScheduleEventType), propertyNode.InnerText); continue; } } }
public void Delete(ScheduleEventType item) { new ScheduleEventTypeRepository().Delete(item); }
public ScheduleEventType Save(ScheduleEventType item) { return(new ScheduleEventTypeRepository().SaveOrUpdate(item)); }
/// <summary> /// Additional ctor. /// </summary> /// <param name="eventType">Tipe of event.</param> /// <param name="startTime">Start event time.</param> /// <param name="duration">Event duration.</param> public ScheduleEvent(ScheduleEventType eventType, DateTime startTime, TimeSpan duration) { this.EventType = eventType; this.StartTime = startTime; this.Duration = duration; }
public ScheduleEvent(ScheduleEventType eventType, DateTime dateTime, Guid baseEntityId, Guid sessionId) : base(dateTime, baseEntityId) { EventType = eventType; SessionId = sessionId; }
public ScheduleEvent(XmlNode eventNode) { this.ID = Utility.SafeAttribute(eventNode, "id"); this.Version = Utility.SafeAttribute(eventNode, "version"); //string eventType = Utility.Capitalize(Utility.SafeAttribute(eventNode, "event_type")); //if (!Enum.TryParse<ScheduleEventType>(eventType, out this.EventType)) //{ // this.EventType = ScheduleEventType.Normal; //} try { this.EventType = (ScheduleEventType)Enum.Parse(typeof(ScheduleEventType), Utility.SafeAttribute(eventNode, "event_type"), true); } catch (Exception) { this.EventType = ScheduleEventType.Normal; } //string publicType = Utility.Capitalize(Utility.SafeAttribute(eventNode, "public_type")); //if (!Enum.TryParse<SchedulePublicType>(publicType, out this.PublicType)) //{ // this.PublicType = SchedulePublicType.Public; //} try { this.PublicType = (SchedulePublicType)Enum.Parse(typeof(SchedulePublicType), Utility.SafeAttribute(eventNode, "public_type"), true); } catch (Exception) { this.PublicType = SchedulePublicType.Public; } this.AllDay = (Utility.SafeAttribute(eventNode, "allday").ToLowerInvariant() == bool.TrueString.ToLowerInvariant()); this.StartOnly = (Utility.SafeAttribute(eventNode, "start_only").ToLowerInvariant() == bool.TrueString.ToLowerInvariant()); // when/date|datetime XmlNode whenNode = eventNode["when"]; if (whenNode != null) { XmlNode dateNode = whenNode["date"]; XmlNode dateTimeNode = whenNode["datetime"]; if (dateNode != null && (this.AllDay || this.EventType == ScheduleEventType.Banner)) { this.StartValue = Utility.SafeAttribute(dateNode, "start"); this.Start = Utility.ParseXSDDate(this.StartValue); if (!this.StartOnly) { this.EndValue = Utility.SafeAttribute(dateNode, "end"); this.End = Utility.ParseXSDDate(this.EndValue); } } else if (dateTimeNode != null && !this.AllDay && this.EventType != ScheduleEventType.Banner) { string startValue = Utility.SafeAttribute(dateTimeNode, "start"); this.Start = Utility.ParseISO8601(startValue, true).ToLocalTime(); this.StartValue = Utility.FormatXSDDateTime(this.Start); if (!this.StartOnly) { string endValue = Utility.SafeAttribute(dateTimeNode, "end"); this.End = Utility.ParseISO8601(endValue, true).ToLocalTime(); this.EndValue = Utility.FormatXSDDateTime(this.End); } } } this.Plan = Utility.SafeAttribute(eventNode, "plan"); this.Detail = Utility.SafeAttribute(eventNode, "detail"); this.Description = Utility.SafeAttribute(eventNode, "description"); // members XmlNode membersNode = eventNode["members"]; if (membersNode != null) { foreach (XmlNode memberNode in membersNode.ChildNodes) { if (memberNode.Name != "member") { continue; } if (memberNode.FirstChild == null) { continue; } string id = Utility.SafeAttribute(memberNode.FirstChild, "id"); if (string.IsNullOrEmpty(id)) { continue; } switch (memberNode.FirstChild.Name) { case "user": this.UserIds.Add(id); break; case "organization": this.OrganizaitonIds.Add(id); break; case "facility": this.FacilityIds.Add(id); break; } } } }
private Tuple <double, double> GetAverageTimeOnPageAtOneSession(List <ScheduleEvent> scheduleEventsInSession, ScheduleEventType toJoin, ScheduleEventType toComeBack) { scheduleEventsInSession.Sort((x, y) => DateTime.Compare(x.TimeStamp, y.TimeStamp)); double sumOfTimesOnPage = 0; double numberOfTimesOnPage = 0; for (int i = 0; i < scheduleEventsInSession.Count; i++) { if (scheduleEventsInSession.ElementAtOrDefault(i + 1) == null) { break; } if (scheduleEventsInSession[i].EventType == toJoin || scheduleEventsInSession[i].EventType == toComeBack) { sumOfTimesOnPage += GetTimeBeetwenTwoEvents(scheduleEventsInSession[i + 1].TimeStamp, scheduleEventsInSession[i].TimeStamp); numberOfTimesOnPage++; } } return(Tuple.Create(sumOfTimesOnPage, numberOfTimesOnPage)); }