private PromotionResult DemoteToCreated() { PromotionResult promotionResult = new PromotionResult(); promotionResult.Success = true; if (applicationFormStatus != ApplicationFormStatus.Approving) { promotionResult.Success = false; promotionResult.Message = "Failed to demote the work order to Created status because its current status prevented it."; } //if (String.IsNullOrWhiteSpace(ReworkNotes)) //{ // promotionResult.Success = false; // promotionResult.Message = "Failed to demote the work order to Created status because Rework Notes must be present."; //} if (promotionResult.Success) { applicationFormStatus = ApplicationFormStatus.Created; promotionResult.Message = String.Format("Work order {0} successfully demoted to status {1}.", Id, applicationFormStatus); } return(promotionResult); }
private PromotionResult PromoteToApproving() { if (applicationFormStatus == ApplicationFormStatus.Processed) { applicationFormStatus = ApplicationFormStatus.Approving; } PromotionResult promotionResult = new PromotionResult(); promotionResult.Success = applicationFormStatus == ApplicationFormStatus.Approving; if (promotionResult.Success) { promotionResult.Message = String.Format("Work order {0} successfully claimed by {1} and promoted to status {2}.", Id, HttpContext.Current.User.Identity.Name, applicationFormStatus); } else { promotionResult.Message = "Failed to promote the work order to Approving status because its current status prevented it."; } return(promotionResult); }
private PromotionResult DemoteToCanceled() { PromotionResult promotionResult = new PromotionResult(); promotionResult.Success = true; if (applicationFormStatus != ApplicationFormStatus.Approving) { promotionResult.Success = false; promotionResult.Message = "Failed to demote the work order to Canceled status because its current status prevented it."; } if (promotionResult.Success) { applicationFormStatus = ApplicationFormStatus.Canceled; promotionResult.Message = String.Format("Work order {0} successfully demoted to status {1}.", Id, applicationFormStatus); } return(promotionResult); }