private PromotionResult PromoteToCertified() { PromotionResult promotionResult = new PromotionResult(); promotionResult.Success = true; if (WorkOrderStatus != WorkOrderStatus.Certifying) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Certified status because its current status prevented it."; } if (String.IsNullOrWhiteSpace(CertificationRequirements)) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Certified status because Certification Requirements were not present."; } else if (Parts.Count == 0 || Labors.Count == 0) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Certified status because it did not contain at least one Part and labor."; } else if (Parts.Count(p => p.IsInstalled == false) > 0 || Labors.Count(l => l.PercentComplete < 100) > 0) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Certified status because not all Parts have been installed and ..."; } if (promotionResult.Success) { WorkOrderStatus = WorkOrderStatus.Certified; promotionResult.Message = String.Format("Work order {0} successfuly promoted to status {1}.", WorkOrderId, WorkOrderStatus); } return(promotionResult); }
public NameParts(string name) { Parts = name.Split(' ').ToList(); if (Parts.Count() > MaxNumberOfPartsInFullName) { Parts = Parts.Take(MaxNumberOfPartsInFullName).ToList(); } }
private PromotionResult PartsInstalledLaborCompleteTest(PromotionResult promotionResult) { if (Parts.Count(p => p.IsInstalled == false) > 0 || Labors.Count(l => l.PercentComplete < 100) > 0) { promotionResult.Success = false; promotionResult.Message = "Failed to promote the work order to Created status because not all parts have been installed or labors been completed."; } return(promotionResult); }
public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped) { if (!equipped) { list.Add( "{0} [{1:#,0}]".WrapUOHtmlColor(EquipmentSets.CMOptions.SetNameColorRaw), Name.ToUpperWords(), Parts.Count(p => p.Valid)); } else { list.Add( "{0} [{1:#,0} / {2:#,0}]".WrapUOHtmlColor(EquipmentSets.CMOptions.SetNameColorRaw), Name.ToUpperWords(), GetEquippedParts(viewer).Length, Parts.Count(p => p.Valid)); } }
public bool EqualsTo(IPath path) { var parts = path.Parts.ToArray(); if (parts.Length != Parts.Count()) { return(false); } for (int i = 0; i < parts.Length; i++) { var origin = Parts.ElementAt(i); var part = parts[i]; if (part.PlainText.Equals(origin.PlainText) == false) { return(false); } } return(true); }
private PromotionResult PromoteToCertified() { PromotionResult promotion = new PromotionResult(); promotion.Success = true; if (WorkOrderStatus != WorkOrderStatus.Certifying) { promotion.Success = false; promotion.Message = ""; } if (string.IsNullOrWhiteSpace(CertificationRequirements)) { promotion.Success = false; promotion.Message = ""; } else if (Parts.Count == 0 || Labors.Count == 0) { promotion.Success = false; promotion.Message = "Failed to promote the work order to Certified status because it did not contain at least one part and at least one labor item."; } else if (Parts.Count(p => p.IsInstalled == false) > 0 || Labors.Count(l => l.PercentComplete < 100) > 0) { promotion.Success = false; promotion.Message = "Failed to promote the work order to Certified status because not all parts have been installed and labor completed."; } if (promotion.Success) { WorkOrderStatus = WorkOrderStatus.Certified; promotion.Message = $"Work order {WorkOrderId} successfully promoted to status {WorkOrderStatus}"; } return(promotion); }
public bool HasOverlappingParts(bool includeExactRangeMatches) { //for each index in the word for (int i = 0; i < ProblemValue.Length; i++) { if (includeExactRangeMatches) { if (Parts.Count(p => p.Includes(i)) > 1) //if 2+ parts include this cell then we have overlapping parts { return(true); } } else { if (Parts.Distinct().Count(p => p.Includes(i)) > 1) //if 2+ parts include this cell then we have overlapping parts { return(true); } } } return(false); }
public bool AtLeastMinLength() { return(Parts.Count() >= _minLength); }