示例#1
0
        private void PrintVoucher()
        {
            try
            {
                string vWhere                 = string.Empty;
                string vVoucherType           = getVoucherType();
                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                DataTable dt = objDAL.getVouchersData(" AND VoucherHeader.VoucherID=" + txtVoucherNo.Text + " AND VoucherHeader.VoucherType='" + vVoucherType + "'");
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }

                if (vVoucherType == "JV")
                {
                    vForm.ShowReport("JOURNAL VOUCHER", dt);
                    vForm.ShowDialog();
                }
                else if (vVoucherType == "CRV")
                {
                    DAL.Settings objSet = new DAL.Settings();
                    objSet.connectionstring = objDAL.connectionstring;

                    DataRow dr = dt.NewRow();
                    dr["VoucherNo"]   = dt.Rows[0]["VoucherNo"];
                    dr["VoucherType"] = dt.Rows[0]["VoucherType"];
                    dr["VoucherDate"] = dt.Rows[0]["VoucherDate"];
                    dr["Narration"]   = dt.Rows[0]["Narration"];
                    dr["AccountNo"]   = 100000;
                    dr["AccountName"] = "Cash"; //objSet.GetSettingValue(DAL.Settings.ProSettings.CashAccTitle);

                    decimal vTotalAmount =
                        dt.AsEnumerable().Sum(r => r.Field <Decimal>("Credit"));

                    dr["Debit"] = vTotalAmount.ToString("G29");

                    //dr["Debit"] = dt.Rows[0]["Credit"];
                    dr["Credit"]     = 0;
                    dr["TranStatus"] = "DEBIT";

                    dt.Rows.Add(dr);

                    vForm.ShowReport("CASH RECEIVING VOUCHER", dt);
                    vForm.ShowDialog();
                }
                else if (vVoucherType == "CPV")
                {
                    vForm.ShowReport("CASH PAYMENT VOUCHER", dt);
                    vForm.ShowDialog();
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
示例#2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (vOpenMode == false)
                {
                    return;
                }
                string vWhere = string.Empty;

                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                vWhere = "AND Sale.SaleID=" + this.txt_InvNo.Text;

                DAL.Reports Msc = new DAL.Reports();
                Msc.connectionstring = objDAL.connectionstring;


                DataTable dt = Msc.getSaleInvoices(vWhere);
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }
                vForm.ShowReport("SALE INVOICES", dt);
                vForm.ShowDialog();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
示例#3
0
        private void PrintVoucher()
        {
            try
            {
                string vWhere                 = string.Empty;
                string vVoucherType           = getVoucherType();
                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                DataTable dt = objDAL.getVouchersData(" AND VoucherHeader.VoucherID=" + txtVoucherNo.Text + " AND VoucherHeader.VoucherType='" + vVoucherType + "'");
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }

                if (vVoucherType == "JV")
                {
                    vForm.ShowReport("JOURNAL VOUCHER", dt);
                    vForm.ShowDialog();
                }
                else if (vVoucherType == "CRV")
                {
                    vForm.ShowReport("CASH RECEIVING VOUCHER", dt);
                    vForm.ShowDialog();
                }
                else if (vVoucherType == "CPV")
                {
                    vForm.ShowReport("CASH PAYMENT VOUCHER", dt);
                    vForm.ShowDialog();
                }
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
示例#4
0
        private void PrintVoucher(Int64 vVoucherID)
        {
            try
            {
                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                DataTable dt = objDAL.getPrintData(vVoucherID);
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }

                vForm.ShowReport("BANK PAYMENT VOUCHER", dt);
                vForm.ShowDialog();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
示例#5
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                string vWhere       = string.Empty;
                string vReportTitle = string.Empty;

                Reports.RptReportViewer vForm = new Reports.RptReportViewer();


                DataTable dt = new DataTable();

                if (optBankAcc.Checked)
                {
                    dt           = objDAL.getBankAccList(vWhere);
                    vReportTitle = "BANK ACCOUNT LIST";
                }
                else if (optGeneral.Checked)
                {
                    dt           = objDAL.getAccountsList(vWhere);
                    vReportTitle = "GEN ACCOUNT LIST";
                }



                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }

                vForm.ShowReport(vReportTitle, dt);
                vForm.ShowDialog();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
示例#6
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                string vWhere = string.Empty;

                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                if (!string.IsNullOrEmpty(this.txt_ProductID.Text))
                {
                    vWhere = " AND Products.ProductID=" + this.txt_ProductID.Text;
                }

                if (chkConsumable.Checked == true)
                {
                    vWhere += " AND Isnull(Products.IsRawMaterial,0)=1";
                }

                if (chkSaleable.Checked == true)
                {
                    vWhere += " AND Isnull(Products.IsRawMaterial,0)=0";
                }


                DataTable dt = objDAL.getCurrentStock(vWhere);
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }
                vForm.ShowReport("CURRENT STOCK", dt);
                vForm.ShowDialog();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }
示例#7
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                string vWhere = string.Empty;

                Reports.RptReportViewer vForm = new Reports.RptReportViewer();

                if (!string.IsNullOrEmpty(this.txtVendorID.Text))
                {
                    vWhere = " AND PartyID=" + this.txtVendorID.Text;
                }

                if (chkSupplier.Checked == true)
                {
                    vWhere += " AND Isnull(IsSupplier)=1";
                }

                if (chkCustomer.Checked == true)
                {
                    vWhere += " AND Isnull(IsCustomer)=1";
                }

                DataTable dt = objDAL.getPartiesList(vWhere);
                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("No Data To Display", "No Data");
                    return;
                }
                vForm.ShowReport("PARTIES LIST", dt);
                vForm.ShowDialog();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Error");
            }
        }