當前位置: 首頁>>代碼示例>>C#>>正文


C# frmReport.vatreturnReport方法代碼示例

本文整理匯總了C#中Open_Miracle.frmReport.vatreturnReport方法的典型用法代碼示例。如果您正苦於以下問題:C# frmReport.vatreturnReport方法的具體用法?C# frmReport.vatreturnReport怎麽用?C# frmReport.vatreturnReport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Open_Miracle.frmReport的用法示例。


在下文中一共展示了frmReport.vatreturnReport方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: btnPrint_Click

 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         frmReport crptReport = new frmReport();
         DataSet ds = new DataSet();
         DataTable dtblFormat2 = new DataTable();
         DataTable dtblTotal = new DataTable();
         CompanySP spCompany = new CompanySP();
         DataTable dtblCompany = new DataTable();
         dtblCompany = spCompany.CompanyViewAll();
         if (dgvVatreturn.Rows.Count > 0)
         {
             if (dtblFill.Rows.Count > 0)
             {
                 DataTable dtblReportFill = new DataTable();
                 dtblReportFill.Columns.Add("SlNO");
                 dtblReportFill.Columns.Add("Invoice No");
                 dtblReportFill.Columns.Add("Date");
                 dtblReportFill.Columns.Add("Party Name");
                 dtblReportFill.Columns.Add("Mailing Name");
                 dtblReportFill.Columns.Add("Tin No");
                 dtblReportFill.Columns.Add("qt");
                 dtblReportFill.Columns.Add("Sales Amound");
                 dtblReportFill.Columns.Add("Tax Amount");
                 dtblReportFill.Columns.Add("Cess");
                 dtblReportFill.Columns.Add("Net Amount");
                 dtblReportFill.Columns.Add("billDiscount");
                 dtblReportFill.Columns.Add("grandtotal");
                 for (int i = 0; i < dgvVatreturn.Rows.Count; i++)
                 {
                     DataRow drow = dtblReportFill.NewRow();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value != null)
                         drow["SlNO"] = dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value != null)
                         drow["Invoice No"] = dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value != null)
                         drow["Date"] = dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value != null)
                         drow["Party Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString() != string.Empty)
                         drow["Mailing Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value != null)
                         drow["Tin No"] = dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value != null)
                         drow["qt"] = dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value != null)
                         drow["Sales Amound"] = dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value != null)
                         drow["Tax Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value != null)
                         drow["Cess"] = dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value != null)
                         drow["Net Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value != null)
                         drow["billDiscount"] = dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value.ToString();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value != null)
                         drow["grandtotal"] = dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value.ToString();
                     dtblReportFill.Rows.Add(drow);
                 }
                 ds.Tables.Add(dtblReportFill);
                 ds.Tables.Add(dtblCompany);
                 crptReport.vatreturnReport(ds);
             }
             else
             {
                 VoucherTypeSP spVoucher = new VoucherTypeSP();
                 dtblFormat2 = spVoucher.VatGridFill(DateTime.Parse(dtpFrmDate.Text), DateTime.Parse(dtpToDate.Text), cmbTypeofVoucher.Text, Convert.ToDecimal(cmbVouchertype.SelectedValue.ToString()), strformat, cmbTax.Text);
                 if (dgvVatreturn.Rows.Count > 1)
                 {
                     dtblTotal.Columns.Add("taxableamt");
                     dtblTotal.Columns.Add("taxAmount");
                     DataRow dr1 = dtblTotal.NewRow();
                     dr1["taxableamt"] = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxtTaxableAmount"].Value.ToString();
                     dr1["taxAmount"] = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxttax"].Value.ToString();
                     dtblTotal.Rows.Add(dr1);
                     ds.Tables.Add(dtblCompany);
                     ds.Tables.Add(dtblFormat2);
                     ds.Tables.Add(dtblTotal);
                     crptReport.vatreturnReportFormat(ds);
                 }
             }
         }
         else
         {
             MessageBox.Show("No data found", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("VRR:14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
開發者ID:jsoques,項目名稱:openmiracle,代碼行數:98,代碼來源:frmVatReturnReport.cs


注:本文中的Open_Miracle.frmReport.vatreturnReport方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。