private void btnSalesVoucherExport_Click(object sender, RoutedEventArgs e) { if (!DateValidated(dpFromDateXML, dpToDateXML)) { var messageBoxResult = WpfMessageBox.Show(StatusMessages.AppTitle, "Please select FROM DATE grater than or equal to TO DATE", MessageBoxButton.OK, EnumUtility.MessageBoxImage.Warning); return; } CommonMethods commonMethods = new CommonMethods(); string path = string.Empty, firstLine = string.Empty; TallyXMLView tallyXMLView = new TallyXMLView(); List <ModeofPaymentReportModel> modeofPaymentReportModel = new List <ModeofPaymentReportModel>(); string fileName = LoginDetail.OutletName.Trim().ToString() + "_TallySalesVoucher_" + DateTime.Now.ToString("MM-dd-yyyy_HHmmss"); var saveFileDialog = new SaveFileDialog { FileName = fileName != "" ? fileName : "gpmfca-exportedDocument", DefaultExt = ".XML", Filter = "Common Seprated Documents (.XML)|*.XML" }; if (saveFileDialog.ShowDialog() == true) { path = saveFileDialog.FileName; tallyXMLView.GenerateSalesVoucher(dpFromDateXML.SelectedDate.Value.ToString(CommonMethods.DateFormat), dpToDateXML.SelectedDate.Value.ToString(CommonMethods.DateFormat), path); } }
private void btnGeneric_Click(object sender, RoutedEventArgs e) { if (ReportDetail.ReportName == "TallySalesVoucher") { CommonMethods commonMethods = new CommonMethods(); string path = string.Empty, firstLine = string.Empty; TallyXMLView tallyXMLView = new TallyXMLView(); List <ModeofPaymentReportModel> modeofPaymentReportModel = new List <ModeofPaymentReportModel>(); string fileName = LoginDetail.OutletName.Trim().ToString() + "_TallySalesVoucher_" + DateTime.Now.ToString("MM-dd-yyyy_HHmmss"); var saveFileDialog = new SaveFileDialog { FileName = fileName != "" ? fileName : "gpmfca-exportedDocument", DefaultExt = ".XML", Filter = "Common Seprated Documents (.XML)|*.XML" }; if (saveFileDialog.ShowDialog() == true) { path = saveFileDialog.FileName; tallyXMLView.GenerateSalesVoucher(ReportDetail.ReportFromDate, ReportDetail.ReportToDate, path); } } else if (ReportDetail.ReportName == "DetailedDaily") { DateTime dtFrom = new DateTime(); DateTime dtTo = new DateTime(); dtFrom = Convert.ToDateTime(ReportDetail.ReportFromDate); dtTo = Convert.ToDateTime(ReportDetail.ReportToDate); reportDetailedDailyView.Print(appSettings.GetPrinterName(), dtFrom.ToString("yyyy-MM-dd") + " 00:00:00", dtTo.ToString("yyyy-MM-dd") + " 23:59i:59"); } else if (ReportDetail.ReportName == "ProductwiseSales") { DateTime dtFrom = new DateTime(); DateTime dtTo = new DateTime(); dtFrom = Convert.ToDateTime(ReportDetail.ReportFromDate); dtTo = Convert.ToDateTime(ReportDetail.ReportToDate); reportProductWiseSalesView.Print(appSettings.GetPrinterName(), dtFrom.ToString("yyyy-MM-dd") + " 00:00:00", dtTo.ToString("yyyy-MM-dd") + " 23:59i:59"); } }