public DataSetInvoice GetInvoiceDailySalesBusinessName(string query, string businessName, DateTime today) { DataSetInvoice invoice2; SqlCommand command = new SqlCommand(query) { CommandType = CommandType.StoredProcedure }; using (SqlConnection connection = new SqlConnection(this.connString)) { using (SqlDataAdapter adapter = new SqlDataAdapter()) { command.Connection = connection; adapter.SelectCommand = command; command.Parameters.AddWithValue("@businessName", businessName); command.Parameters.AddWithValue("@today", today); using (DataSetInvoice invoice = new DataSetInvoice()) { adapter.Fill(invoice, "tbl_sales_details"); invoice2 = invoice; } } } return(invoice2); }
protected void btnGetReportsByTaxRatesBetweenDates_Click(object sender, EventArgs e) { this.ReportViewerTaxRateWise.ProcessingMode = ProcessingMode.Local; this.ReportViewerTaxRateWise.LocalReport.ReportPath = base.Server.MapPath("~/Reports/rpt_GetAllTaxesTaxRateWise.rdlc"); try { DataSetInvoice invoice = BusinessReport.GetInvoiceDatesAllByTaxRate("usp_GetAllTaxesGroupByTaxRates", DateTime.Parse(this.txtFromDate.Text.ToString()), DateTime.Parse(this.txtToDate.Text.ToString())); if (invoice.Tables[1].Rows.Count > 0) { ReportDataSource item = new ReportDataSource("DataSetInvoice", invoice.Tables[1]); this.ReportViewerTaxRateWise.LocalReport.DataSources.Clear(); this.ReportViewerTaxRateWise.LocalReport.DataSources.Add(item); } else { ReportDataSource item = new ReportDataSource("DataSetInvoice", invoice.Tables[1]); this.ReportViewerTaxRateWise.LocalReport.DataSources.Clear(); this.ReportViewerTaxRateWise.LocalReport.DataSources.Add(item); this.alertDanger.Visible = true; this.lblDanger.Text = "No Report Content!"; } } catch (Exception exception) { this.lblDanger.Text = exception.Message; } }
public static DataSetInvoice GetInvoiceDatesAllByTaxRate(string query, DateTime fromDate, DateTime toDate) { DataSetInvoice invoice2; SqlCommand command = new SqlCommand(query) { CommandType = CommandType.StoredProcedure }; using (SqlConnection connection = new SqlConnection(connStaticString)) { using (SqlDataAdapter adapter = new SqlDataAdapter()) { command.Connection = connection; adapter.SelectCommand = command; command.Parameters.AddWithValue("@fromDate", DateTime.Parse(fromDate.ToString("yyyy-MM-dd"))); command.Parameters.AddWithValue("@toDate", DateTime.Parse(toDate.ToString("yyyy-MM-dd"))); using (DataSetInvoice invoice = new DataSetInvoice()) { adapter.Fill(invoice, "tbl_GetAllTaxesTaxRateWise"); invoice2 = invoice; } } } return(invoice2); }
private DataSetInvoice GetInvoiceByDatesBusinessName(string query, string businessName, DateTime fromDate, DateTime toDate) { DataSetInvoice invoice2; SqlCommand command = new SqlCommand(query) { CommandType = CommandType.StoredProcedure }; using (SqlConnection connection = new SqlConnection(this.connString)) { using (SqlDataAdapter adapter = new SqlDataAdapter()) { command.Connection = connection; adapter.SelectCommand = command; command.Parameters.AddWithValue("@businessName", businessName); command.Parameters.AddWithValue("@fromDate", DateTime.Parse(fromDate.ToString("yyyy-MM-dd"))); command.Parameters.AddWithValue("@toDate", DateTime.Parse(toDate.ToString("yyyy-MM-dd"))); using (DataSetInvoice invoice = new DataSetInvoice()) { adapter.Fill(invoice, "tbl_GetAllTaxesWithTaxRatesofaBusiness"); invoice2 = invoice; } } } return(invoice2); }
public static DataSetInvoice GetInvoiceDatesAllBusinesses(string query) { DataSetInvoice invoice2; SqlCommand command = new SqlCommand(query) { CommandType = CommandType.StoredProcedure }; using (SqlConnection connection = new SqlConnection(connStaticString)) { using (SqlDataAdapter adapter = new SqlDataAdapter()) { command.Connection = connection; adapter.SelectCommand = command; using (DataSetInvoice invoice = new DataSetInvoice()) { adapter.Fill(invoice, "tbl_GetAllTaxesWithTaxRatesofaBusiness"); invoice2 = invoice; } } } return(invoice2); }
private DataSetInvoice GetInvoiceByBusiness(string query, string businessName) { DataSetInvoice invoice2; SqlCommand command = new SqlCommand(query) { CommandType = CommandType.StoredProcedure }; using (SqlConnection connection = new SqlConnection(this.connString)) { using (SqlDataAdapter adapter = new SqlDataAdapter()) { command.Connection = connection; adapter.SelectCommand = command; command.Parameters.AddWithValue("@businessName", businessName); using (DataSetInvoice invoice = new DataSetInvoice()) { adapter.Fill(invoice, "tbl_invoice_by_business_code"); invoice2 = invoice; } } } return(invoice2); }
protected void btnBusinessName_Click(object sender, EventArgs e) { Thread thread1 = new Thread(() => { if (this.chkBusinessName.Checked && !this.chkDates.Checked) { this.chkBusinessName.Checked = false; this.ReportViewerInvoice.ProcessingMode = ProcessingMode.Local; this.ReportViewerInvoice.LocalReport.ReportPath = base.Server.MapPath("~/Reports/rpt_GetAllTaxesWithTaxRatesofaBusiness.rdlc"); DataSetInvoice invoiceByBusinessName = this.GetInvoiceByBusinessName("usp_GetAllTaxesWithTaxRatesofaBusinessByName", this.txtBusinessName.Text.ToString()); if (invoiceByBusinessName.Tables[0].Rows.Count > 0) { ReportDataSource item = new ReportDataSource("DataSetInvoice", invoiceByBusinessName.Tables[0]); this.ReportViewerInvoice.LocalReport.DataSources.Clear(); this.ReportViewerInvoice.LocalReport.DataSources.Add(item); } else { this.alertDanger.Visible = true; this.lblDanger.Text = "No Report Content!"; ReportDataSource item = new ReportDataSource("DataSetInvoice", invoiceByBusinessName.Tables[0]); this.ReportViewerInvoice.LocalReport.DataSources.Clear(); this.ReportViewerInvoice.LocalReport.DataSources.Add(item); } } else if (this.chkBusinessCode.Checked) { this.chkBusinessCode.Checked = false; this.ReportViewerInvoice.ProcessingMode = ProcessingMode.Local; this.ReportViewerInvoice.LocalReport.ReportPath = base.Server.MapPath("~/Reports/rpt_GetAllTaxesWithTaxRatesofaBusiness.rdlc"); DataSetInvoice invoiceByBusinessCode = this.GetInvoiceByBusinessCode("usp_GetAllTaxesWithTaxRatesofaBusiness", this.txtBusinessCode.Text.ToString()); if (invoiceByBusinessCode.Tables[0].Rows.Count > 0) { ReportDataSource item = new ReportDataSource("DataSetInvoice", invoiceByBusinessCode.Tables[0]); this.ReportViewerInvoice.LocalReport.DataSources.Clear(); this.ReportViewerInvoice.LocalReport.DataSources.Add(item); } else { this.alertDanger.Visible = true; this.lblDanger.Text = "No Report Content!"; ReportDataSource item = new ReportDataSource("DataSetInvoice", invoiceByBusinessCode.Tables[0]); this.ReportViewerInvoice.LocalReport.DataSources.Clear(); this.ReportViewerInvoice.LocalReport.DataSources.Add(item); } } else if (this.chkDates.Checked && this.chkBusinessName.Checked) { this.chkDates.Checked = false; this.chkBusinessName.Checked = false; this.ReportViewerInvoice.ProcessingMode = ProcessingMode.Local; this.ReportViewerInvoice.LocalReport.ReportPath = base.Server.MapPath("~/Reports/rpt_GetAllTaxesWithTaxRatesofaBusiness.rdlc"); DataSetInvoice invoice3 = this.GetInvoiceByDatesBusinessName("usp_GetAllTaxesWithTaxRatesofaBusinessByDate", this.txtBusinessName.Text.ToString(), DateTime.Parse(this.txtFromDate.Text.ToString()), DateTime.Parse(this.txtToDate.Text.ToString())); if (invoice3.Tables[0].Rows.Count > 0) { ReportDataSource item = new ReportDataSource("DataSetInvoice", invoice3.Tables[0]); this.ReportViewerInvoice.LocalReport.DataSources.Clear(); this.ReportViewerInvoice.LocalReport.DataSources.Add(item); } else { this.alertDanger.Visible = true; this.lblDanger.Text = "No Report Content!"; ReportDataSource item = new ReportDataSource("DataSetInvoice", invoice3.Tables[0]); this.ReportViewerInvoice.LocalReport.DataSources.Clear(); this.ReportViewerInvoice.LocalReport.DataSources.Add(item); } } }); thread1.Start(); thread1.Join(); }