public static String GetDescription(this ServiceVisitStatus status) { FieldInfo field = status.GetType().GetField(status.ToString()); DescriptionAttribute attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute; return(attribute == null?status.ToString() : attribute.Description); }
public void SelectStatus(ServiceVisitStatus selectedStatus) { foreach (ServiceVisitFilterStatusViewModel viewModel in this.Status) { if (viewModel.Status.Equals(selectedStatus)) { viewModel.IsSelected = true; } else { viewModel.IsSelected = false; } } }
public static String GetColor(this ServiceVisitStatus status) { switch (status) { //ready and scheduled - orange shade case ServiceVisitStatus.Ready : return("#f8cb64"); case ServiceVisitStatus.Scheduled : return("#FFA500"); case ServiceVisitStatus.InProgress : return("#FF7F50"); //not ready - grey shade case ServiceVisitStatus.NotReady : return("#778899"); case ServiceVisitStatus.Completed : return("#808080"); //revisit or pending - red shade case ServiceVisitStatus.RevisitRequired : return("#FF0000"); case ServiceVisitStatus.Vacant : return("#DC143C"); case ServiceVisitStatus.PendingExternal : return("#B22222"); //blue - in reviews case ServiceVisitStatus.AccessReview : return("#009ACD"); case ServiceVisitStatus.FieldReview : return("#0EBFE9"); case ServiceVisitStatus.OfficeReview : return("#4F94CD"); // default - blue default : return("#578fbe"); } }
// Update the selected status public void SelectStatus(ServiceVisitStatus status) { this.SelectedStatus = status; }
public ServiceVisitFilterListStatusViewModel(ServiceVisitStatus selectedStatus) { this.SelectedStatus = selectedStatus; InitializeComponent(); }