public int validateRmContainer(string rawMaterialId, string purchaseOrder, string heat) { var doc = new LT_RM_CONTAINER(); var isValid = doc.Count(where : "WHERE HEAT=:0 AND PURCHASE_ORDER=:1 AND RAW_MTRL_ID=:2", args: new object[] { heat, purchaseOrder, rawMaterialId }); if (isValid == 0) { log.Error("Could not find target heat: (rawMtrlId: " + rawMaterialId + ", purchaseOrderId: " + purchaseOrder + ", heat: " + heat + ") was found in the DB: " + ConstantsEnums.connectionStringName); throw new Exception("The information you entered was not found in as a single record on LT_RM_CONTAINER."); } else { log.Info("Validated RM Container Data: (rawMtrlId: " + rawMaterialId + ", purchaseOrderId: " + purchaseOrder + ", heat: " + heat + ") was found in the DB: " + ConstantsEnums.connectionStringName); } return(isValid); }
/// <summary> /// Validate a raw material heat /// </summary> /// <returns>string - heat</returns> public string validateHeat() { string _heat = promptForRename("Must provide a Heat to proceed."); //Validate that the receiver is in Visual before proceeding. var doc = new LT_RM_CONTAINER(); var isValid = doc.Count(where : "WHERE HEAT=:0", args: _heat); if (isValid != 1) { log.Error("Could not find target heat: (" + targetRenamed + ") in the DB: " + ConstantsEnums.connectionStringName); throw new Exception("The Heat you entered is not found in Raw Material Maintenance."); } else { log.Info("target file: (" + targetRenamed + ") was found in the DB: " + ConstantsEnums.connectionStringName); } return(_heat); }