Exemplo n.º 1
0
        private void GenerateItemWiseReport()
        {
            List <CSOMaster> oListSOMaster = LoadItemWiseSales();

            POS       posdateset  = new POS();
            DataTable dtDailySale = posdateset.DailySales;

            foreach (CSOMaster oSOMaster in oListSOMaster)
            {
                foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
                {
                    DataRow drDailySale = dtDailySale.NewRow();

                    //drDailySale["InvoiceNo"] = dr1["InvoiceNo"];
                    drDailySale["BranchName"]  = oSOMaster.SOMstr_Branch;
                    drDailySale["Address"]     = currentBranch.CompBrn_Street;
                    drDailySale["Road"]        = currentBranch.CompBrn_Road;
                    drDailySale["City"]        = currentBranch.CompBrn_City;
                    drDailySale["Phone"]       = currentBranch.CompBrn_Phone;
                    drDailySale["Mobile"]      = currentBranch.CompBrn_Mobile;
                    drDailySale["ItemName"]    = oSODetails.SODet_ItemName;
                    drDailySale["Qty"]         = oSODetails.SODet_QTY;
                    drDailySale["Rate"]        = oSODetails.SODet_Price;
                    drDailySale["Amount"]      = oSODetails.SODet_Amount;
                    drDailySale["TotalAmount"] = oSOMaster.SOMstr_TotalAmt;
                    drDailySale["DiscAmount"]  = oSOMaster.SOMstr_DiscAmt;
                    drDailySale["NetAmount"]   = oSOMaster.SOMstr_NetAmt;

                    dtDailySale.Rows.Add(drDailySale);
                }
            }

            rptItemWiseSales orpt = new rptItemWiseSales();

            orpt.SetDataSource(posdateset);
            orpt.SetParameterValue(0, currentBranch.CompBrn_Name.Trim());
            orpt.SetParameterValue(1, dtpDateFrom2.Value.Date);
            orpt.SetParameterValue(2, dtpDateTo2.Value.Date);
            //  orpt.SetParameterValue(3, cmbItemName.SelectedText.ToString());
            //  orpt.SetParameterValue(1, currentUser.User_UserName.Trim());



            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = orpt;
            // orptviewer.AutoSize = false;

            orptviewer.Show();
            ofrmReportView.Show();


            //crystalReportViewer1.ReportSource = orpt;
            //crystalReportViewer1.Show();
        }
Exemplo n.º 2
0
        private void ShowReport()
        {
            POS       posdataset = new POS();
            DataTable stickertbl = (DataTable)posdataset.StickerPrint;

            for (int i = 0; i < lvItem.Items.Count; i++)
            {
                for (int j = 0; j < Convert.ToInt32(lvItem.Items[i].SubItems[2].Text); j++)
                {
                    DataRow row = stickertbl.NewRow();
                    row["ItemCode"] = "*" + lvItem.Items[i].SubItems[0].Text + "*";
                    row["ItemName"] = lvItem.Items[i].SubItems[1].Text;
                    row["Price"]    = lvItem.Items[i].SubItems[3].Text;
                    stickertbl.Rows.Add(row);
                }



                //POS posdataset = new POS();
                //DataTable stickertbl = (DataTable)posdataset.StickerPrint;

                //for (int i = 0; i < lvItem.Items.Count; i++)
                //{
                //    for (int j = 0; j < Convert.ToInt32(lvItem.Items[i].SubItems[2].Text); j++)
                //    {
                //        DataRow row = stickertbl.NewRow();
                //        row["ItemCode"] = "*" + lvItem.Items[i].SubItems[0].Text + "*";
                //        string[] itemarray = lvItem.Items[i].SubItems[1].Text.Split('-');
                //        try
                //        {
                //            row["ItemName"] = itemarray[0].ToString();
                //            row["Code"] = itemarray[1].ToString();
                //            row["Size"] = itemarray[3].ToString();
                //        }
                //        catch (Exception ex)
                //        {

                //        }
                //        row["Price"] = lvItem.Items[i].SubItems[3].Text;
                //        stickertbl.Rows.Add(row);
                //    }
            }

            rptSticker objrpt = new rptSticker();

            objrpt.SetDataSource(stickertbl);

            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = objrpt;
            orptviewer.AutoSize     = false;

            orptviewer.Show();
            ofrmReportView.Show();
        }
