bool Deliver(StorageReference.Order order) { try { string directory = @"C:\Logs"; FileStream stream = new FileStream(Path.Combine(directory, order.PoductName + ".xml"), FileMode.Create); XmlSerializer xml = new XmlSerializer(typeof(StorageReference.Order)); xml.Serialize(stream, order); stream.Close(); return(true); } catch (Exception e) { TestConnect(e.Message); return(false); } }
public void TakeGoods(int id) { //заглушка обращения к складу, который по идее может одать композитный тип, в котором есть ID, Name, Cost(пока равен нулю), IsDelivered(false) using (StorageReference.StorageClient storage = new StorageReference.StorageClient()) { StorageReference.Order order = storage.GetDispatchedProducts(id); if (!(order is null)) { using (AccounterReference.AccountantClient account = new AccounterReference.AccountantClient()) { order.Price = account.GetPrice(order.ProductID, order.Quantity); account.LogResult(order.PoductName, order.Quantity, Deliver(order)); } } } }