public override int Validate() { var v = (int)NWorkorderValidationError.Validated; if (Convert.ToInt32(_row["woType"]) == (int)NWorkorderType.Production) { DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); //Should Handling no item error here double sum = 0; if (tbl != null) { foreach (DataRow row in tbl.Rows) { sum += Convert.ToDouble(row["qiAmount"]); } } if (sum == 0) { v = (int)NWorkorderValidationError.ItemPriceSumEqualsToZero; } } return(v); }
public override int Validate() { var v = (int)NWorkorderValidationError.Validated; DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); //any item has a zero leadtie will cause the error int leadtime = 0; if (tbl != null) { foreach (DataRow row in tbl.Rows) { if (!Convert.IsDBNull(row["Leadtime"])) { leadtime = MyConvert.ConvertToInteger(row["Leadtime"]); if (leadtime == 0) { v = (int)NWorkorderValidationError.ItemLeadtimeRequired; break; } } } } return(v); }
public WorkOrderSelect(string woNumber) { _row = WorkorderShared.GetWorkorderInfo(woNumber); if (_row != null) { _woID = Convert.ToInt32(_row["woID"]); } }
private int GetIsInstallto() { int installToID = 0; DataRow row = WorkorderShared.GetWorkorderInfo(_woID); installToID = Convert.ToInt32(row["Company1"]); return(installToID); }
private bool GetChecklistApplicable() { bool b = false; if (_woID > 100) { DataRow row = WorkorderShared.GetWorkorderInfo(_woID); b = Convert.ToBoolean(row["ChecklistApplicable"]); } return(b); }
private void CopyItems() { DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); if (tbl == null) { return; } foreach (DataRow row in tbl.Rows) { int woItemID = Convert.ToInt32(row["woItemID"]); var wi = new WorkorderItemCopy(_woID, _newWoID, woItemID); wi.Copy(); } }
public bool isDeletable() { bool b = false; DataRow woTitleInfo = WorkorderShared.GetWorkorderInfo(_woID); if (woTitleInfo != null) { int woStatus = Convert.ToInt32(woTitleInfo["woStatus"]); if (woStatus == (int)NJobStatus.woNew | woStatus == (int)NJobStatus.woInvalid | woStatus == (int)NJobStatus.woObsolete) { b = true; } } return(b); }
private bool IsThisOrderRequireAddressAccordingToItem() { //55 Fabrication //80 Shipping //90 Pickup int[] NotRequiredItems = { 55, 80, 90 }; bool b = true; DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); if (tbl != null) { bool b1 = false; foreach (DataRow Row in tbl.Rows) { int requirement = Convert.ToInt32(Row["requirement"]); bool b2Contains = false; for (int i = 0; i <= NotRequiredItems.Length - 1; i++) { if (NotRequiredItems[i] == requirement) { b2Contains = true; break; // TODO: might not be correct. Was : Exit For } } if (!b2Contains) { b1 = true; //Exit For } } b = b1; } return(b); }
private bool isThereSpecialProcedure() { bool b = false; DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); if (tbl != null) { foreach (DataRow row in tbl.Rows) { int woItemID = Convert.ToInt32(row["woItemID"]); if (isThereSpecialProcedureOfThisWoIte(woItemID)) { b = true; break; // TODO: might not be correct. Was : Exit For } } } return(b); }
private int GetMaxPrintOrderOfItems() { int maxValue = 0; DataTable children = WorkorderShared.getExistingWorkorderItems(_woID); if (children == null) { return(maxValue); } foreach (DataRow row in children.Rows) { int i = Convert.ToInt32(row["woPrintOrder"]); if (i > maxValue) { maxValue = i; } } return(maxValue); }
private bool IsThisRequirementExist(int requirement) { bool b = false; DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); if (tbl != null) { foreach (DataRow row in tbl.Rows) { if (requirement == Convert.ToInt32(row["requirement"])) { b = true; break; // TODO: might not be correct. Was : Exit For } } } return(b); }
public void delete() { DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); if (tbl != null) { foreach (DataRow row in tbl.Rows) { var wi = new WorkorderItemDelete(Convert.ToInt32(row["woItemID"])); wi.Delete(); } } ReleaseRegisteredWorkorderNumber(); var wda = new WorkorderDeleteAccessary(_woID); wda.Delete(); DeleteWorkorderTitle(); }
public override int Validate() { var v = (int)NWorkorderValidationError.Validated; DataTable tbl = WorkorderShared.getExistingWorkorderItems(_woID); //Should Handling no item error here if (tbl != null) { foreach (DataRow row in tbl.Rows) { string itemName = Convert.ToString(row["estItemNameText"]); if (itemName == "New Item") { v = (int)NWorkorderValidationError.ItemNameRequired; break; // } } } return(v); }
public WorkorderValidationItem(int woID, int itemValidationNo) { _row = WorkorderShared.GetWorkorderInfo(woID); _woID = woID; _itemValidationNo = itemValidationNo; }
public WorkOrderSelect(int woID) { _woID = woID; _row = WorkorderShared.GetWorkorderInfo(_woID); }
public WorkorderChangeType(int woID, int woType) { _woID = woID; _woType = woType; _itemTbl = WorkorderShared.getExistingWorkorderItems(woID); }
public WorkorderValidationItem(int woID) { _row = WorkorderShared.GetWorkorderInfo(woID); _woID = woID; }