Exemplo n.º 3
0
        private void GenerateInvoiceReport(CSOMaster oSOMaster)
        {
            POS       posdateset = new POS();
            DataTable dtInv      = posdateset.Invoice;

            foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
            {
                DataRow drInv = dtInv.NewRow();

                drInv["BranchName"] = currentBranch.CompBrn_Name;
                drInv["Address"]    = currentBranch.CompBrn_Street;
                drInv["RoadNo"]     = currentBranch.CompBrn_Road;
                drInv["City"]       = currentBranch.CompBrn_City;
                drInv["Phone"]      = currentBranch.CompBrn_Phone;
                drInv["InvoiceNo"]  = oSOMaster.SOMstr_Code;
                drInv["VatClnNo"]   = oSOMaster.SOMstr_VatClnNo;
                drInv["ItemName"]   = oSODetails.SODet_ItemName;
                drInv["Qty"]        = oSODetails.SODet_QTY;
                drInv["Price"]      = oSODetails.SODet_Price;
                drInv["Amount"]     = oSODetails.SODet_Amount;
                drInv["Discount"]   = oSODetails.SODet_Discount;
                drInv["VATValue"]   = oSODetails.SODet_VATValue;

                dtInv.Rows.Add(drInv);
            }

            rptInvoice objrptInvoice = new rptInvoice();

            objrptInvoice.SetDataSource(dtInv);
            objrptInvoice.SetParameterValue(0, float.Parse(txtDiscountAmount.Text.Trim()));
            objrptInvoice.SetParameterValue(1, currentUser.User_UserName.Trim());
            objrptInvoice.SetParameterValue(2, txtCustomerPaid.Text.Trim());
            objrptInvoice.SetParameterValue(3, txtChange.Text.Trim());

            if (InvoiceRawKind == 0)
            {
                PrintDocument pd = new PrintDocument();
                pd.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("POS", 4, 4);
                InvoiceRawKind = (int)pd.PrinterSettings.DefaultPageSettings.PaperSize.RawKind;
            }

            objrptInvoice.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)InvoiceRawKind;

            objrptInvoice.PrintToPrinter(1, true, 1, 1);


            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = objrptInvoice;
            orptviewer.AutoSize     = false;

            orptviewer.Show();
            ofrmReportView.Show();
        }
Exemplo n.º 4
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            //  ShowReport();

            rptProfitAndLoss    obj            = new rptProfitAndLoss();
            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = obj;

            orptviewer.Show();
            ofrmReportView.Show();
        }
Exemplo n.º 5
0
        private void ShowImportedDataasRpt(List <CSOMaster> oListSOMaster)
        {
            POS       posdateset  = new POS();
            DataTable dtDailySale = posdateset.DailySales;


            foreach (CSOMaster oSOMaster in oListSOMaster)
            {
                foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
                {
                    DataRow drDailySale = dtDailySale.NewRow();

                    drDailySale["BranchName"] = oSOMaster.SOMstr_Branch;
                    drDailySale["Address"]    = currentBranch.CompBrn_Street;
                    drDailySale["Road"]       = currentBranch.CompBrn_Road;
                    drDailySale["City"]       = currentBranch.CompBrn_City;
                    drDailySale["Phone"]      = currentBranch.CompBrn_Phone;
                    drDailySale["Mobile"]     = currentBranch.CompBrn_Mobile;
                    drDailySale["ItemName"]   = oSODetails.SODet_ItemName;
                    drDailySale["Qty"]        = oSODetails.SODet_QTY;
                    drDailySale["Rate"]       = oSODetails.SODet_Price;
                    drDailySale["Amount"]     = oSODetails.SODet_Amount;

                    drDailySale["TotalAmount"] = oSOMaster.SOMstr_TotalAmt;
                    drDailySale["DiscAmount"]  = oSOMaster.SOMstr_DiscAmt;
                    drDailySale["NetAmount"]   = oSOMaster.SOMstr_NetAmt;


                    dtDailySale.Rows.Add(drDailySale);
                }
            }

            rptDailySales orpt = new rptDailySales();

            orpt.SetDataSource(posdateset);
            orpt.SetParameterValue(0, currentBranch.CompBrn_Name.Trim());
            orpt.SetParameterValue(1, oListSOMaster[0].SOMstr_Date.Date);

            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = orpt;
            // orptviewer.AutoSize = false;

            orptviewer.Show();
            ofrmReportView.Show();

            //crystalReportViewer1.ReportSource = orpt;
            //crystalReportViewer1.Show();
        }
