private void OpenInvoice(SalesInvoiceInfo invoiceInfo) { SalesInvoice salesInvoice = new SalesInvoice(_parentWindow, invoiceInfo); pageTransitionControl.TransitionType = PageTransitionType.Slide; pageTransitionControl.ShowPage(salesInvoice); }
public SalesInvoice(Window parentWindow, SalesInvoiceInfo invoiceInfo) { _parentWindow = parentWindow; itemInfoList = new List <SalesItemInfo>(); itemList = new List <SalesItemBind>(); InitializeComponent(); uomList = BLL.CommonBLL.GetUnitOfMeasure(); comboUoM.ItemsSource = uomList; comboUoM.DisplayMemberPath = "UnitOfMeasure"; comboUoM.SelectedValuePath = "UnitOfMeasure"; if (invoiceInfo == null) { GetNextInvoiceInfo(); } else { _invoiceInfo = invoiceInfo; txtInvoiceNum.Text = _invoiceInfo.SalesID.ToString(); int itemNum = 0; itemInfoList = invoiceInfo.SalesItemList.ToList(); foreach (SalesItemInfo itemInfo in invoiceInfo.SalesItemList) { itemNum++; SalesItemBind itemBindInfo = new SalesItemBind(); itemBindInfo.ItemNum = itemNum; itemBindInfo.ItemInfo.ProductID = itemInfo.ProductID; itemBindInfo.DisplayProductName = itemInfo.ProductName + " - " + itemInfo.VendorName; itemBindInfo.ItemInfo.DiscountRate = itemInfo.DiscountRate; itemBindInfo.ItemInfo.Qty = itemInfo.Qty; itemBindInfo.ItemInfo.RetailRate = itemInfo.RetailRate; itemBindInfo.ItemInfo.Unit = itemInfo.Unit; if (itemInfo.DiscountRate > 0) { itemBindInfo.ItemInfo.Amount = itemInfo.Qty * itemInfo.DiscountRate; } else { itemBindInfo.ItemInfo.Amount = itemInfo.Qty * itemInfo.RetailRate; } itemList.Add(itemBindInfo); } datagridProduct.ItemsSource = null; datagridProduct.ItemsSource = itemList; SetTotalAmount(); } _companyInfo = BLL.CommonBLL.GetCompanyInfo(); AddHotKeys(); }
private void datagridHoldInvoice_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid dataGrid = sender as DataGrid; if (e.AddedItems != null && e.AddedItems.Count > 0) { SalesInvoiceInfo itemBindInfo = this.datagridHoldInvoice.SelectedValue as SalesInvoiceInfo; // find row for the first selected item if (itemBindInfo != null) { _delegateInvoiceOpen.DynamicInvoke(itemBindInfo); } } }
public static Int32 InsertOrUpdateSalesInfo(SalesInvoiceInfo salesInvoiceInfo) { SalesServiceClient service = new SalesServiceClient(); return(service.InsertOrUpdateSalesInfo(salesInvoiceInfo)); }