public void PartEdited(GridOrderDetail edited) { GridOrderDetails.Add(edited); PartNum = null; PriceListPart = null; Reference = "0"; Quantity = 1; TotalLineas = GridOrderDetails.Sum(god => god.Value); }
public void RestoreDetail() { GridOrderDetails.Add(backupdetail); PartNum = null; PriceListPart = null; Reference = "0"; Quantity = 1; TotalLineas = GridOrderDetails.Sum(god => god.Value); }
async void AddProductToOrder() { if (PriceListPart == null) { await dialogService.ShowMessage( "Error", "Debe ingresar una parte."); return; } if (Quantity <= 0) { await dialogService.ShowMessage( "Error", "Debe ingresar una cantidad mayor a cero."); return; } if (Reference == string.Empty || Reference == null) { Reference = "0"; } GridOrderDetails.Add(new GridOrderDetail { BasePrice = PriceListPart.BasePrice, PartDescription = PriceListPart.PartDescription, PartNum = PriceListPart.PartNum, PartId = PriceListPart.PartId, PriceListPartId = PriceListPart.PriceListPartId, Reference = Reference, Quantity = Quantity, }); PartNum = null; PriceListPart = null; Quantity = 1; Reference = "0"; TotalLineas = GridOrderDetails.Sum(god => god.Value); }
public void DeleteOrderReceipt(OrderHeader OrderToDelete) { //Encabezado SalesOrderHeaderId = OrderToDelete.SalesOrderHeaderId; SalesOrderHeaderInterId = OrderToDelete.SalesOrderHeaderInterId; OrderNum = OrderToDelete.OrderNum; SincronizadoEpicor = OrderToDelete.SincronizadoEpicor; IsSync = OrderToDelete.IsSync; NeedBy = OrderToDelete.NeedByDate; Observations = OrderToDelete.Observations; //Cargo cliente Customer = OrderToDelete.Customer; //Cargo shipto this.ShipTo = dataService .Find <ShipTo>(OrderToDelete.ShipToId, false); //Cargo detalle var editdetaillist = OrderToDelete.OrderDetails; foreach (var item in editdetaillist) { GridOrderDetails.Add(new GridOrderDetail { SalesOrderDetaliId = item.SalesOrderDetaliId, BasePrice = item.UnitPrice, PartDescription = item.PartNum, PartNum = item.PartNum, PartId = item.PartId, PriceListPartId = item.PriceListPartId, Quantity = item.OrderQty, Reference = item.Reference, }); } //Calculo total TotalLineas = GridOrderDetails.Sum(god => god.Value); }
async void AddProductToOrder() { if (PriceListPart == null) { await dialogService.ShowMessage( "Error", "Debe ingresar un producto."); return; } if (Quantity <= 0) { await dialogService.ShowMessage( "Error", "Debe ingresar una cantidad mayor a cero."); return; } GridOrderDetails.Add(new GridOrderDetail { BasePrice = PriceListPart.BasePrice, Discount = Discount / 100, PartDescription = PriceListPart.PartDescription, PartNum = PriceListPart.PartNum, PartId = PriceListPart.PartId, PriceListPartId = PriceListPart.PriceListPartId, Quantity = Quantity, }); PartNum = null; PriceListPart = null; Quantity = 1; Discount = 0; Total = GridOrderDetails.Sum(god => god.Value); }
public void EditOrderReceipt(OrderHeader OrderToEdit) { //Encabezado SalesOrderHeaderId = OrderToEdit.SalesOrderHeaderId; SalesOrderHeaderInterId = OrderToEdit.SalesOrderHeaderInterId; OrderNum = OrderToEdit.OrderNum; SincronizadoEpicor = OrderToEdit.SincronizadoEpicor; IsSync = OrderToEdit.IsSync; NeedBy = OrderToEdit.NeedByDate; Date = OrderToEdit.Date; Observations = OrderToEdit.Observations; //Cargo cliente Customer = OrderToEdit.Customer; //Cargo shipto this.ShipTo = dataService .Find <ShipTo>(OrderToEdit.ShipToId, false); //Cargo detalle var editdetaillist = OrderToEdit.OrderDetails; foreach (var item in editdetaillist) { GridOrderDetails.Add(new GridOrderDetail { SalesOrderDetaliId = item.SalesOrderDetaliId, BasePrice = item.UnitPrice, PartDescription = item.PartNum, PartNum = item.PartNum, PartId = item.PartId, PriceListPartId = item.PriceListPartId, Quantity = item.OrderQty, Reference = item.Reference, }); } //try //{ // var DetailTemp = OrderToEdit.OrderDetails; // dataService.Delete(DetailTemp); //} //catch (Exception) //{ // throw; //} //Detalle Temporal //int i = 0; //foreach (var detail in OrderToEdit.OrderDetails) //{ // var orderDetail = new OrderDetail // { // OrderLine = ++i, // SalesOrderDetaliId = detail.SalesOrderDetaliId, // SalesOrderHeaderId = OrderToEdit.SalesOrderHeaderId, // PriceListPartId = detail.PriceListPartId, // PartId = detail.PartId, // OrderQty = detail.OrderQty, // Reference = detail.Reference, // PartNum = detail.PartNum, // UnitPrice = detail.UnitPrice, // }; //Cargo lista de precios LoadPriceLists(); PartNum = null; PriceListPart = null; Quantity = 1; TotalLineas = GridOrderDetails.Sum(god => god.Value); }