Exemplo n.º 6
0
        private void ShowReport()
        {
            List <CReturnItem> oListCReturnItem = new List <CReturnItem>();
            //List<CSOMaster> oListSOMasterretu = new List<CSOMaster>();
            CSOBO    oCSOBO  = new CSOBO();
            CResult  oResult = new CResult();
            DateTime date    = dtpDate.Value.Date;

            oListCReturnItem = oCSOBO.ReadSalesReturn(dtpDate.Value.Date, ddlRptBranch.SelectedItem.ToString());// currentBranch.CompBrn_Code);
            //oListCReturnItem.Add(oListSOMasterretu);
            New       oPosDataSet11 = new New();
            DataTable dtReturn      = oPosDataSet11.ReturnItems;

            //foreach (CSOMaster oSoMaster in oListSOMasterretu)
            //{
            //oListCReturnItem.Add(oSoMaster);
            //}

            foreach (CReturnItem oSoDetail in oListCReturnItem)
            {
                DataRow odr = dtReturn.NewRow();
                odr["ItemName"]           = oSoDetail.ItemName;
                odr["Ret_QTY"]            = oSoDetail.Ret_QTY;
                odr["ItemPrice"]          = float.Parse(oSoDetail.ItemPrice.ToString());
                odr["BranchName"]         = oSoDetail.Ret_BranchOID;
                odr["Ret_DiscountAmount"] = oSoDetail.Ret_DiscountAmount;
                odr["ReturnDate"]         = oSoDetail.date;

                dtReturn.Rows.Add(odr);
            }



            ETLPOS.Reports.ReturnReport orpt = new ETLPOS.Reports.ReturnReport();
            orpt.SetDataSource(oPosDataSet11);
            //orpt.SetParameterValue(0, currentBranch.CompBrn_OId.Trim());
            orpt.SetParameterValue(0, dtpDate.Value.Date);

            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];

            orptviewer.ReportSource = orpt;
            // orptviewer.AutoSize = false;

            orptviewer.Show();
            ofrmReportView.Show();

            //crystalReportViewer1.ReportSource = orpt;
            //crystalReportViewer1.Show();
        }
