/// <summary>
        /// Dotmatrix print function add the details to fill here
        /// </summary>
        /// <param name="decPaymentMasterId"></param>
        public void PrintForDotMatrix(decimal decPaymentMasterId)
        {
            try
            {

                DataTable dtblOtherDetails = new DataTable();
                CompanySP spComapany = new CompanySP();
                dtblOtherDetails = spComapany.CompanyViewForDotMatrix();
                DataTable dtblGridDetails = new DataTable();
                dtblGridDetails.Columns.Add("SlNo");
                dtblGridDetails.Columns.Add("Account Ledger");
                dtblGridDetails.Columns.Add("Amount");
                dtblGridDetails.Columns.Add("Currency");
                dtblGridDetails.Columns.Add("Cheque No");
                dtblGridDetails.Columns.Add("Cheque Date");
                int inRowCount = 0;
                foreach (DataGridViewRow dRow in dgvPaymentVoucher.Rows)
                {
                    if (dRow.HeaderCell.Value != null && dRow.HeaderCell.Value.ToString() != "X")
                    {
                        if (!dRow.IsNewRow)
                        {
                            DataRow dr = dtblGridDetails.NewRow();
                            dr["SlNo"] = ++inRowCount;
                            dr["Account Ledger"] = dRow.Cells["dgvcmbAccountLedger"].FormattedValue.ToString();
                            dr["Amount"] = dRow.Cells["dgvtxtAmount"].Value.ToString();
                            dr["Currency"] = dRow.Cells["dgvcmbCurrency"].FormattedValue.ToString();
                            dr["Cheque No"] = (dRow.Cells["dgvtxtChequeNo"].Value == null ? "" : dRow.Cells["dgvtxtChequeNo"].Value.ToString());
                            dr["Cheque Date"] = (dRow.Cells["dgvtxtChequeDate"].Value == null ? "" : dRow.Cells["dgvtxtChequeDate"].Value.ToString());
                            dtblGridDetails.Rows.Add(dr);
                        }
                    }
                }
                dtblOtherDetails.Columns.Add("voucherNo");
                dtblOtherDetails.Columns.Add("date");
                dtblOtherDetails.Columns.Add("totalAmount");
                dtblOtherDetails.Columns.Add("ledgerName");
                dtblOtherDetails.Columns.Add("Narration");
                dtblOtherDetails.Columns.Add("AmountInWords");
                dtblOtherDetails.Columns.Add("Declaration");
                dtblOtherDetails.Columns.Add("Heading1");
                dtblOtherDetails.Columns.Add("Heading2");
                dtblOtherDetails.Columns.Add("Heading3");
                dtblOtherDetails.Columns.Add("Heading4");
                DataRow dRowOther = dtblOtherDetails.Rows[0];
                dRowOther["voucherNo"] = txtVoucherNo.Text;
                dRowOther["date"] = txtDate.Text;
                dRowOther["totalAmount"] = txtTotal.Text;
                dRowOther["ledgerName"] = cmbBankorCash.Text;
                dRowOther["Narration"] = txtNarration.Text;
                dRowOther["AmountInWords"] = new NumToText().AmountWords(Convert.ToDecimal(txtTotal.Text), PublicVariables._decCurrencyId);
                dRowOther["address"] = (dtblOtherDetails.Rows[0]["address"].ToString().Replace("\n", ", ")).Replace("\r", "");
                VoucherTypeSP spVoucherType = new VoucherTypeSP();
                DataTable dtblDeclaration = spVoucherType.DeclarationAndHeadingGetByVoucherTypeId(decPaymentVoucherTypeId);
                dRowOther["Declaration"] = dtblDeclaration.Rows[0]["Declaration"].ToString();
                dRowOther["Heading1"] = dtblDeclaration.Rows[0]["Heading1"].ToString();
                dRowOther["Heading2"] = dtblDeclaration.Rows[0]["Heading2"].ToString();
                dRowOther["Heading3"] = dtblDeclaration.Rows[0]["Heading3"].ToString();
                dRowOther["Heading4"] = dtblDeclaration.Rows[0]["Heading4"].ToString();
                int inFormId = spVoucherType.FormIdGetForPrinterSettings(Convert.ToInt32(dtblDeclaration.Rows[0]["masterId"].ToString()));
                PrintWorks.DotMatrixPrint.PrintDesign(inFormId, dtblOtherDetails, dtblGridDetails, dtblOtherDetails);
            }
            catch (Exception ex)
            {
                MessageBox.Show("PV:11" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Print function for dotmatrix printer
 /// </summary>
 /// <param name="decSalesMasterId"></param>
 public void PrintForDotMatrix(decimal decSalesMasterId)
 {
     try
     {
         DataTable dtblOtherDetails = new DataTable();
         CompanySP spComapany = new CompanySP();
         dtblOtherDetails = spComapany.CompanyViewForDotMatrix();
         DataTable dtblGridDetails = new DataTable();
         dtblGridDetails.Columns.Add("SlNo");
         dtblGridDetails.Columns.Add("BarCode");
         dtblGridDetails.Columns.Add("ProductCode");
         dtblGridDetails.Columns.Add("ProductName");
         dtblGridDetails.Columns.Add("Qty");
         dtblGridDetails.Columns.Add("Unit");
         dtblGridDetails.Columns.Add("Godown");
         dtblGridDetails.Columns.Add("Brand");
         dtblGridDetails.Columns.Add("Tax");
         dtblGridDetails.Columns.Add("TaxAmount");
         dtblGridDetails.Columns.Add("NetAmount");
         dtblGridDetails.Columns.Add("DiscountAmount");
         dtblGridDetails.Columns.Add("DiscountPercentage");
         dtblGridDetails.Columns.Add("SalesRate");
         dtblGridDetails.Columns.Add("PurchaseRate");
         dtblGridDetails.Columns.Add("MRP");
         dtblGridDetails.Columns.Add("Rack");
         dtblGridDetails.Columns.Add("Batch");
         dtblGridDetails.Columns.Add("Rate");
         dtblGridDetails.Columns.Add("Amount");
         int inRowCount = 0;
         foreach (DataGridViewRow dRow in dgvSalesInvoice.Rows)
         {
             if (!dRow.IsNewRow)
             {
                 DataRow dr = dtblGridDetails.NewRow();
                 dr["SlNo"] = ++inRowCount;
                 if (dRow.Cells["dgvtxtSalesInvoiceBarcode"].Value != null)
                 {
                     dr["BarCode"] = dRow.Cells["dgvtxtSalesInvoiceBarcode"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceProductCode"].Value != null)
                 {
                     dr["ProductCode"] = dRow.Cells["dgvtxtSalesInvoiceProductCode"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceProductName"].Value != null)
                 {
                     dr["ProductName"] = dRow.Cells["dgvtxtSalesInvoiceProductName"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceQty"].Value != null)
                 {
                     dr["Qty"] = dRow.Cells["dgvtxtSalesInvoiceQty"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoicembUnitName"].Value != null)
                 {
                     dr["Unit"] = dRow.Cells["dgvtxtSalesInvoicembUnitName"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbSalesInvoiceGodown"].Value != null)
                 {
                     dr["Godown"] = dRow.Cells["dgvcmbSalesInvoiceGodown"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbSalesInvoiceRack"].Value != null)
                 {
                     dr["Rack"] = dRow.Cells["dgvcmbSalesInvoiceRack"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbSalesInvoiceBatch"].Value != null)
                 {
                     dr["Batch"] = dRow.Cells["dgvcmbSalesInvoiceBatch"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceRate"].Value != null)
                 {
                     dr["Rate"] = dRow.Cells["dgvtxtSalesInvoiceRate"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceAmount"].Value != null)
                 {
                     dr["Amount"] = dRow.Cells["dgvtxtSalesInvoiceAmount"].Value.ToString();
                 }
                 if (dRow.Cells["dgvcmbSalesInvoiceTaxName"].Value != null)
                 {
                     dr["Tax"] = dRow.Cells["dgvcmbSalesInvoiceTaxName"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceBrand"].Value != null)
                 {
                     dr["Brand"] = dRow.Cells["dgvtxtSalesInvoiceBrand"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceTaxAmount"].Value != null)
                 {
                     dr["TaxAmount"] = dRow.Cells["dgvtxtSalesInvoiceTaxAmount"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceNetAmount"].Value != null)
                 {
                     dr["NetAmount"] = dRow.Cells["dgvtxtSalesInvoiceNetAmount"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceDiscountAmount"].Value != null)
                 {
                     dr["DiscountAmount"] = dRow.Cells["dgvtxtSalesInvoiceDiscountAmount"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceDiscountPercentage"].Value != null)
                 {
                     dr["DiscountPercentage"] = dRow.Cells["dgvtxtSalesInvoiceDiscountPercentage"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceSalesRate"].Value != null)
                 {
                     dr["SalesRate"] = dRow.Cells["dgvtxtSalesInvoiceSalesRate"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoicePurchaseRate"].Value != null)
                 {
                     dr["PurchaseRate"] = dRow.Cells["dgvtxtSalesInvoicePurchaseRate"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtSalesInvoiceMrp"].Value != null)
                 {
                     dr["MRP"] = dRow.Cells["dgvtxtSalesInvoiceMrp"].Value.ToString();
                 }
                 dtblGridDetails.Rows.Add(dr);
             }
         }
         dtblOtherDetails.Columns.Add("voucherNo");
         dtblOtherDetails.Columns.Add("date");
         dtblOtherDetails.Columns.Add("ledgerName");
         dtblOtherDetails.Columns.Add("SalesMode");
         dtblOtherDetails.Columns.Add("SalesAccount");
         dtblOtherDetails.Columns.Add("SalesMan");
         dtblOtherDetails.Columns.Add("CreditPeriod");
         dtblOtherDetails.Columns.Add("VoucherType");
         dtblOtherDetails.Columns.Add("PricingLevel");
         dtblOtherDetails.Columns.Add("Customer");
         dtblOtherDetails.Columns.Add("CustomerAddress");
         dtblOtherDetails.Columns.Add("CustomerTIN");
         dtblOtherDetails.Columns.Add("CustomerCST");
         dtblOtherDetails.Columns.Add("Narration");
         dtblOtherDetails.Columns.Add("Currency");
         dtblOtherDetails.Columns.Add("TotalAmount");
         dtblOtherDetails.Columns.Add("BillDiscount");
         dtblOtherDetails.Columns.Add("GrandTotal");
         dtblOtherDetails.Columns.Add("AmountInWords");
         dtblOtherDetails.Columns.Add("Declaration");
         dtblOtherDetails.Columns.Add("Heading1");
         dtblOtherDetails.Columns.Add("Heading2");
         dtblOtherDetails.Columns.Add("Heading3");
         dtblOtherDetails.Columns.Add("Heading4");
         DataRow dRowOther = dtblOtherDetails.Rows[0];
         dRowOther["voucherNo"] = txtInvoiceNo.Text;
         dRowOther["date"] = txtDate.Text;
         dRowOther["ledgerName"] = cmbCashOrParty.Text;
         dRowOther["Narration"] = txtNarration.Text;
         dRowOther["Currency"] = cmbCurrency.Text;
         dRowOther["SalesMode"] = cmbSalesMode.Text;
         dRowOther["SalesAccount"] = cmbSalesAccount.Text;
         dRowOther["SalesMan"] = cmbSalesMan.SelectedText;
         dRowOther["CreditPeriod"] = (txtCreditPeriod.Text) + " Days";
         dRowOther["PricingLevel"] = cmbPricingLevel.Text;
         dRowOther["Customer"] = txtCustomer.Text;
         dRowOther["BillDiscount"] = txtBillDiscount.Text;
         dRowOther["GrandTotal"] = txtGrandTotal.Text;
         dRowOther["TotalAmount"] = txtTotalAmount.Text;
         dRowOther["VoucherType"] = cmbVoucherType.Text;
         dRowOther["address"] = (dtblOtherDetails.Rows[0]["address"].ToString().Replace("\n", ", ")).Replace("\r", "");
         AccountLedgerSP spAccountLedger = new AccountLedgerSP();
         AccountLedgerInfo infoAccountLedger = new AccountLedgerInfo();
         infoAccountLedger = spAccountLedger.AccountLedgerView(Convert.ToDecimal(cmbCashOrParty.SelectedValue));
         dRowOther["CustomerAddress"] = (infoAccountLedger.Address.ToString().Replace("\n", ", ")).Replace("\r", "");
         dRowOther["CustomerTIN"] = infoAccountLedger.Tin;
         dRowOther["CustomerCST"] = infoAccountLedger.Cst;
         dRowOther["AmountInWords"] = new NumToText().AmountWords(Convert.ToDecimal(txtGrandTotal.Text), PublicVariables._decCurrencyId);
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         DataTable dtblDeclaration = spVoucherType.DeclarationAndHeadingGetByVoucherTypeId(DecSalesInvoiceVoucherTypeId);
         dRowOther["Declaration"] = dtblDeclaration.Rows[0]["Declaration"].ToString();
         dRowOther["Heading1"] = dtblDeclaration.Rows[0]["Heading1"].ToString();
         dRowOther["Heading2"] = dtblDeclaration.Rows[0]["Heading2"].ToString();
         dRowOther["Heading3"] = dtblDeclaration.Rows[0]["Heading3"].ToString();
         dRowOther["Heading4"] = dtblDeclaration.Rows[0]["Heading4"].ToString();
         int inFormId = spVoucherType.FormIdGetForPrinterSettings(Convert.ToInt32(dtblDeclaration.Rows[0]["masterId"].ToString()));
         PrintWorks.DotMatrixPrint.PrintDesign(inFormId, dtblOtherDetails, dtblGridDetails, dtblOtherDetails);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI: 74" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Adding columns to print
 /// </summary>
 /// <param name="decDeliveryNoteMasterId"></param>
 public void PrintForDotMatrix(decimal decDeliveryNoteMasterId)
 {
     try
     {
         DataTable dtblOtherDetails = new DataTable();
         CompanySP spComapany = new CompanySP();
         dtblOtherDetails = spComapany.CompanyViewForDotMatrix();
         //-------------Grid Details-------------------\\
         DataTable dtblGridDetails = new DataTable();
         dtblGridDetails.Columns.Add("SlNo");
         dtblGridDetails.Columns.Add("BarCode");
         dtblGridDetails.Columns.Add("ProductCode");
         dtblGridDetails.Columns.Add("ProductName");
         dtblGridDetails.Columns.Add("Qty");
         dtblGridDetails.Columns.Add("Unit");
         dtblGridDetails.Columns.Add("Godown");
         dtblGridDetails.Columns.Add("Rack");
         dtblGridDetails.Columns.Add("Batch");
         dtblGridDetails.Columns.Add("Rate");
         dtblGridDetails.Columns.Add("Amount");
         int inRowCount = 0;
         foreach (DataGridViewRow dRow in dgvProduct.Rows)
         {
             if (!dRow.IsNewRow)
             {
                 DataRow dr = dtblGridDetails.NewRow();
                 dr["SlNo"] = ++inRowCount;
                 if (dRow.Cells["dgvtxtBarcode"].Value != null)
                 {
                     dr["BarCode"] = dRow.Cells["dgvtxtBarcode"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtProductCode"].Value != null)
                 {
                     dr["ProductCode"] = dRow.Cells["dgvtxtProductCode"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtProductName"].Value != null)
                 {
                     dr["ProductName"] = dRow.Cells["dgvtxtProductName"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtQty"].Value != null)
                 {
                     dr["Qty"] = dRow.Cells["dgvtxtQty"].Value.ToString();
                 }
                 if (dRow.Cells["dgvcmbUnit"].Value != null)
                 {
                     dr["Unit"] = dRow.Cells["dgvcmbUnit"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbGodown"].Value != null)
                 {
                     dr["Godown"] = dRow.Cells["dgvcmbGodown"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbRack"].Value != null)
                 {
                     dr["Rack"] = dRow.Cells["dgvcmbRack"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbBatch"].Value != null)
                 {
                     dr["Batch"] = dRow.Cells["dgvcmbBatch"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvtxtRate"].Value != null)
                 {
                     dr["Rate"] = dRow.Cells["dgvtxtRate"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtAmount"].Value != null)
                 {
                     dr["Amount"] = dRow.Cells["dgvtxtAmount"].Value.ToString();
                 }
                 dtblGridDetails.Rows.Add(dr);
             }
         }
         //-------------Other Details-------------------\\
         dtblOtherDetails.Columns.Add("voucherNo");
         dtblOtherDetails.Columns.Add("date");
         dtblOtherDetails.Columns.Add("ledgerName");
         dtblOtherDetails.Columns.Add("Narration");
         dtblOtherDetails.Columns.Add("Currency");
         dtblOtherDetails.Columns.Add("TotalAmount");
         dtblOtherDetails.Columns.Add("DeliveryMode");
         dtblOtherDetails.Columns.Add("PricingLevel");
         dtblOtherDetails.Columns.Add("Type");
         dtblOtherDetails.Columns.Add("SalesMan");
         dtblOtherDetails.Columns.Add("CustomerAddress");
         dtblOtherDetails.Columns.Add("CustomerTIN");
         dtblOtherDetails.Columns.Add("CustomerCST");
         dtblOtherDetails.Columns.Add("AmountInWords");
         dtblOtherDetails.Columns.Add("Declaration");
         dtblOtherDetails.Columns.Add("Heading1");
         dtblOtherDetails.Columns.Add("Heading2");
         dtblOtherDetails.Columns.Add("Heading3");
         dtblOtherDetails.Columns.Add("Heading4");
         DataRow dRowOther = dtblOtherDetails.Rows[0];
         dRowOther["voucherNo"] = txtDeliveryNoteNo.Text;
         dRowOther["date"] = txtDate.Text;
         dRowOther["ledgerName"] = cmbCashOrParty.Text;
         dRowOther["Narration"] = txtNarration.Text;
         dRowOther["Currency"] = cmbCurrency.Text;
         dRowOther["TotalAmount"] = txtTotalAmnt.Text;
         dRowOther["DeliveryMode"] = cmbDeliveryMode.Text;
         dRowOther["PricingLevel"] = cmbPricingLevel.Text;
         dRowOther["Type"] = cmbType.Text;
         dRowOther["SalesMan"] = cmbSalesMan.Text;
         dRowOther["address"] = (dtblOtherDetails.Rows[0]["address"].ToString().Replace("\n", ", ")).Replace("\r", "");
         AccountLedgerSP spAccountLedger = new AccountLedgerSP();
         AccountLedgerInfo infoAccountLedger = new AccountLedgerInfo();
         infoAccountLedger = spAccountLedger.AccountLedgerView(Convert.ToDecimal(cmbCashOrParty.SelectedValue));
         dRowOther["CustomerAddress"] = (infoAccountLedger.Address.ToString().Replace("\n", ", ")).Replace("\r", "");
         dRowOther["CustomerTIN"] = infoAccountLedger.Tin;
         dRowOther["CustomerCST"] = infoAccountLedger.Cst;
         dRowOther["AmountInWords"] = new NumToText().AmountWords(Convert.ToDecimal(txtTotalAmnt.Text), PublicVariables._decCurrencyId);
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         DataTable dtblDeclaration = spVoucherType.DeclarationAndHeadingGetByVoucherTypeId(decDeliveryNoteVoucherTypeId);
         dRowOther["Declaration"] = dtblDeclaration.Rows[0]["Declaration"].ToString();
         dRowOther["Heading1"] = dtblDeclaration.Rows[0]["Heading1"].ToString();
         dRowOther["Heading2"] = dtblDeclaration.Rows[0]["Heading2"].ToString();
         dRowOther["Heading3"] = dtblDeclaration.Rows[0]["Heading3"].ToString();
         dRowOther["Heading4"] = dtblDeclaration.Rows[0]["Heading4"].ToString();
         int inFormId = spVoucherType.FormIdGetForPrinterSettings(Convert.ToInt32(dtblDeclaration.Rows[0]["masterId"].ToString()));
         PrintWorks.DotMatrixPrint.PrintDesign(inFormId, dtblOtherDetails, dtblGridDetails, dtblOtherDetails);
     }
     catch (Exception ex)
     {
         MessageBox.Show("DN41:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// print function for dotmatrix printer
 /// </summary>
 /// <param name="decPhysicalStockMasterId"></param>
 public void PrintForDotMatrix(decimal decPhysicalStockMasterId)
 {
     try
     {
         DataTable dtblOtherDetails = new DataTable();
         CompanySP spComapany = new CompanySP();
         dtblOtherDetails = spComapany.CompanyViewForDotMatrix();
         DataTable dtblGridDetails = new DataTable();
         dtblGridDetails.Columns.Add("SlNo");
         dtblGridDetails.Columns.Add("BarCode");
         dtblGridDetails.Columns.Add("ProductCode");
         dtblGridDetails.Columns.Add("ProductName");
         dtblGridDetails.Columns.Add("Qty");
         dtblGridDetails.Columns.Add("Unit");
         dtblGridDetails.Columns.Add("Godown");
         dtblGridDetails.Columns.Add("Rack");
         dtblGridDetails.Columns.Add("Batch");
         dtblGridDetails.Columns.Add("Rate");
         dtblGridDetails.Columns.Add("Amount");
         int inRowCount = 0;
         foreach (DataGridViewRow dRow in dgvPhysicalStock.Rows)
         {
             if (!dRow.IsNewRow)
             {
                 DataRow dr = dtblGridDetails.NewRow();
                 dr["SlNo"] = ++inRowCount;
                 if (dRow.Cells["dgvtxtBarcode"].Value != null)
                 {
                     dr["BarCode"] = dRow.Cells["dgvtxtBarcode"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtProductCode"].Value != null)
                 {
                     dr["ProductCode"] = dRow.Cells["dgvtxtProductCode"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtProductName"].Value != null)
                 {
                     dr["ProductName"] = dRow.Cells["dgvtxtProductName"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtQty"].Value != null)
                 {
                     dr["Qty"] = dRow.Cells["dgvtxtQty"].Value.ToString();
                 }
                 if (dRow.Cells["dgvcmbUnit"].Value != null)
                 {
                     dr["Unit"] = dRow.Cells["dgvcmbUnit"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbGodown"].Value != null)
                 {
                     dr["Godown"] = dRow.Cells["dgvcmbGodown"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbRack"].Value != null)
                 {
                     dr["Rack"] = dRow.Cells["dgvcmbRack"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvcmbBatch"].Value != null)
                 {
                     dr["Batch"] = dRow.Cells["dgvcmbBatch"].FormattedValue.ToString();
                 }
                 if (dRow.Cells["dgvtxtRate"].Value != null)
                 {
                     dr["Rate"] = dRow.Cells["dgvtxtRate"].Value.ToString();
                 }
                 if (dRow.Cells["dgvtxtAmount"].Value != null)
                 {
                     dr["Amount"] = dRow.Cells["dgvtxtAmount"].Value.ToString();
                 }
                 dtblGridDetails.Rows.Add(dr);
             }
         }
         dtblOtherDetails.Columns.Add("voucherNo");
         dtblOtherDetails.Columns.Add("date");
         dtblOtherDetails.Columns.Add("Narration");
         dtblOtherDetails.Columns.Add("TotalAmount");
         dtblOtherDetails.Columns.Add("AmountInWords");
         dtblOtherDetails.Columns.Add("Declaration");
         dtblOtherDetails.Columns.Add("Heading1");
         dtblOtherDetails.Columns.Add("Heading2");
         dtblOtherDetails.Columns.Add("Heading3");
         dtblOtherDetails.Columns.Add("Heading4");
         DataRow dRowOther = dtblOtherDetails.Rows[0];
         dRowOther["voucherNo"] = txtVoucherNo.Text;
         dRowOther["date"] = txtDate.Text;
         dRowOther["Narration"] = txtNarration.Text;
         dRowOther["TotalAmount"] = txtTotalAmount.Text;
         dRowOther["address"] = (dtblOtherDetails.Rows[0]["address"].ToString().Replace("\n", ", ")).Replace("\r", "");
         dRowOther["AmountInWords"] = new NumToText().AmountWords(Convert.ToDecimal(txtTotalAmount.Text), PublicVariables._decCurrencyId);
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         DataTable dtblDeclaration = spVoucherType.DeclarationAndHeadingGetByVoucherTypeId(decPhysicalStockVoucherTypeId);
         dRowOther["Declaration"] = dtblDeclaration.Rows[0]["Declaration"].ToString();
         dRowOther["Heading1"] = dtblDeclaration.Rows[0]["Heading1"].ToString();
         dRowOther["Heading2"] = dtblDeclaration.Rows[0]["Heading2"].ToString();
         dRowOther["Heading3"] = dtblDeclaration.Rows[0]["Heading3"].ToString();
         dRowOther["Heading4"] = dtblDeclaration.Rows[0]["Heading4"].ToString();
         int inFormId = spVoucherType.FormIdGetForPrinterSettings(Convert.ToInt32(dtblDeclaration.Rows[0]["masterId"].ToString()));
         PrintWorks.DotMatrixPrint.PrintDesign(inFormId, dtblOtherDetails, dtblGridDetails, dtblOtherDetails);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PS:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 public void PrintForDotMatrix(decimal decServiceMasterId)
 {
     try
     {
         DataTable dtblOtherDetails = new DataTable();
         CompanySP spComapany = new CompanySP();
         dtblOtherDetails = spComapany.CompanyViewForDotMatrix();
         //-------------Grid Details-------------------\\
         DataTable dtblGridDetails = new DataTable();
         dtblGridDetails.Columns.Add("SlNo");
         dtblGridDetails.Columns.Add("Particulars");
         dtblGridDetails.Columns.Add("Measure");
         dtblGridDetails.Columns.Add("Amount");
         int inRowCount = 0;
         foreach (DataGridViewRow dRow in dgvServiceVoucher.Rows)
         {
             if (dRow.HeaderCell.Value != null && dRow.HeaderCell.Value.ToString() != "X")
             {
                 if (!dRow.IsNewRow)
                 {
                     DataRow dr = dtblGridDetails.NewRow();
                     dr["SlNo"] = ++inRowCount;
                     dr["Particulars"] = dRow.Cells["dgvcmbParticulars"].FormattedValue.ToString();
                     dr["Amount"] = dRow.Cells["dgvtxtAmount"].Value.ToString();
                     dr["Measure"] = dRow.Cells["dgvtxtMeasure"].FormattedValue.ToString();
                     dtblGridDetails.Rows.Add(dr);
                 }
             }
         }
         //-------------Other Details-------------------\\
         dtblOtherDetails.Columns.Add("InvoiceNo");
         dtblOtherDetails.Columns.Add("date");
         dtblOtherDetails.Columns.Add("CashOrParty");
         dtblOtherDetails.Columns.Add("CreditPeriod");
         dtblOtherDetails.Columns.Add("Currency");
         dtblOtherDetails.Columns.Add("SalesMan");
         dtblOtherDetails.Columns.Add("CustomerName");
         dtblOtherDetails.Columns.Add("totalAmount");
         dtblOtherDetails.Columns.Add("DiscountAmount");
         dtblOtherDetails.Columns.Add("GrandTotal");
         dtblOtherDetails.Columns.Add("Narration");
         dtblOtherDetails.Columns.Add("AmountInWords");
         dtblOtherDetails.Columns.Add("Declaration");
         dtblOtherDetails.Columns.Add("Heading1");
         dtblOtherDetails.Columns.Add("Heading2");
         dtblOtherDetails.Columns.Add("Heading3");
         dtblOtherDetails.Columns.Add("Heading4");
         DataRow dRowOther = dtblOtherDetails.Rows[0];
         dRowOther["InvoiceNo"] = txtInvoiceNumber.Text;
         dRowOther["date"] = txtVoucherDate.Text;
         dRowOther["CashOrParty"] = cmbCashParty.Text;
         dRowOther["CreditPeriod"] = txtCreditPeriod.Text;
         dRowOther["Currency"] = cmbCurrency.Text;
         dRowOther["SalesMan"] = cmbSalesman.Text;
         dRowOther["CustomerName"] = txtCustomer.Text;
         dRowOther["totalAmount"] = txtTotalAmount.Text;
         dRowOther["DiscountAmount"] = txtDiscount.Text;
         dRowOther["GrandTotal"] = txtGrandTotal.Text;
         dRowOther["Narration"] = txtNarration.Text;
         dRowOther["address"] = (dtblOtherDetails.Rows[0]["address"].ToString().Replace("\n", ", ")).Replace("\r", "");
         dRowOther["AmountInWords"] = new NumToText().AmountWords(Convert.ToDecimal(txtGrandTotal.Text), PublicVariables._decCurrencyId);
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         DataTable dtblDeclaration = spVoucherType.DeclarationAndHeadingGetByVoucherTypeId(DecServicetVoucherTypeId);
         dRowOther["Declaration"] = dtblDeclaration.Rows[0]["Declaration"].ToString();
         dRowOther["Heading1"] = dtblDeclaration.Rows[0]["Heading1"].ToString();
         dRowOther["Heading2"] = dtblDeclaration.Rows[0]["Heading2"].ToString();
         dRowOther["Heading3"] = dtblDeclaration.Rows[0]["Heading3"].ToString();
         dRowOther["Heading4"] = dtblDeclaration.Rows[0]["Heading4"].ToString();
         int inFormId = spVoucherType.FormIdGetForPrinterSettings(Convert.ToInt32(dtblDeclaration.Rows[0]["masterId"].ToString()));
         PrintWorks.DotMatrixPrint.PrintDesign(inFormId, dtblOtherDetails, dtblGridDetails, dtblOtherDetails);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SV 26 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #6
0
 /// <summary>
 /// Its the function to print the curresponding details to the Dotmatrix printer
 /// </summary>
 /// <param name="decMasterId"></param>
 public void PrintForDotMatrix(decimal decMasterId)
 {
     try
     {
         DataTable dtblOtherDetails = new DataTable();
         CompanySP spComapany = new CompanySP();
         dtblOtherDetails = spComapany.CompanyViewForDotMatrix();
         DataTable dtblGridDetails = new DataTable();
         dtblGridDetails.Columns.Add("SlNo");
         dtblGridDetails.Columns.Add("BankAccount");
         dtblGridDetails.Columns.Add("ChequeNo");
         dtblGridDetails.Columns.Add("ChequeDate");
         dtblGridDetails.Columns.Add("Amount");
         dtblGridDetails.Columns.Add("AccountLedger");
         dtblGridDetails.Columns.Add("voucherNo");
         dtblGridDetails.Columns.Add("voucherDate");
         dtblGridDetails.Columns.Add("voucherType");
         dtblGridDetails.Columns.Add("Narration");
         dtblGridDetails.Columns.Add("againstInvoiceNo");
         dtblGridDetails.Columns.Add("Status");
         DataRow dr = dtblGridDetails.NewRow();
         dr["SlNo"] = 1;
         dr["ChequeNo"] = txtcheckNo.Text;
         dr["BankAccount"] = txtBank.Text;
         dr["ChequeDate"] = txtcheckdate.Text;
         dr["Amount"] = txtAmount.Text;
         dr["AccountLedger"] = txtAccountLedger.Text;
         dr["voucherNo"] = txtvoucherNo.Text;
         dr["voucherDate"] = txtVoucherDate.Text;
         dr["voucherType"] = cmbvouchertype.Text;
         dr["Narration"] = txtNarration.Text;
         dr["againstInvoiceNo"] = cmbInvoiceNo.Text;
         dr["Status"] = cmbStatus.Text;
         dtblGridDetails.Rows.Add(dr);
         dtblOtherDetails.Columns.Add("AmountInWords");
         dtblOtherDetails.Columns.Add("Declaration");
         dtblOtherDetails.Columns.Add("Heading1");
         dtblOtherDetails.Columns.Add("Heading2");
         dtblOtherDetails.Columns.Add("Heading3");
         dtblOtherDetails.Columns.Add("Heading4");
         DataRow dRowOther = dtblOtherDetails.Rows[0];
         dRowOther["address"] = (dtblOtherDetails.Rows[0]["address"].ToString().Replace("\n", ", ")).Replace("\r", "");
         dRowOther["AmountInWords"] = new NumToText().AmountWords(Convert.ToDecimal(txtAmount.Text), PublicVariables._decCurrencyId);
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         DataTable dtblDeclaration = spVoucherType.DeclarationAndHeadingGetByVoucherTypeId(decPDCclearanceVoucherTypeId);
         dRowOther["Declaration"] = dtblDeclaration.Rows[0]["Declaration"].ToString();
         dRowOther["Heading1"] = dtblDeclaration.Rows[0]["Heading1"].ToString();
         dRowOther["Heading2"] = dtblDeclaration.Rows[0]["Heading2"].ToString();
         dRowOther["Heading3"] = dtblDeclaration.Rows[0]["Heading3"].ToString();
         dRowOther["Heading4"] = dtblDeclaration.Rows[0]["Heading4"].ToString();
         int inFormId = spVoucherType.FormIdGetForPrinterSettings(Convert.ToInt32(dtblDeclaration.Rows[0]["masterId"].ToString()));
         PrintWorks.DotMatrixPrint.PrintDesign(inFormId, dtblOtherDetails, dtblGridDetails, dtblOtherDetails);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PC19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }