public NavOrder(Order o) { No = o.No; CustomerNo = o.Klient; IsDelivered = o.Potwierdzenie_dostawy; OrderDate = o.Data_zamówienia; OrderDeliveryDate = o.Data_dostarczenia; TotalCost = o.Kwota_do_zapłaty; }
public NavOrder AddOrder(NavOrder order) { try { Order o = new Order() { No = order.No, NoSpecified = true, Klient = order.CustomerNo, KlientSpecified = true, Kwota_do_zapłaty = order.TotalCost, Kwota_do_zapłatySpecified = true, Potwierdzenie_dostawy = order.IsDelivered, Potwierdzenie_dostawySpecified = true, Data_zamówienia = DateTime.Now, Data_zamówieniaSpecified = true }; _order_service.Create(ref o); foreach (NavOrderItem item in order.OrderItems) { OrderedItems oi = new OrderedItems() { Ilość = item.Count, Towar = item.ProductNo, Cena_zakupu = item.PurchasePrice, Koszt = item.Cost, Zamówienie = item.OrderNo, IlośćSpecified = true, TowarSpecified = true, ZamówienieSpecified = true, Cena_zakupuSpecified = true, KosztSpecified = true }; _orderItems_service.Create(ref oi); } return order; } catch { return null; } }
/// <remarks/> public void UpdateMultipleAsync(Order[] Order_List, object userState) { if ((this.UpdateMultipleOperationCompleted == null)) { this.UpdateMultipleOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateMultipleOperationCompleted); } this.InvokeAsync("UpdateMultiple", new object[] { Order_List}, this.UpdateMultipleOperationCompleted, userState); }
/// <remarks/> public void UpdateMultipleAsync(Order[] Order_List) { this.UpdateMultipleAsync(Order_List, null); }
/// <remarks/> public void UpdateAsync(Order Order) { this.UpdateAsync(Order, null); }
public void Update(ref Order Order) { object[] results = this.Invoke("Update", new object[] { Order}); Order = ((Order)(results[0])); }
/// <remarks/> public void CreateMultipleAsync(Order[] Order_List) { this.CreateMultipleAsync(Order_List, null); }
/// <remarks/> public void CreateAsync(Order Order, object userState) { if ((this.CreateOperationCompleted == null)) { this.CreateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOperationCompleted); } this.InvokeAsync("Create", new object[] { Order}, this.CreateOperationCompleted, userState); }
/// <remarks/> public void CreateAsync(Order Order) { this.CreateAsync(Order, null); }
public bool EditOrder(NavOrder order) { try { foreach(NavOrderItem noi in order.OrderItems) { _orderItems_service.Delete(noi.Key); } Order o = new Order() { No = order.No, Data_dostarczenia = order.OrderDeliveryDate, Data_zamówienia = order.OrderDate, Klient = order.CustomerNo, Kwota_do_zapłaty = order.TotalCost, Potwierdzenie_dostawy = order.IsDelivered }; _order_service.Update(ref o); foreach (NavOrderItem item in order.OrderItems) { OrderedItems oi = new OrderedItems() { Cena_zakupu = item.PurchasePrice, Ilość = item.Count, Koszt = item.Cost, Towar = item.ProductNo, Zamówienie = item.OrderNo, Key = item.Key }; _orderItems_service.Create(ref oi); } return true; } catch { return false; } }
public bool ConfirmOrderDelivery(NavOrder order) { try { Order o = new Order() { No = order.No, NoSpecified = true, Data_dostarczenia = order.OrderDeliveryDate, Data_zamówienia = order.OrderDate, Klient = order.CustomerNo, Kwota_do_zapłaty = order.TotalCost, Potwierdzenie_dostawy = order.IsDelivered, Potwierdzenie_dostawySpecified = true }; _order_service.Update(ref o); return true; } catch { throw; } }