Beispiel #1
0
 /// <summary>
 /// Function to Fill product group or tax according to search by combo box selection in Product Group/Tax combo box
 /// </summary>
 public void ProductGroupTaxComboFill()
 {
     try
     {
         if (cmbSearchBy.SelectedIndex == 0)
         {
             ProductGroupSP spProductGroup   = new ProductGroupSP();
             DataTable      dtblProductGroup = new DataTable();
             dtblProductGroup = spProductGroup.ProductGroupViewAll();
             cmbProductGroupTax.DataSource    = dtblProductGroup;
             cmbProductGroupTax.ValueMember   = "groupId";
             cmbProductGroupTax.DisplayMember = "groupName";
         }
         else
         {
             TaxSP     spTax   = new TaxSP();
             DataTable dtblTax = new DataTable();
             dtblTax = spTax.TaxViewAll();
             cmbProductGroupTax.DataSource    = dtblTax;
             cmbProductGroupTax.ValueMember   = "taxId";
             cmbProductGroupTax.DisplayMember = "taxName";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CPT 5 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #2
0
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         if (rbtnInput.Checked)
         {
             isInput = true;
         }
         else
         {
             isInput = false;
         }
         if (rbtnBillwise.Checked)
         {
             isBillwise = true;
         }
         else
         {
             isBillwise = false;
         }
         TaxSP    spTax            = new TaxSP();
         DataSet  dsTaxReport      = new DataSet();
         DateTime dtFromDate       = DateTime.Parse(txtFromDate.Text);
         DateTime dtToDate         = DateTime.Parse(txtToDate.Text);
         decimal  dectaxId         = Convert.ToDecimal(cmbTax.SelectedValue.ToString());
         decimal  decvoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
         if (isBillwise)
         {
             dsTaxReport = spTax.TaxCrystalReportGridFillByBillWise(1, dtFromDate, dtToDate, dectaxId, decvoucherTypeId, isInput);
         }
         else
         {
             dsTaxReport = spTax.TaxCrystalReportGridFillByProductwise(1, dtFromDate, dtToDate, dectaxId, decvoucherTypeId, isInput);
         }
         frmReport frmRepor = new frmReport();
         frmRepor.MdiParent = formMDI.MDIObj;
         if (dgvTaxReport.Rows.Count > 0)
         {
             frmRepor.TaxCrystalReportPrint(dsTaxReport, isBillwise);
         }
         else
         {
             Messages.InformationMessage("No Data Found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("TR:16" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Function to Fill new tax type combo box
 /// </summary>
 public void NewTaxTypeComboFill()
 {
     try
     {
         TaxSP     spTax   = new TaxSP();
         DataTable dtblTax = new DataTable();
         dtblTax = spTax.TaxViewAll();
         cmbNewTaxType.DataSource    = dtblTax;
         cmbNewTaxType.ValueMember   = "taxId";
         cmbNewTaxType.DisplayMember = "taxName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("CPT 4 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Function to fill the tax combobox
 /// </summary>
 public void TaxFill()
 {
     try
     {
         TaxSP     spTax = new TaxSP();
         DataTable dt    = new DataTable();
         dt = spTax.TaxViewAll();
         DataRow dr = dt.NewRow();
         dr[1] = "All";
         dt.Rows.InsertAt(dr, 0);
         cmbTax.ValueMember   = "taxId";
         cmbTax.DisplayMember = "taxName";
         cmbTax.DataSource    = dt;
     }
     catch (Exception ex)
     {
         MessageBox.Show("VRR:05" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #5
0
 /// <summary>
 /// To fill tax combobox
 /// </summary>
 public void TaxComboFill()
 {
     try
     {
         DataTable dtbl  = new DataTable();
         TaxSP     spTax = new TaxSP();
         dtbl = spTax.TaxViewAllForProduct();
         DataRow drowSelect = dtbl.NewRow();
         drowSelect[0]         = 0;
         drowSelect["taxName"] = "All";
         dtbl.Rows.InsertAt(drowSelect, 0);
         cmbTax.DataSource    = dtbl;
         cmbTax.ValueMember   = "taxId";
         cmbTax.DisplayMember = "taxName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("STKR:7" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #6
0
 /// <summary>
 /// To fill the grid
 /// </summary>
 public void GridFill()
 {
     try
     {
         if (cmbTax.SelectedValue != null && cmbVoucherType.SelectedItem != null)
         {
             DataTable dtbl             = new DataTable();
             TaxSP     spTax            = new TaxSP();
             DateTime  dtFromDate       = DateTime.Parse(txtFromDate.Text);
             DateTime  dtToDate         = DateTime.Parse(txtToDate.Text);
             decimal   dectaxId         = Convert.ToDecimal(cmbTax.SelectedValue.ToString());
             decimal   decvoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
             string    strTypeofVoucher = Convert.ToString(cmbTypeOfVoucher.Text);
             if (isBillwise)
             {
                 dtbl = spTax.TaxReportGridFillByBillWise(dtFromDate, dtToDate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput);
                 if (dtbl.Rows.Count > 0)
                 {
                     for (int i = 0; i < dtbl.Rows.Count; i++)
                     {
                         dgvTaxReport.Rows.Add();
                         dgvTaxReport.Rows[i].Cells["dgvtxtSlNo"].Value        = Convert.ToDecimal(dtbl.Rows[i]["SlNo"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtDate"].Value        = dtbl.Rows[i]["Date"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtVoucherType"].Value = dtbl.Rows[i]["TypeofVoucher"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtVoucherNo"].Value   = dtbl.Rows[i]["Voucher No"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtCashParty"].Value   = dtbl.Rows[i]["Cash/Party"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtTIN"].Value         = dtbl.Rows[i]["TIN"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtCST"].Value         = dtbl.Rows[i]["CST"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtBillAmount"].Value  = Convert.ToDecimal(dtbl.Rows[i]["Bill Amount"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtCessAmount"].Value  = Convert.ToDecimal(dtbl.Rows[i]["Cess Amount"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtTaxAmount"].Value   = Convert.ToDecimal(dtbl.Rows[i]["Tax Amount"]);
                     }
                 }
             }
             else
             {
                 dtbl = spTax.TaxReportGridFillByProductwise(dtFromDate, dtToDate, dectaxId, decvoucherTypeId, strTypeofVoucher, isInput);
                 if (dtbl.Rows.Count > 0)
                 {
                     for (int i = 0; i < dtbl.Rows.Count; i++)
                     {
                         dgvTaxReport.Rows.Add();
                         dgvTaxReport.Rows[i].Cells["dgvtxtSlNo"].Value        = Convert.ToDecimal(dtbl.Rows[i]["SlNo"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtDate"].Value        = dtbl.Rows[i]["Date"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtVoucherType"].Value = dtbl.Rows[i]["Voucher Type"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtBillNo"].Value      = dtbl.Rows[i]["Bill No"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtItem"].Value        = dtbl.Rows[i]["Item"].ToString();
                         dgvTaxReport.Rows[i].Cells["dgvtxtBillAmount"].Value  = Convert.ToDecimal(dtbl.Rows[i]["Bill Amount"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtTax"].Value         = Convert.ToDecimal(dtbl.Rows[i]["Tax %"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtTaxAmount"].Value   = Convert.ToDecimal(dtbl.Rows[i]["Tax Amount"]);
                         dgvTaxReport.Rows[i].Cells["dgvtxtTotalAmount"].Value = Convert.ToDecimal(dtbl.Rows[i]["Total Amount"]);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("TR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }