コード例 #1
0
        private void ShowCreditNoteReport(int id)
        {
            var creditNoteDataSet = new CreditNoteDataSet();
            var firmTable         = creditNoteDataSet.Tables["FirmMaster"];
            var otherInfo         = creditNoteDataSet.Tables["OtherInfo"];

            _dataSetProvider.GetFirmDataTable(firmTable);
            var crn      = _transactionService.GetCreditNotes().Single(x => x.Id == id);
            var customer = (Customer)cboCustomer.SelectedItem;

            var otherRow = otherInfo.NewRow();

            otherRow["InvoiceNo"]       = crn.InvoiceNo;
            otherRow["TransactionDate"] = crn.TransactionDate;
            otherRow["ContactName"]     = customer.ContactName;
            otherRow["ContactNo"]       = customer.Address.Phone;
            otherRow["Address"]         = customer.Address.ToString();
            otherRow["Particulars"]     = crn.Description;
            otherRow["TotalAmount"]     = crn.Amount;
            otherRow["VATNumber"]       = customer.VATNumber;
            otherRow["CSTNumber"]       = customer.CSTNumber;
            otherRow["AmountInWords"]   = SpellNumber.SpellInWord(crn.Amount);

            otherInfo.Rows.Add(otherRow);

            var orderReport = new frmReport
            {
                ReportPath    = ReportUtility.ResolveReportPath(ReportConstants.CreditNoteReport),
                ReportDataSet = creditNoteDataSet
            };

            orderReport.Show();
        }
コード例 #2
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            var reportDataSet = GetJewelTransactionReport();

            if (reportDataSet == null)
            {
                return;
            }

            var reportDocument = new ReportDocument();

            reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.JEWELTRANSACTIONREPORTPATH));
            crystalReportViewer1.ReportSource = reportDocument;
            reportDocument.SetDataSource(reportDataSet);
            crystalReportViewer1.Refresh();
        }
コード例 #3
0
        private void frmBarcodePrinter_Load(object sender, EventArgs e)
        {
            var jewels = FormData as TransactionLookup;

            var jewelMasterDataSet = new JewelMasterDataSet();
            var barcode            = new BarcodeUtility();

            foreach (var jewel in jewels.JewelTransactions)
            {
                var jewelImage     = barcode.MakeBarcodeImage(jewel.JewelNumber);
                var jewelMasterRow = jewelMasterDataSet.Tables["JewelMaster"].NewRow();

                jewelMasterRow["JewelNo"]          = jewel.JewelNumber;
                jewelMasterRow["CertificateNo"]    = jewel.CertificateNumber;
                jewelMasterRow["StyleNo"]          = jewel.DesignCode;
                jewelMasterRow["JewelDescription"] = jewel.JewelType;
                jewelMasterRow["MetalColor"]       = jewel.MetalColor;
                jewelMasterRow["ImagePath"]        = ImageExtension.GetImageName(jewel.DesignCode);
                jewelMasterRow["DiamondPcs"]       = Convert.ToString(jewel.StonePcs);
                jewelMasterRow["DiamondWt"]        = Convert.ToString(jewel.StoneWeight);
                jewelMasterRow["GrsWt"]            = Convert.ToString(jewel.TotalWeight);
                jewelMasterRow["NetWt"]            = Convert.ToString(jewel.MetalWeight);
                jewelMasterRow["JewelImage"]       = ImageConverterHelper.ImageToByteArray(jewelImage);

                jewelMasterDataSet.Tables["JewelMaster"].Rows.Add(jewelMasterRow);
            }

            if (File.Exists(ReportUtility.ResolveReportPath(ReportConstants.JEWELMASTERREPORTPATH)))
            {
                var reportDocument = new ReportDocument();
                reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.JEWELMASTERREPORTPATH));

                crystalReportViewer.ReportSource = null;
                crystalReportViewer.ReportSource = reportDocument;
                reportDocument.SetDataSource(jewelMasterDataSet);
                crystalReportViewer.Refresh();
            }
        }
