///<summary> ///</summary> public SupplierDocFileControl(Supplier supplier, SupplierDocument doc) { _currentDocument = doc; _currentSupplier = supplier; InitializeComponent(); UpdateInformation(); }
private void LogSupplier(SupplierDocument supplierDocument) { var url = $"{Properties.Settings.Default.ServerAddress}/api/resource/Sage 50 Export Log"; var resource = new Resource(url); resource.LogSupplier(supplierDocument); }
public virtual int _GetUniqueIdentifier() { var hashCode = 399326290; hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (SupplierDocument?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (InvestorDocument?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (AdminDocument?.GetHashCode() ?? 0); return(hashCode); }
private Vendor CreateNewSupplier(SupplierDocument supplierDocument) { var supplier = Company.Factories.VendorFactory.Create(); if (supplierDocument != null && supplier != null) { try { supplier.ID = supplierDocument.VendorId; supplier.Email = supplierDocument.VendorEmail; supplier.Name = supplierDocument.SupplierName; supplier.WebSiteURL = supplierDocument.Website; supplier.IsInactive = supplierDocument.Disabled == 1; // AddAddresses(supplier, supplierDocument); // AddContacts(supplier, supplierDocument); supplier.Save(); Logger.Information("Supplier - {SupplierName} saved successfully", supplierDocument.SupplierName); } catch (Sage.Peachtree.API.Exceptions.ValidationException e) { Logger.Debug("Validation failed."); Logger.Debug(e.Message); Logger.Debug("{@Name} will be sent back to the queue", supplierDocument.Name); supplier = null; } catch (Sage.Peachtree.API.Exceptions.RecordInUseException) { supplier = null; Logger.Debug("Record is in use. {@Name} will be sent back to the queue", supplierDocument.Name); } catch (Exception e) { supplier = null; Logger.Debug(e, e.Message); Logger.Debug("{@E}", e); } } if (supplier == null) { Logger.Debug("Supplier data was null when trying to create Sage customer"); } return(supplier); }
public IRestResponse LogSupplier(SupplierDocument supplierDocument) { var log = new Log { document_name = supplierDocument.Name, export_date = DateTime.Now.ToString("yyyy-MM-dd"), document_date = DateTime.Now.ToString("yyyy-MM-dd"), document_type = supplierDocument.Doctype }; var request = new RestRequest(Method.POST); request.AddJsonBody(log); var response = _restClient.Execute(request); return(response); }
public void SmartCoreFileTest_SupplierDocument() { var enviroment = GetEnviroment(); var supplierDocument = new SupplierDocument { AttachedFile = new AttachedFile { FileName = "AttachedFile.test" }, }; enviroment.NewKeeper.Save(supplierDocument); Assert.IsTrue(supplierDocument.ItemId > 0, "ItemId должен быть больше 0"); var forCheck = enviroment.NewLoader.GetObject <SupplierDocumentDTO, SupplierDocument>(new Filter("ItemId", supplierDocument.ItemId), true); enviroment.NewKeeper.Delete(supplierDocument); Assert.IsTrue(forCheck != null, "значение не должно быть null"); Assert.AreEqual(forCheck.Files.Count, 1, "Кол-во файлов должно быть 1"); Assert.IsTrue(forCheck.AttachedFile != null); Assert.AreEqual(forCheck.AttachedFile.FileName, "AttachedFile.test"); }