private PromotionResult PromoteToCreated() { var promotionResult = new PromotionResult(); promotionResult.Success = true; if (WorkOrderStatus != WorkOrderStatus.Creating) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Created status because its current status prevented it."; } else if (String.IsNullOrWhiteSpace(TargetDateTime.ToString()) || String.IsNullOrWhiteSpace(DropDeadDateTime.ToString()) || String.IsNullOrWhiteSpace(Description)) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Created status because it requires a Target Date, Drop Dead Date, and Description."; } if (promotionResult.Success) { WorkOrderStatus = WorkOrderStatus.Created; promotionResult.Message = $"Work order {WorkOrderId} successfully promoted to status {WorkOrderStatus}."; } return(promotionResult); }
private PromotionResult PromoteToCreated() { PromotionResult promotionResult = new PromotionResult(); promotionResult.Success = true; if (WorkOrderStatus != WorkOrderStatus.Creating) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Created status because its current status prevented it."; } else if (String.IsNullOrWhiteSpace(TargetDateTime.ToString()) || String.IsNullOrWhiteSpace(DropDeadDateTime.ToString()) || String.IsNullOrWhiteSpace(Description)) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Created status because it required a Target Date, Drop Dead Date and a Description."; } if (promotionResult.Success) { WorkOrderStatus = WorkOrderStatus.Created; promotionResult.Message = String.Format("Work Order {0} successfully promortedto status {1}", WorkOrderId, WorkOrderStatus); } Log4NetHelper.Log(promotionResult.Message, LogLevel.INFO, EntityFormalNamePlural, WorkOrderId, HttpContext.Current.User.Identity.Name, null); return(promotionResult); }