private void cmdUpdate_Execute(object obj) { System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show("Do you want to Update it", "Confirmation", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Question, System.Windows.MessageBoxResult.No); if (result == System.Windows.MessageBoxResult.Yes) { try { if (obj is InvoiceDetailsService) { InvoiceDetailsService invoiceDetails = obj as InvoiceDetailsService; if (pxyInvoice.UpdateInvoiceDetails(invoiceDetails, objCustomerDetails, Global.UserID)) { selectedInvoiceDetails = invoiceDetails; UIHelper.ShowMessage("Data successfully updated!"); } } else if (obj is ProductDetails) { ProductDetails invoiceProduct = obj as ProductDetails; if (pxyInvoice.UpdateInvoiceProduct(invoiceProduct, Global.UserID)) { selectedProductDetails = invoiceProduct; UIHelper.ShowMessage("Data successfully updated!"); } } else if (obj is SettlementDetails) { SettlementDetails invoiceSettlement = obj as SettlementDetails; if (pxyInvoice.UpdateInvoiceSettlement(invoiceSettlement, Global.UserID)) { UIHelper.ShowMessage("Data successfully updated!"); } } } catch (FaultException ex) { UIHelper.ShowErrorMessage(ex.Message); } } }