private void GenerateBarcodeTag(JewelMaster entity)
        {
            var jewelMasterDataSet = new JewelMasterDataSet();

            var barcode        = new BarcodeUtility();
            var jewelImage     = barcode.MakeBarcodeImage(entity.JewelNo);
            var jewelMasterRow = jewelMasterDataSet.Tables["JewelMaster"].NewRow();

            jewelMasterRow["JewelId"]          = entity.JewelId;
            jewelMasterRow["JewelNo"]          = entity.JewelNo;
            jewelMasterRow["StyleNo"]          = entity.StyleNo;
            jewelMasterRow["JewelDescription"] = entity.JewelDescription;
            jewelMasterRow["MetalColor"]       = entity.MetalColor;
            jewelMasterRow["ImagePath"]        = ImageExtension.GetImageName(entity.StyleNo);
            jewelMasterRow["DiamondPcs"]       = Convert.ToString(entity.DiamondPcs);
            jewelMasterRow["DiamondWt"]        = Convert.ToString(entity.DiamondWt);
            jewelMasterRow["GrsWt"]            = Convert.ToString(entity.GrsWt);
            jewelMasterRow["NetWt"]            = Convert.ToString(entity.NetWt);
            jewelMasterRow["JewelImage"]       = ImageConverterHelper.ImageToByteArray(jewelImage);

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

            if (!File.Exists(Application.StartupPath + @"\" + ReportConstants.JEWELMASTERREPORTPATH))
            {
                return;
            }

            var reportDocument = new ReportDocument();

            reportDocument.Load(Application.StartupPath + @"\" + ReportConstants.JEWELMASTERREPORTPATH);
            reportDocument.SetDataSource(jewelMasterDataSet);
            crystalReportViewer1.ReportSource = reportDocument;
            crystalReportViewer1.Refresh();
        }
Example #2
0
        public void ShowStickerReport(IEnumerable <String> jewelNumbers)
        {
            var jewelStickerDataSet = new JewelStickerDataSet();

            foreach (var jewelNo in jewelNumbers)
            {
                var jewel = _transactionService.GetJewelStockByJewelNo(jewelNo.Trim());
                if (jewel == null)
                {
                    continue;
                }

                var jewelMasterRow = jewelStickerDataSet.Tables["JewelSticker"].NewRow();

                jewelMasterRow["JewelNumber"] = jewel.JewelNumber;
                jewelMasterRow["DesignCode"]  = jewel.DesignCode;
                jewelMasterRow["NetWeight"]   = jewel.MetalWeight;
                jewelMasterRow["GrossWeight"] = jewel.TotalWeight;
                jewelMasterRow["StoneWeight"] = jewel.StoneWeight;
                jewelMasterRow["StonePcs"]    = jewel.StonePcs;
                jewelMasterRow["JewelImage"]  = ImageConverterHelper.ImageToByteArray(ImageExtension.ResolveImage(jewel.DesignCode));

                jewelStickerDataSet.Tables["JewelSticker"].Rows.Add(jewelMasterRow);
            }

            var orderReport = new frmReport
            {
                ReportPath    = ResolveReportPath(ReportConstants.JewelStickerReport),
                ReportDataSet = jewelStickerDataSet
            };

            orderReport.Show();
        }
Example #3
0
        private void btnGenerateBarcode_Click(object sender, EventArgs e)
        {
            if (!SelectedJewels.Any())
            {
                MessageBox.Show(Resources.frmAllJewelsBarcodePrint_btnGenerateBarcode_Click_No_Jewel_selected_for_report_, "No Jewel selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

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

            foreach (var jewel in SelectedJewels)
            {
                //Add data to crystal report.
                var jewelImage     = barcode.MakeBarcodeImage(jewel.JewelNo);
                var jewelMasterRow = jewelMasterDataSet.Tables["JewelMaster"].NewRow();

                jewelMasterRow["JewelId"]          = jewel.JewelId;
                jewelMasterRow["JewelNo"]          = jewel.JewelNo;
                jewelMasterRow["StyleNo"]          = jewel.StyleNo;
                jewelMasterRow["JewelDescription"] = jewel.JewelDescription;
                jewelMasterRow["MetalColor"]       = jewel.MetalColor;
                jewelMasterRow["ImagePath"]        = ImageExtension.GetImageName(jewel.StyleNo);
                jewelMasterRow["DiamondPcs"]       = Convert.ToString(jewel.DiamondPcs);
                jewelMasterRow["DiamondWt"]        = Convert.ToString(jewel.DiamondWt);
                jewelMasterRow["GrsWt"]            = Convert.ToString(jewel.GrsWt);
                jewelMasterRow["NetWt"]            = Convert.ToString(jewel.NetWt);
                jewelMasterRow["JewelImage"]       = ImageConverterHelper.ImageToByteArray(jewelImage);

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

            if (File.Exists(Application.StartupPath + @"\" + ReportConstants.JEWELMASTERREPORTPATH))
            {
                var reportDocument = new ReportDocument();
                reportDocument.Load(Application.StartupPath + @"\" + ReportConstants.JEWELMASTERREPORTPATH);

                crystalReportViewer1.ReportSource = null;
                crystalReportViewer1.ReportSource = reportDocument;
                reportDocument.SetDataSource(jewelMasterDataSet);
                crystalReportViewer1.Refresh();
            }
        }
Example #4
0
        public void ShowBarcodeTag(IEnumerable <String> jewelNumbers)
        {
            var jewelMasterDataSet = new JewelMasterDataSet();
            var barcode            = new BarcodeUtility();

            foreach (var jewel in jewelNumbers)
            {
                var jeweltran = _transactionService.GetJewelStockByJewelNo(jewel);
                if (jeweltran == null)
                {
                    continue;
                }

                var jewelImage     = barcode.MakeBarcodeImage(jeweltran.JewelNumber);
                var jewelMasterRow = jewelMasterDataSet.Tables["JewelMaster"].NewRow();

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

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

            var orderReport = new frmReport
            {
                ReportPath    = ResolveReportPath(ReportConstants.JEWELMASTERREPORTPATH),
                ReportDataSet = jewelMasterDataSet
            };

            orderReport.Show();
        }
Example #5
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();
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsValid == false)
            {
                MessageBox.Show(AllErrors.ErrorMessageString(), Constants.ALERTMESSAGEHEADER);
                return;
            }
            if (txtEmail.Text != String.Empty && !Regex.IsMatch(txtEmail.Text, Constants.EMAILPATTERN))
            {
                txtEmail.Focus();
                MessageBox.Show(Resources.frmFirmMaster_btnSave_Click_Please_Enter_Valid_Email_Address_, Constants.ALERTMESSAGEHEADER);
                return;
            }

            if (!txtTAX.Text.IsEmpty() && !txtTAX.Text.IsDecimal())
            {
                MessageBox.Show(Resources.frmFirmMaster_btnSave_Click_Invalid_TAX_field, Constants.ALERTMESSAGEHEADER);
                return;
            }

            if (!txtOtherTAX.Text.IsEmpty() && !txtOtherTAX.Text.IsDecimal())
            {
                MessageBox.Show(Resources.frmFirmMaster_btnSave_Click_Invalid_Other_TAX_field, Constants.ALERTMESSAGEHEADER);
                return;
            }

            if (!txtLogo.Text.IsEmpty() && !File.Exists(txtLogo.Text))
            {
                MessageBox.Show(Resources.frmFirmMaster_btnSave_Click_Invalid_file_Logo_path_, Constants.ALERTMESSAGEHEADER);
                return;
            }

            var firmInfo = _firmService.GetFrimMaster();

            var firmMaster = new FirmMaster
            {
                FirmName           = txtName.Text,
                FirmEmail          = txtEmail.Text,
                FirmHeader         = txtHeaderOrSlogan.Text,
                FirmWebsite        = txtWebsite.Text,
                FirmVATNumber      = txtVATNumber.Text,
                FirmTINNumber      = txtTINNumber.Text,
                FirmTopHeader      = txtTopHeader.Text,
                FirmAddress        = txtAddress.Text,
                FirmAdditionalInfo = txtAdditionalInformation.Text,
                Tax      = Convert.ToDecimal(txtTAX.Text),
                OtherTax = Convert.ToDecimal(txtOtherTAX.Text),
            };

            if (firmInfo != null)
            {
                firmMaster.FirmMasterId = firmInfo.FirmMasterId;
            }

            if (File.Exists(txtLogo.Text))
            {
                var imageIn = Image.FromFile(txtLogo.Text);
                File.ReadAllBytes(txtLogo.Text);
                firmMaster.FirmLogo = ImageConverterHelper.ImageToByteArray(imageIn);
            }

            var firmRequest = new FirmMasterRequest
            {
                FirmMaster = firmMaster
            };

            _firmService.SaveFirm(firmRequest);
            BindForm();
        }