Ejemplo n.º 1
0
        public List <DataTable> PurchaseOrdeReportViewAll(string strInvoiceNo, decimal decLedgerId, decimal decVouchertypeId, DateTime FromDate, DateTime ToDate, string strStatus)
        {
            PurchaseOrderMasterSP SPPurchaseOrderMaster = new PurchaseOrderMasterSP();
            List <DataTable>      ListObj = new List <DataTable>();

            try
            {
                ListObj = SPPurchaseOrderMaster.PurchaseOrdeReportViewAll(strInvoiceNo, decLedgerId, decVouchertypeId, FromDate, ToDate, strStatus);
            }
            catch (Exception ex)
            {
                MessageBox.Show("PoBll 26:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(ListObj);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Function to fill gridview
        /// </summary>
        public void GridFill()
        {
            try
            {
                PurchaseOrderMasterSP spPurchaseOrderMaster = new PurchaseOrderMasterSP();
                if (txtVoucherNo.Text.Trim() == string.Empty)
                {
                    strInvoiceNo = "-1";
                }
                else
                {
                    strInvoiceNo = txtVoucherNo.Text;
                }
                if (cmbCashOrParty.SelectedIndex == 0 || cmbCashOrParty.SelectedIndex == -1)
                {
                    decLedgerId = -1;
                }
                else
                {
                    decLedgerId = Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString());
                }
                if (cmbVoucherType.SelectedIndex == 0 || cmbVoucherType.SelectedIndex == -1)
                {
                    decVoucherTypeId = -1;
                }
                else
                {
                    decVoucherTypeId = Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString());
                }

                if (cmbStatus.SelectedIndex == 0 || cmbStatus.SelectedIndex == -1)
                {
                    strStatus = "All";
                }
                else
                {
                    strStatus = cmbStatus.SelectedItem.ToString();
                }
                DateTime FromDate = this.dtpFromDate.Value;
                DateTime ToDate   = this.dtpToDate.Value;
                dtblPurchaseOrderRegister = spPurchaseOrderMaster.PurchaseOrdeReportViewAll(strInvoiceNo, decLedgerId, decVoucherTypeId, FromDate, ToDate, strStatus);

                if (dtblPurchaseOrderRegister.Rows.Count > 0)
                {
                    decimal decTotal = 0;
                    for (int i = 0; i < dtblPurchaseOrderRegister.Rows.Count; i++)
                    {
                        if (dtblPurchaseOrderRegister.Rows[i]["totalAmount"].ToString() != null)
                        {
                            decTotal = decTotal + Convert.ToDecimal(dtblPurchaseOrderRegister.Rows[i]["totalAmount"].ToString());
                        }
                    }
                    decTotal            = Math.Round(decTotal, 2);
                    txtTotalAmount.Text = decTotal.ToString();
                }
                else
                {
                    txtTotalAmount.Text = "0.00";
                }
                dgvPurchaseOrderReport.DataSource = dtblPurchaseOrderRegister;
                if (dgvPurchaseOrderReport.Columns.Count > 0)
                {
                    dgvPurchaseOrderReport.Columns["dgvtxtTotalAmount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PORP:4" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }