/// <summary> /// Determines the next eform status based on current status, referring page, and destination page. /// The status may stay the same. /// </summary> /// <param name="status"></param> /// <param name="fromPage"></param> /// <param name="toPage"></param> /// <returns></returns> public static string GetNextStatus(string status, string fromPage, string toPage) { if (!status.Equals(EformStatusManager.Status_Approved)) // make sure eform has not already been approved { EformStatusType statusType = EformStatusManager.GetStatusType(status); EformPageType fromPageType = EformStatusManager.GetPageType(fromPage); EformPageType toPageType = EformStatusManager.GetPageType(toPage); EformStatusType nextType = GetNextStatusByToPage(statusType, fromPageType, toPageType); return(EformStatusManager.GetStatusString(nextType)); } else { return(""); } }
private static EformStatusType GetNextStatusByToPage(EformStatusType status, EformPageType fromPage, EformPageType toPage) { if (status == EformStatusType.None) { return(EformStatusType.DataEntryInProgress); } else if (status == EformStatusType.Approved) // maintain approved status { return(status); } switch (toPage) { case EformPageType.Edit: if (fromPage != EformPageType.None) { return(EformStatusType.DataEntryInProgress); } break; case EformPageType.Narrative: if (status == EformStatusType.DataEntryInProgress) { return(EformStatusType.DataEntryComplete); } break; case EformPageType.Approval: if (fromPage == EformPageType.Narrative && status < EformStatusType.Narrated) { return(EformStatusType.Narrated); } else if (status == EformStatusType.DataEntryInProgress) { return(EformStatusType.DataEntryComplete); } break; default: break; } return(status); // propagate current status }
public static string GetStatusString(EformStatusType status) { switch (status) { case EformStatusType.Approved: return("Approved"); case EformStatusType.DataEntryComplete: return("Data Entry Complete"); case EformStatusType.DataEntryInProgress: return("Data Entry In Progress"); case EformStatusType.Narrated: return("Narrated"); case EformStatusType.Printed: return("Printed"); default: return(""); } }