Exemplo n.º 7
0
        //Report Stock Details-----------
        private void ReportStockDetails()
        {
            CSOBO   oCSOBO  = new CSOBO();
            CResult oResult = new CResult();

            oResult = oCSOBO.ReportStockDatials(currentBranch.CompBrn_OId.Trim());

            if (oResult.IsSuccess)
            {
                DataSet ds = (DataSet)oResult.Data;

                POS       posdateset    = new POS();
                DataTable dtStockDetail = posdateset.StockDetail;

                foreach (DataRow dr1 in ds.Tables[0].Rows)
                {
                    DataRow drStockDetail = dtStockDetail.NewRow();
                    drStockDetail["ItemName"]      = dr1["Item_ItemName"];
                    drStockDetail["Qty"]           = dr1["QTY"];
                    drStockDetail["Pprice"]        = dr1["Pprice"];
                    drStockDetail["Sprice"]        = dr1["Price"];
                    drStockDetail["ItemGroupCode"] = dr1["Item_GroupID"];
                    drStockDetail["ItemGroupName"] = dr1["CatCode"];
                    drStockDetail["ItemCode"]      = dr1["Item_Code"];
                    dtStockDetail.Rows.Add(drStockDetail);
                }

                rptStockDetails oStockrpt = new rptStockDetails();
                oStockrpt.SetDataSource(dtStockDetail);
                oStockrpt.SetParameterValue(0, currentBranch.CompBrn_Branch.Trim());

                frmReportView       ofrmReportView = new frmReportView();
                CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];
                orptviewer.ReportSource = oStockrpt;
                orptviewer.Show();
                ofrmReportView.Show();
            }

            else
            {
                MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 8
0
        private void PopulateReport()
        {
            CSOBO   oCSOBO  = new CSOBO();
            CResult oResult = new CResult();

            oResult = oCSOBO.DailyCurrentStockReport(currentBranch.CompBrn_OId.Trim());

            if (oResult.IsSuccess)
            {
                DataSet ds = (DataSet)oResult.Data;

                POS       posdateset  = new POS();
                DataTable dtDailySale = posdateset.Stock;

                foreach (DataRow dr1 in ds.Tables[0].Rows)
                {
                    DataRow drDailySale = dtDailySale.NewRow();

                    drDailySale["Qty"]      = dr1["Qty"];
                    drDailySale["ItemName"] = dr1["ItemName"];
                    drDailySale["Invtype"]  = Enum.GetName(typeof(EInvType), dr1["Invt_InvType"]);

                    dtDailySale.Rows.Add(drDailySale);
                }

                rptCurrStock oStockrpt = new rptCurrStock();
                oStockrpt.SetDataSource(dtDailySale);
                oStockrpt.SetParameterValue(0, currentUser.User_UserName.Trim());
                oStockrpt.SetParameterValue(1, currentBranch.CompBrn_Branch.Trim());

                frmReportView       ofrmReportView = new frmReportView();
                CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];
                orptviewer.ReportSource = oStockrpt;
                orptviewer.Show();
                ofrmReportView.Show();
            }

            else
            {
                MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 9
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (txtMenoNo.Text != "")
            {
                CSOBO            oSoBo         = new CSOBO();
                List <CSOMaster> oSoMasterList = oSoBo.GetMemoData((txtMenoNo.Tag as CSOMaster).SOMstr_Code, (txtMenoNo.Tag as CSOMaster).SOMstr_Date, currentBranch.CompBrn_Branch);

                POS       oPosDataSet = new POS();
                DataTable oDt         = oPosDataSet.Tables["MemoReprint"];
                foreach (CSOMaster oSoMaster in oSoMasterList)
                {
                    DataRow odr = oDt.NewRow();
                    odr["BranchName"] = oSoMaster.SOMstr_Branch;
                    odr["MemoNo"]     = oSoMaster.SOMstr_Code;
                    odr["MemoDate"]   = oSoMaster.SOMstr_Date;
                    odr["Discount"]   = int.Parse(oSoMaster.SOMstr_DiscAmt.ToString());
                    foreach (CSODetails oSoDetail in oSoMaster.SOMstr_DetailsList)
                    {
                        odr["ItemName"] = oSoDetail.SODet_ItemName;
                        odr["Qty"]      = oSoDetail.SODet_QTY;
                        odr["Price"]    = float.Parse(oSoDetail.SODet_Price.ToString());
                        odr["Amount"]   = float.Parse(oSoDetail.SODet_SDAmount.ToString());
                    }
                    oDt.Rows.Add(odr);
                }
                txtMenoNo.Text = "";
                rptMemoReprint orptMemoReprint = new rptMemoReprint();
                orptMemoReprint.SetDataSource(oPosDataSet);

                frmReportView       ofrmReportView       = new frmReportView();
                CrystalReportViewer oCristalReportViewer = (CrystalReportViewer)ofrmReportView.Controls["rptViewer"];
                oCristalReportViewer.ReportSource = orptMemoReprint;

                oCristalReportViewer.Show();
                ofrmReportView.Show();
            }
        }
Exemplo n.º 10
0
        private void ShowReport()
        {
            #region 1
            List <CSOMaster> oListSOMaster = LoadSOData();

            POS       posdateset  = new POS();
            DataTable dtDailySale = posdateset.DailySales;



            foreach (CSOMaster oSOMaster in oListSOMaster)
            {
                int i = 0;
                foreach (CSODetails oSODetails in oSOMaster.SOMstr_DetailsList)
                {
                    DataRow drDailySale = dtDailySale.NewRow();

                    //drDailySale["InvoiceNo"] = dr1["InvoiceNo"];
                    drDailySale["BranchName"]  = oSOMaster.SOMstr_Branch;
                    drDailySale["Address"]     = currentBranch.CompBrn_Street;
                    drDailySale["Road"]        = currentBranch.CompBrn_Road;
                    drDailySale["City"]        = currentBranch.CompBrn_City;
                    drDailySale["Phone"]       = currentBranch.CompBrn_Phone;
                    drDailySale["Mobile"]      = currentBranch.CompBrn_Mobile;
                    drDailySale["ItemName"]    = oSODetails.SODet_ItemName;
                    drDailySale["Qty"]         = oSODetails.SODet_QTY;
                    drDailySale["Rate"]        = oSODetails.SODet_Price;
                    drDailySale["Amount"]      = oSODetails.SODet_Amount;
                    drDailySale["TotalAmount"] = oSOMaster.SOMstr_TotalAmt;
                    if (i == 0)
                    {
                        drDailySale["DiscAmount"] = oSOMaster.SOMstr_DiscAmt;
                    }
                    if (i != 0)
                    {
                        drDailySale["DiscAmount"] = 0;
                    }
                    drDailySale["NetAmount"] = oSOMaster.SOMstr_NetAmt;
                    drDailySale["PPrice"]    = oSODetails.SODet_PPrice;


                    dtDailySale.Rows.Add(drDailySale);
                    i++;
                }
            }
            #endregion
            List <CReturnItem> oListCReturnItem = new List <CReturnItem>();
            //List<CSOMaster> oListSOMasterretu = new List<CSOMaster>();
            CSOBO    oCSOBO  = new CSOBO();
            CResult  oResult = new CResult();
            DateTime date    = dtpDate.Value.Date;
            oListCReturnItem = oCSOBO.ReadSalesReturn(dtpDate.Value.Date, currentBranch.CompBrn_Code);
            //oListCReturnItem.Add(oListSOMasterretu);
            New       PosDataSet11 = new New();
            DataTable dtReturn     = PosDataSet11.ReturnItems;
            //foreach (CSOMaster oSoMaster in oListSOMasterretu)
            //{
            //oListCReturnItem.Add(oSoMaster);
            //}

            foreach (CReturnItem oSoDetail in oListCReturnItem)
            {
                DataRow odr = dtReturn.NewRow();
                odr["ItemName"]           = oSoDetail.ItemName;
                odr["Ret_QTY"]            = oSoDetail.Ret_QTY;
                odr["ItemPrice"]          = float.Parse(oSoDetail.ItemPrice.ToString());
                odr["BranchName"]         = oSoDetail.Ret_BranchOID;
                odr["Ret_DiscountAmount"] = oSoDetail.Ret_DiscountAmount;
                //odr["ReturnDate"] = oSoDetail.date;

                dtReturn.Rows.Add(odr);
            }


            //ReturnReport re = new ReturnReport();
            //re.SetDataSource(PosDataSet11);

            rptDailySales orpt = new rptDailySales();
            orpt.SetDataSource(posdateset);
            //orpt.Load("ReturnReport.rpt");
            orpt.OpenSubreport("ReturnReport.rpt").SetDataSource(PosDataSet11);
            orpt.SetParameterValue(0, currentBranch.CompBrn_Name.Trim());
            orpt.SetParameterValue(1, dtpDate.Value.Date);

            frmReportView       ofrmReportView = new frmReportView();
            CrystalReportViewer orptviewer     = (CrystalReportViewer)ofrmReportView.Controls["rptviewer"];
            orptviewer.ReportSource = orpt;
            // orptviewer.AutoSize = false;

            orptviewer.Show();
            ofrmReportView.Show();

            //crystalReportViewer1.ReportSource = orpt;
            //crystalReportViewer1.Show();
        }