/// <summary author="James Heim" created="2019/01/24"> /// Attempts to call InsertSupplier from the SupplierAccessor. /// Returns the ID of the newly created Supplier or -1 if something /// goes wrong when an exception is not thrown. /// </summary> /// <updates> /// <update author="James Heim" date="2019/02/15"> /// Added proper validation. /// </update> /// </updates> /// <param name="supplierName">Human friendly name of the Supplier.</param> /// <param name="address">Address of the Supplier.</param> /// <param name="city">City the Supplier is based in.</param> /// <param name="state">State the Supplier is based in.</param> /// <param name="zip">Zip code of the Supplier.</param> /// <param name="country">Country the Supplier is based in.</param> /// <param name="contactFirstName">The first name of our contact for the Supplier.</param> /// <param name="contactLastName">The last name of our contact for the Supplier.</param> /// <param name="phoneNumber">The phone number of our contact for the Supplier.</param> /// <param name="email">The email of our contact for the Supplier.</param> /// <returns>The number of rows affected. -1 if something went wrong but an exception is not thrown.</returns> public void CreateSupplier(Supplier newSupplier) { newSupplier.Validate(); try { _supplierAccessor.InsertSupplier(newSupplier); } catch (Exception ex) { ExceptionLogManager.getInstance().LogException(ex); throw ex; } }