private void cmdPrint_Execute(object obj) { var InvoiceProduct = lstInvoiceDetails.FirstOrDefault(p => p.FinalStatus != 2); if (InvoiceProduct == null) { UIHelper.ShowErrorMessage("Returned Invoice!"); return; } Views.GenReports win = new Views.GenReports(InvoiceProduct.InvoiceNo, InvoiceProduct.InvoiceDate); win.ShowDialog(); }
private void cmdSave_Execute(object obj) { try { if (Mode == PageMode.Add || Mode == PageMode.Modify) { UpdateValues(); if (pxy.InsertUpdateInvoice(objInvoiceMaster, Global.UserID, Mode)) { UIHelper.ShowMessage("Data Saved Successfully"); objInvoiceMaster = new InvoiceMaster(); } } else if (Mode == PageMode.Delete) { if (pxy.DeleteInvoice(InvoiceNo)) { UIHelper.ShowMessage("Data Deleted Successfully"); objInvoiceMaster = new InvoiceMaster(); } } else if (Mode == PageMode.Browse) { var InvoiceProduct = objInvoiceMaster.lstInvoiceProduct.FirstOrDefault(p => p.Status != 2); if (InvoiceProduct == null) { UIHelper.ShowErrorMessage("Returned Invoice!"); return; } Views.GenReports win = new Views.GenReports(InvoiceNo, InvoiceProduct.InvoiceDate); win.ShowDialog(); } } catch (FaultException ex) { UIHelper.ShowErrorMessage(ex.Message); } }
private void cmdPrint_Execute(object obj) { if (obj is InvoiceDetailsService) { InvoiceDetailsService invoiceProduct = obj as InvoiceDetailsService; if (invoiceProduct == null || invoiceProduct.FinalStatus == 8) { UIHelper.ShowErrorMessage("Duplicate Invoice!"); return; } IMS.Views.GenReports win = new Views.GenReports(invoiceProduct.InvoiceNo, invoiceProduct.InvoiceDate); win.ShowDialog(); } else if (obj is ProductDetails) { ProductDetails invoiceProduct = obj as ProductDetails; if (invoiceProduct == null || invoiceProduct.Status == 8) { UIHelper.ShowErrorMessage("Duplicate Invoice!"); return; } IMS.Views.GenReports win = new Views.GenReports(invoiceProduct.InvoiceNo, invoiceProduct.InvoiceDate); win.ShowDialog(); } else if (obj is SettlementDetails) { SettlementDetails invoiceProduct = obj as SettlementDetails; if (invoiceProduct == null || invoiceProduct.Status == 8) { UIHelper.ShowErrorMessage("Duplicate Invoice!"); return; } IMS.Views.GenReports win = new Views.GenReports(invoiceProduct.InvoiceNo, invoiceProduct.InvoiceDate); win.ShowDialog(); } }