コード例 #4
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            var     reportDocument = new ReportDocument();
            var     reportType     = ((LocalStore.MasterReportItems)(cboMasterReportType.SelectedItem)).ReportType;
            DataSet reportDataSet;

            switch (reportType)
            {
            case ReportType.Configuration:
                reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.CONFIGURATIONREPORTPATH));
                reportDataSet = GetConfigurationsReport();
                break;

            case ReportType.Customer:
                reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.CUSTOMERSREPORTPATH));
                reportDataSet = GetCustomersReport(((CustomerItem)(cboSelectedReport.SelectedItem)).CustomerCode);
                break;

            case ReportType.Supplier:
                reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.SUPPLIERSREPORTPATH));
                reportDataSet = GetSuppliersReport(((SupplierItem)(cboSelectedReport.SelectedItem)).SupplierCode);
                break;

            case ReportType.User:
                reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.USERSREPORTPATH));
                reportDataSet = GetUsersReport();
                break;

            default:
                throw new NotImplementedException();
            }


            crystalReportViewer1.ReportSource = reportDocument;
            reportDocument.SetDataSource(reportDataSet);
            crystalReportViewer1.Refresh();
        }
コード例 #5
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            var jewelStockDataSet          = new JewelStockDataSet();
            var jewelStockDataTable        = jewelStockDataSet.Tables["JewelStockLedger"];
            var firmDataTable              = jewelStockDataSet.Tables["FirmMaster"];
            var jewelStockSummaryDataTable = jewelStockDataSet.Tables["JewelStockSummary"];

            _firmDataSetService.GetFirmDataTable(firmDataTable);

            IQueryable <JewelStockLedger> jewelStockList; JewelItemCategory metalType;
            var stoneType = cboStoneType.SelectedItem.ToString();

            Enum.TryParse(cboKT.SelectedItem.ToString(), out metalType);

            if (metalType == JewelItemCategory.NotSet && cboStoneType.SelectedItem.ToString() == ALL)
            {
                jewelStockList = _transactionsServices.GetJewelStockLedgers();
            }
            else if (metalType != JewelItemCategory.NotSet && cboStoneType.SelectedItem.ToString() == ALL)
            {
                jewelStockList = _transactionsServices.GetJewelStockLedgers()
                                 .Where(tr => tr.JewelItemCategory_Enum == (int)metalType);
            }
            else
            {
                jewelStockList = _transactionsServices.GetJewelStockLedgers()
                                 .Where(tr => tr.JewelItemCategory_Enum == (short)metalType && tr.JewelType == stoneType);
            }

            int counter = 1;

            var list = jewelStockList.Where(x => x.StockStatus_Enum == (short)StockStatus.ItemIsInStock).ToList();

            foreach (var jewel in list)
            {
                var jewelRow = jewelStockDataTable.NewRow();
                jewelRow["SrNo"] = counter;
                jewelRow["JewelStockMasterId"] = jewel.JewelStockMasterId;
                jewelRow["JewelNumber"]        = jewel.JewelNumber;
                jewelRow["DesignCode"]         = jewel.DesignCode;
                jewelRow["TotalWeight"]        = jewel.TotalWeight;
                jewelRow["MetalType"]          = jewel.JewelItemCategory;
                jewelRow["KT"]            = jewel.KT;
                jewelRow["StoneType"]     = jewel.JewelType;
                jewelRow["MetalWeight"]   = jewel.MetalWeight;
                jewelRow["StoneWeight"]   = jewel.StoneWeight;
                jewelRow["StonePcs"]      = jewel.StonePcs;
                jewelRow["ColorStonePcs"] = jewel.CStonePcs;
                jewelRow["ColorStoneWt"]  = jewel.CStoneWeight;

                jewelStockDataTable.Rows.Add(jewelRow);

                counter = counter + 1;
            }

            var summaryRow = jewelStockSummaryDataTable.NewRow();

            summaryRow["TotalInStock"]    = jewelStockList.Count(x => x.StockStatus_Enum == (short)StockStatus.ItemIsInStock);
            summaryRow["TotalOutOfStock"] = jewelStockList.Count(x => x.JewelState_Enum == (short)JewelState.OnMarketing && x.StockStatus_Enum == (short)StockStatus.ItemLockedInStock);
            summaryRow["TotalOnApproval"] = jewelStockList.Count(x => x.JewelState_Enum == (short)JewelState.OnApproval && x.StockStatus_Enum == (short)StockStatus.ItemOutOfStock);
            jewelStockSummaryDataTable.Rows.Add(summaryRow);

            var reportDocument = new ReportDocument();

            reportDocument.Load(ReportUtility.ResolveReportPath(ReportConstants.JEWELSTOCKREPORTPATH));
            crystalReportViewer1.ReportSource = reportDocument;
            reportDocument.SetDataSource(jewelStockDataSet);
            crystalReportViewer1.Refresh();
        }