public ReceiptVoucher(DataSet DsComp, DataSet DsClient, DataSet DsVoucher, DataSet DsBank)
        {
            InitializeComponent();
            string _customizedClient = String.Empty;

            BusinessAccessLayer.Common.clsCommon _cmn = new BusinessAccessLayer.Common.clsCommon();
            _customizedClient = _cmn.GetCustomizedClient();

            string _client = String.Empty;

            _client = _cmn.GetClient();

            if (_customizedClient.ToUpper() == "HOWDEN" || _customizedClient.ToUpper() == "HOWDENSG")
            {
                textBox61.Value = "Medium Reference Number";
                textBox62.Value = "Medium Reference Date";
            }

            // textBox1.Value = DS.Tables[0].Rows[0]["ClientName"].ToString();
            textBox1.Value  = DsClient.Tables[0].Rows[0]["AccountDate"].ToString();
            textBox3.Value  = DsClient.Tables[0].Rows[0]["ClientName"].ToString();
            textBox10.Value = DsClient.Tables[0].Rows[0]["VoucherNo"].ToString();
            textBox11.Value = DsClient.Tables[0].Rows[0]["ClientAdd1"].ToString();
            textBox12.Value = DsClient.Tables[0].Rows[0]["ClientAdd2"].ToString();
            textBox30.Value = DsClient.Tables[0].Rows[0]["ClientAdd3"].ToString();
            //textBox15.Visible = false
            if (DsClient.Tables[0].Rows[0]["ClientAdd4"].ToString() == "")
            {
                textBox16.Value   = DsClient.Tables[0].Rows[0]["Country"].ToString();
                textBox25.Visible = false;
            }
            else
            {
                textBox16.Value = DsClient.Tables[0].Rows[0]["ClientAdd4"].ToString();
                textBox25.Value = DsClient.Tables[0].Rows[0]["Country"].ToString();
            }

            textBox18.Value = DsClient.Tables[0].Rows[0]["ClientCode"].ToString();
            textBox14.Value = DsClient.Tables[0].Rows[0]["VoucherDate"].ToString();

            txtCompany41.Value = DsComp.Tables[0].Rows[0]["CompName"].ToString();

            txtAddress42.Value = DsComp.Tables[0].Rows[0]["Add1"].ToString() + " " + DsComp.Tables[0].Rows[0]["Add2"].ToString() + " " + DsComp.Tables[0].Rows[0]["Add3"].ToString();
            //txtAddress43.Value = DS.Tables[0].Rows[0]["Add2"].ToString();
            //textBox1.Value = DS.Tables[0].Rows[0]["Add3"].ToString();
            textBox6.Value = DsComp.Tables[0].Rows[0]["Add4"].ToString();
            textBox5.Value = DsComp.Tables[0].Rows[0]["Add5"].ToString();
            textBox7.Value = DsComp.Tables[0].Rows[0]["Add7"].ToString();

            //textBox58.Value = DsComp.Tables[0].Rows[0]["Currency"].ToString();
            //textBox59.Value = DsComp.Tables[0].Rows[0]["TranAmount"].ToString();

            if (DsClient.Tables[0].Rows[0]["VoucherDescription"].ToString() != "")
            {
                textBox19.Value = DsClient.Tables[0].Rows[0]["VoucherDescription"].ToString();
            }
            else
            {
                textBox19.Visible = false;
            }

            //if (DS.Tables[0].Columns.Contains("ChequeNo"))
            //{
            //    textBox33.Value = DS.Tables[0].Rows[0]["ChequeNo"].ToString();
            //    textBox31.Value = DS.Tables[0].Rows[0]["Amount"].ToString();
            //    textBox32.Value = DS.Tables[0].Rows[0]["CurrencyCode"].ToString();
            //    textBox34.Value = DS.Tables[0].Rows[0]["ExchangeRate"].ToString();
            //    textBox35.Value = DS.Tables[0].Rows[0]["Amount"].ToString();
            //    textBox40.Value = DS.Tables[0].Rows[0]["ChequeDate"].ToString();

            //    //object SumAmount;
            //    //SumAmount = DS.Tables[0].Compute("Sum(Amount)", "");
            //    //textBox38.Value = SumAmount.ToString();
            //    textBox38.Value = DS.Tables[0].Rows[0]["Amount"].ToString();
            //}
            //else
            //{
            //  //  textBox24.Visible = false;
            //    textBox33.Visible = false;
            //    textBox31.Visible = false;
            //    textBox32.Visible = false;
            //    textBox34.Visible = false;
            //    textBox35.Visible = false;
            //    textBox38.Visible = false;
            //    textBox25.Visible = false;
            //   // textBox27.Visible = false;
            //    textBox28.Visible = false;
            //    textBox29.Visible = false;
            //    textBox30.Visible = false;
            //    textBox38.Visible = false;
            //    textBox36.Visible = false;
            //    textBox37.Visible = false;
            //    textBox39.Visible = false;
            //    textBox4.Visible = false;
            //    textBox40.Visible = false;
            //}

            if (_client.ToUpper() == "STARACCLAIM")
            {
                table3.Visible = false;
                table2.Visible = true;
                if (DsVoucher.Tables[0].Rows.Count > 0)
                {
                    table2.DataSource = DsVoucher.Tables[0];
                }
                else
                {
                    table2.Visible = false;
                }
            }
            else
            {
                table2.Visible = false;
                table3.Visible = true;
                if (DsVoucher.Tables[0].Rows.Count > 0)
                {
                    table3.DataSource = DsVoucher.Tables[0];
                }
                else
                {
                    table3.Visible = false;
                }
            }

            if (_client.ToUpper() == "STARACCLAIM")
            {
                table4.Visible = true;
                table1.Visible = false;

                if (DsBank.Tables[0].Rows.Count > 0)
                {
                    table4.DataSource = DsBank.Tables[0];;
                }
                else
                {
                    table4.Visible = false;
                }
            }
            else
            {
                table1.Visible = true;
                table4.Visible = false;
                if (DsBank.Tables[0].Rows.Count > 0)
                {
                    table1.DataSource = DsBank.Tables[0];;
                }
                else
                {
                    table1.Visible = false;
                }
            }
        }
Example #2
0
        public BatchPrintCreditNote(string Param1, string Param2)
        {
            InitializeComponent();
            DsCompDtl = GetCompanyDetails();
            string _client = String.Empty;

            BusinessAccessLayer.Common.clsCommon _cmn = new BusinessAccessLayer.Common.clsCommon();
            _client = _cmn.GetClient();

            if (DsCompDtl.Tables[0].Rows.Count > 0)
            {
                textBox4.Value  = DsCompDtl.Tables[0].Rows[0]["CompName"].ToString();
                textBox9.Value  = DsCompDtl.Tables[0].Rows[0]["Add1"].ToString() + " " + DsCompDtl.Tables[0].Rows[0]["Add2"].ToString() + " " + DsCompDtl.Tables[0].Rows[0]["Add3"].ToString();
                textBox12.Value = DsCompDtl.Tables[0].Rows[0]["Add4"].ToString();
                textBox15.Value = DsCompDtl.Tables[0].Rows[0]["Add5"].ToString();
                textBox18.Value = DsCompDtl.Tables[0].Rows[0]["Add7"].ToString();
                textBox19.Value = "Please make cheque payable to " + DsCompDtl.Tables[0].Rows[0]["CompName"].ToString();
            }

            DsreportDetails = GetBatchPrintForDebitNote(Param1, Param2);

            if (_client.ToUpper() == "STARACCLAIM")
            {
                textBox5.Value = "CREDIT NOTE";
            }

            if (DsreportDetails.Tables[0].Rows.Count > 0)
            {
                textBox29.Value = DsreportDetails.Tables[0].Rows[0]["CusM_Name"].ToString();
                if (string.IsNullOrEmpty(textBox29.Value))
                {
                    textBox29.Visible = false;
                }


                textBox26.Value = DsreportDetails.Tables[0].Rows[0]["CusM_Address1"].ToString();

                if (string.IsNullOrEmpty(textBox26.Value))
                {
                    textBox26.Visible = false;
                }

                textBox24.Value = DsreportDetails.Tables[0].Rows[0]["CusM_Address2"].ToString();

                if (string.IsNullOrEmpty(textBox24.Value))
                {
                    textBox24.Visible = false;
                }
                textBox21.Value = DsreportDetails.Tables[0].Rows[0]["CusM_Address3"].ToString();

                if (string.IsNullOrEmpty(textBox21.Value))
                {
                    textBox21.Visible = false;
                }

                textBox25.Value = DsreportDetails.Tables[0].Rows[0]["CusM_Address4"].ToString();

                if (string.IsNullOrEmpty(textBox25.Value))
                {
                    textBox25.Visible = false;
                }

                textBox27.Value = DsreportDetails.Tables[0].Rows[0]["DrCrNo"].ToString();
                textBox22.Value = DsreportDetails.Tables[0].Rows[0]["DrCrDate"].ToString();
                textBox6.Value  = DsreportDetails.Tables[0].Rows[0]["CusM_ID"].ToString();

                if (_client.ToUpper() == "STARACCLAIM")
                {
                    table2.Visible  = true;
                    table3.Visible  = false;
                    textBox34.Value = DsreportDetails.Tables[0].Rows[0]["DrCrDescription"].ToString();
                    textBox35.Value = ConvertIntoNumeric(Convert.ToDecimal(DsreportDetails.Tables[0].Rows[0]["Amount"].ToString()));
                    textBox31.Value = ConvertIntoNumeric(Convert.ToDecimal(DsreportDetails.Tables[0].Rows[0]["LocalAmount"].ToString()));
                    textBox47.Value = ConvertIntoNumeric(Convert.ToDecimal(DsreportDetails.Tables[0].Rows[0]["GST"].ToString()));;
                }
                else
                {
                    table3.Visible  = true;
                    table2.Visible  = false;
                    textBox40.Value = DsreportDetails.Tables[0].Rows[0]["DrCrDescription"].ToString();
                    textBox37.Value = ConvertIntoNumeric(Convert.ToDecimal(DsreportDetails.Tables[0].Rows[0]["LocalAmount"].ToString()));
                    textBox30.Value = ConvertIntoNumeric(Convert.ToDecimal(DsreportDetails.Tables[0].Rows[0]["LocalAmount"].ToString()));;
                }
            }
        }
Example #3
0
        public tlrPaymentVouchercs(DataSet DsComp, DataSet DsClient, DataSet DsVoucher, DataSet DsBank, string batchType, string paymentType)
        {
            InitializeComponent();
            string _customizedClient = String.Empty;

            BusinessAccessLayer.Common.clsCommon _cmn = new BusinessAccessLayer.Common.clsCommon();
            _customizedClient = _cmn.GetCustomizedClient();
            if (_customizedClient.ToUpper() == "HOWDEN" || _customizedClient.ToUpper() == "HOWDENSG")
            {
                textBox36.Value = "Medium Reference Number";
                textBox37.Value = "Medium Reference Date";
            }

            if (DsComp.Tables[0].Rows.Count > 0)
            {
                txtCompany41.Value = Convert.ToString(DsComp.Tables[0].Rows[0]["CompName"]);
                txtAddress42.Value = Convert.ToString(DsComp.Tables[0].Rows[0]["Add1"]) + " " + Convert.ToString(DsComp.Tables[0].Rows[0]["Add2"]) + " " + Convert.ToString(DsComp.Tables[0].Rows[0]["Add3"]);
                textBox1.Value     = DsComp.Tables[0].Rows[0]["Add4"].ToString();
                textBox2.Value     = DsComp.Tables[0].Rows[0]["Add5"].ToString();
                textBox7.Value     = DsComp.Tables[0].Rows[0]["Add7"].ToString();
            }

            if (batchType == "R")
            {
                textBox3.Value    = "RECEIPT VOUCHER";
                textBox49.Visible = true;
                textBox52.Visible = false;
                textBox53.Visible = false;
                textBox54.Visible = false;
                textBox14.Value   = "Receipt No:";
                textBox18.Value   = "Receipt Date:";
                textBox20.Value   = "Acc Month:";
                if (DsClient.Tables[0].Rows.Count > 0)
                {
                    textBox24.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["VoucherNo"]);
                    textBox22.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["VoucherDate"]);
                    textBox21.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["AccountDate"]);
                }
            }
            else if (batchType == "P")
            {
                textBox3.Value    = "PAYMENT VOUCHER";
                textBox49.Visible = false;
                textBox52.Visible = true;
                textBox53.Visible = true;
                textBox54.Visible = true;
                textBox14.Value   = "Payment No:";
                textBox18.Value   = "Payment Date:";
                textBox20.Value   = "Acc Month:";
                if (DsClient.Tables[0].Rows.Count > 0)
                {
                    textBox24.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["VoucherNo"]);
                    textBox22.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["VoucherDate"]);
                    textBox21.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["AccountDate"]);
                }
            }

            if (DsClient.Tables[0].Rows.Count > 0)
            {
                textBox13.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["ClientName"]);
                textBox11.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["ClientAdd1"]);
                textBox12.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["ClientAdd2"]);
                textBox16.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["ClientAdd3"]);
                if (!string.IsNullOrEmpty(Convert.ToString(DsClient.Tables[0].Rows[0]["ClientAdd4"])))
                {
                    textBox9.Value   = Convert.ToString(DsClient.Tables[0].Rows[0]["ClientAdd4"]);
                    textBox9.Visible = true;
                }
                else
                {
                    textBox9.Visible = false;
                }
                textBox59.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["country"]);

                textBox26.Value = Convert.ToString(DsClient.Tables[0].Rows[0]["ClientCode"]);

                if (!string.IsNullOrEmpty(Convert.ToString(DsClient.Tables[0].Rows[0]["VoucherDescription"])))
                {
                    textBox27.Value = DsClient.Tables[0].Rows[0]["VoucherDescription"].ToString();
                }
                else
                {
                    textBox27.Visible = false;
                }
            }

            if (paymentType == "N")
            {
                table1.Visible = true;
                table3.Visible = false;

                if (DsVoucher.Tables[0].Rows.Count > 0)
                {
                    table1.DataSource = DsVoucher.Tables[0];
                }
                else
                {
                    table1.Visible = false;
                }
            }
            else
            {
                table1.Visible = false;
                //panel1.Visible = false;
                table3.Visible = true;
                //panel2.Location = panel1.Location;
                table3.Location = table1.Location;

                if (DsVoucher.Tables[0].Rows.Count > 0)
                {
                    table3.DataSource = DsVoucher.Tables[0];
                }
                else
                {
                    table3.Visible = false;
                }
            }

            if (DsBank.Tables[0].Rows.Count > 0)
            {
                table4.DataSource = DsBank;
            }
            else
            {
                table4.Visible = false;
            }
        }
Example #4
0
        public MatchTransactionReport(DataSet Ds)
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            DataTable dtUniqRecords = new DataTable();
            DataTable DtFinal       = new DataTable();

            DtFinal       = Ds.Tables[0].Clone();
            dtUniqRecords = Ds.Tables[0].DefaultView.ToTable(true, "Insurer");

            string _customizedClient = String.Empty;

            BusinessAccessLayer.Common.clsCommon _cmn = new BusinessAccessLayer.Common.clsCommon();
            _customizedClient = _cmn.GetCustomizedClient();
            if (_customizedClient.ToUpper() == "HOWDEN" || _customizedClient.ToUpper() == "HOWDENSG")
            {
                textBox2.Value  = "Medium Reference No.";
                textBox3.Value  = "Medium Reference Date";
                textBox37.Value = "Medium Reference Number";
            }
            for (int i = 0; i < dtUniqRecords.Rows.Count; i++)
            {
                string filterExp = "Insurer = '" + dtUniqRecords.Rows[i]["Insurer"].ToString() + "'";
                var    dv        = Ds.Tables[0].DefaultView;
                dv.RowFilter = filterExp;
                var     newDS           = new DataSet();
                var     newDT           = dv.ToTable();
                DataRow newCustomersRow = newDT.NewRow();
                newCustomersRow["Insurer"]           = "Total :";
                newCustomersRow["Amount_DueInsurer"] = newDT.Compute("Sum(Amount_DueInsurer)", "");
                newCustomersRow["Brokerage"]         = newDT.Compute("Sum(Brokerage)", "");
                newCustomersRow["GrandTotal"]        = newDT.Compute("Sum(GrandTotal)", "");
                newDT.Rows.Add(newCustomersRow);
                newDS.Tables.Add(newDT);

                for (int k = 1; k <= newDS.Tables[0].Rows.Count; k++)
                {
                    DtFinal.ImportRow(newDS.Tables[0].Rows[k - 1]);
                }
            }
            object sumInsurerAmt = 0.0;
            object sumBrokerage  = 0.0;
            object sumGrandTotal = 0.0;

            //sumInsurerAmt = DtFinal.Compute("Sum(Amount_DueInsurer)", "");
            //sumBrokerage = DtFinal.Compute("Sum(Brokerage)", "");
            //sumGrandTotal = DtFinal.Compute("Sum(GrandTotal)", "");
            if (DtFinal.Rows.Count > 0)
            {
                sumInsurerAmt   = DtFinal.Rows[DtFinal.Rows.Count - 1]["Amount_DueInsurer"].ToString();
                sumBrokerage    = DtFinal.Rows[DtFinal.Rows.Count - 1]["Brokerage"].ToString();
                sumGrandTotal   = DtFinal.Rows[DtFinal.Rows.Count - 1]["GrandTotal"].ToString();
                textBox42.Value = sumInsurerAmt.ToString();
                textBox43.Value = sumBrokerage.ToString();
                textBox44.Value = sumGrandTotal.ToString();
            }
            else
            {
                textBox42.Value = sumInsurerAmt.ToString();
                textBox43.Value = sumBrokerage.ToString();
                textBox44.Value = sumGrandTotal.ToString();
            }
            table1.DataSource = DtFinal;
        }
        public DebitNoteRptGeneral_FileCopy(DataSet dsObj, string strClientCode, string fileCopy)
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            string _customizedClient = String.Empty;

            BusinessAccessLayer.Common.clsCommon _cmn = new BusinessAccessLayer.Common.clsCommon();
            _customizedClient = _cmn.GetCustomizedClient();
            if (_customizedClient.ToUpper() == "HOWDENSG")
            {
                textBox2.Value = "Premium";
                //textBox11.Visible = false;
                //txtDebitNoteDate.Visible = false;
                textBox20.Value = textBox20.Value.Replace("1. ", "");
                textBox16.Value = textBox20.Value.Replace("2. ", "");
                textBox33.Value = textBox20.Value.Replace("3. ", "");
                textBox2.Value  = "PREMIUM";
                txtGST.Value    = "INSURER'S GST";
                textBox28.Value = "TOTAL";
            }
            // added for #23256 --begin
            foreach (DataRow row in dsObj.Tables["LogoInformation"].Rows)
            {
                picBox1.Visible = row["PrintCompLogo"].ToString() == "Yes" ? true : false;
            }
            if (dsObj.Tables.Contains("reprint"))
            {
                textBox69.Value = "DUPLICATE";
            }
            // added for #23256 --end

            //txtTextDN.Value = "DEBIT NOTE :";

            if (dsObj.Tables.Count > 0)
            {
                // Values from Table 0
                if (dsObj.Tables[0].Rows.Count > 0)
                {
                    //--start --commented for redmine #34313
                    //if (dsObj.Tables[0].Rows[0]["DebitNoteNo"] != DBNull.Value)
                    //    txtDebitNoteNo.Value = ": " + dsObj.Tables[0].Rows[0]["DebitNoteNo"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["DebitNotedate"] != DBNull.Value)
                    //    txtDebitNoteDate.Value = ": " + dsObj.Tables[0].Rows[0]["DebitNotedate"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["ClientCode"] != DBNull.Value)
                    //    txtClientCode.Value = ": " + dsObj.Tables[0].Rows[0]["ClientCode"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["CoverNoteNo"] != DBNull.Value)
                    //    txtClosingSlipNo.Value = ": " + dsObj.Tables[0].Rows[0]["CoverNoteNo"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["Servicer"] != DBNull.Value)
                    //    txtServicer.Value = ": " + dsObj.Tables[0].Rows[0]["Servicer"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["BillingDueDate"] != DBNull.Value)
                    //    txtDueDate.Value = ": " + dsObj.Tables[0].Rows[0]["BillingDueDate"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["BankId"] != DBNull.Value)
                    //    textBox65.Value = "" + dsObj.Tables[0].Rows[0]["BankId"].ToString();
                    //--- end ----

                    DataTable _dtLabels = new DataTable();
                    _dtLabels.Columns.Add("Col1");
                    _dtLabels.Columns.Add("Col2");

                    DataRow _rowLable = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Debit Note No.";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["DebitNoteNo"].ToString();
                    _dtLabels.Rows.Add(_rowLable);
                    if (_customizedClient.ToUpper() != "HOWDENSG")
                    {
                        _rowLable         = _dtLabels.NewRow();
                        _rowLable["Col1"] = "Debit Note Date.";
                        _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["DebitNotedate"].ToString();
                        _dtLabels.Rows.Add(_rowLable);
                    }
                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Client Code";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["ClientCode"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Cover Note No.";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["CoverNoteNo"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Servicer.";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["Servicer"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Due Date";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["BillingDueDate"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    tbluppermenus.DataSource = _dtLabels;

                    if (dsObj.Tables[0].Rows[0]["BankName"] != DBNull.Value)
                    {
                        txtBankName.Value = "" + dsObj.Tables[0].Rows[0]["BankName"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["SwiftCode"] != DBNull.Value)
                    {
                        textBox39.Value = "" + dsObj.Tables[0].Rows[0]["SwiftCode"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["ACNo"] != DBNull.Value)
                    {
                        textBox37.Value = "" + dsObj.Tables[0].Rows[0]["ACNo"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["Remarks"] != DBNull.Value)
                    {
                        txtParticular.Value = ": " + dsObj.Tables[0].Rows[0]["Remarks"].ToString();
                    }

                    //PolicyDetails
                    if (dsObj.Tables[0].Rows[0]["SubClassName"] != DBNull.Value)
                    {
                        txtClassofInsurance.Value = ": " + dsObj.Tables[0].Rows[0]["SubClassName"].ToString();       // added for #23642
                    }
                    if (dsObj.Tables[0].Rows[0]["PolicyNo"] != DBNull.Value)
                    {
                        txtPolicyNo.Value = ": " + dsObj.Tables[0].Rows[0]["PolicyNo"].ToString();       // added for #23642
                    }
                    if (dsObj.Tables[0].Rows[0]["POIToDate"].ToString() == null || dsObj.Tables[0].Rows[0]["POIToDate"].ToString() == "")
                    {
                        txtPOIFrom.Visible = false;
                        txtPOITo.Visible   = false;
                    }
                    else
                    {
                        txtPOIFrom.Value = ": " + dsObj.Tables[0].Rows[0]["POIFromDate"].ToString();
                        txtPOITo.Value   = "" + dsObj.Tables[0].Rows[0]["POIToDate"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["UnderWriterName"] != DBNull.Value)
                    {
                        txtInsurerName.Value = ": " + dsObj.Tables[0].Rows[0]["UnderWriterName"].ToString();       // added for #23642
                    }
                    if (dsObj.Tables[0].Rows[0]["SumInsuredCurrency"] != DBNull.Value)
                    {
                        if (_customizedClient.ToUpper() == "HOWDENSG")
                        {
                            txtCurrency.Value = txtCurr1.Value = txtCurr2.Value = ": " + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString(); //redmine #34313
                        }
                        else
                        {
                            txtCurrency.Value = txtCurr1.Value = txtCurr2.Value = ": <" + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString() + ">";       // added for #23642
                        }
                    }
                    if (dsObj.Tables[0].Rows[0]["InsurerGSTAmount"] != DBNull.Value)
                    {
                        txtGSTAmt.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["InsurerGSTAmount"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["TotalDue"] != DBNull.Value)
                    {
                        txtTotalDue.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["TotalDue"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["CLTotalDue"] != DBNull.Value)
                    {
                        // txtAmount.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["CLTotalDue"].ToString()));      // added for #23642
                        txtAmount.Value      = ConvertIntoNumeric(Convert.ToDecimal(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["TotalDue"].ToString()) - Convert.ToDecimal(dsObj.Tables[0].Rows[0]["InsurerGSTAmount"].ToString()))); // #23516
                        txtCustPremium.Value = txtTotalDue.Value;
                    }

                    //if (dsObj.Tables[0].Rows[0]["CoverageToInclude"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["CoverageToInclude"].ToString() == "EB" || dsObj.Tables[0].Rows[0]["CoverageToInclude"].ToString() == "V"))
                    //    pnlGeneral.Visible = false;
                    //if (dsObj.Tables[0].Rows[0]["SubClassType"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["SubClassType"].ToString() == "LIF"))
                    //    pnlLife.Visible = true;
                    //if (dsObj.Tables[0].Rows[0]["PremWarranty"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "0"))
                    //    pnlNonLife.Visible = true;

                    //if (pnlLife.Visible == false && pnlNonLife.Visible == true)
                    //{
                    //    pnlNonLife.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.01, Telerik.Reporting.Drawing.UnitType.Cm),
                    //                            new Telerik.Reporting.Drawing.Unit(14.3, Telerik.Reporting.Drawing.UnitType.Cm));

                    //}

                    if (dsObj.Tables[0].Rows[0]["SubClassType"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["SubClassType"].ToString() == "NLF") && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "1"))
                    {
                        pnlGeneral.Visible = true;
                    }
                    //#32117
                    //if (dsObj.Tables[0].Rows[0]["CoverageToInclude"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["CoverageToInclude"].ToString() == "EB" || dsObj.Tables[0].Rows[0]["CoverageToInclude"].ToString() == "V"))
                    //    pnlGeneral.Visible = false;

                    if (dsObj.Tables[0].Rows[0]["SubClassType"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["SubClassType"].ToString() == "LIF") && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "1"))
                    {
                        pnlLife.Visible = true;
                    }

                    if (dsObj.Tables[0].Rows[0]["PremWarranty"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "0"))
                    {
                        pnlNonLife.Visible = true;
                    }

                    if (pnlGeneral.Visible == false)
                    {
                        var p1 = pnlLife.Location;
                        pnlLife.Location    = pnlGeneral.Location;
                        pnlNonLife.Location = p1;
                    }
                    if (pnlGeneral.Visible == false && pnlLife.Visible == false)
                    {
                        pnlNonLife.Location = pnlGeneral.Location;
                    }
                    if (pnlGeneral.Visible == false && pnlLife.Visible == true)
                    {
                        pnlNonLife.Location = pnlNonLife.Location;
                    }


                    if (dsObj.Tables[0].Rows[0]["StampDuty"] != DBNull.Value)
                    {
                        txtStampDuty.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["StampDuty"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["ServiceFee"] != DBNull.Value)
                    {
                        txtServiceFee.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["ServiceFee"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["Premium"] != DBNull.Value)
                    {
                        txtGrossPrem.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["Premium"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["InsurerGSTAmount"] != DBNull.Value)
                    {
                        txtInsurerGST.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["InsurerGSTAmount"].ToString()));
                    }

                    //if (dsObj.Tables[0].Rows[0]["BrokerageRate"] != DBNull.Value)
                    //    txtBrokPer.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["BrokerageRate"].ToString())) + "%";
                    //if (dsObj.Tables[0].Rows[0]["Brokerage"] != DBNull.Value)
                    //    txtBrokAmt.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["Brokerage"].ToString()));

                    //if (dsObj.Tables[0].Rows[0]["BrokerGST"] != DBNull.Value)
                    //    txtBrokerGST.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["BrokerGST"].ToString())) + "%";
                    //if (dsObj.Tables[0].Rows[0]["BrokerGSTAmount"] != DBNull.Value)
                    //    txtBrokerGSTGSTAmt.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["BrokerGSTAmount"].ToString()));

                    if (dsObj.Tables[0].Rows[0]["ServiceFeeGSTAmount"] != DBNull.Value)
                    {
                        txtServiceFeeGST.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["ServiceFeeGSTAmount"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["OtherCharges"] != DBNull.Value)
                    {
                        txtOtherCharge.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["OtherCharges"].ToString()));
                    }
                    if (dsObj.Tables[0].Rows[0]["Discount"] != DBNull.Value)
                    {
                        txtDiscount.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["Discount"].ToString()));
                    }
                    if (_customizedClient.ToUpper() == "HOWDENSG") // added by redmine #34313
                    {
                        textBox75.Visible = false;
                        if (!String.IsNullOrEmpty(dsObj.Tables[0].Rows[0]["Discount"].ToString()) && dsObj.Tables[0].Rows[0]["Discount"].ToString() != "0.00")
                        {
                            txtCLDiscount.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["Discount"].ToString()));
                            textBox75.Visible   = true;
                        }

                        if (dsObj.Tables[0].Rows[0]["Brokerage"] != DBNull.Value)  //added for redmine #34313
                        {
                            txtBrokerage.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["Brokerage"].ToString()));
                        }
                        if (dsObj.Tables[0].Rows[0]["BrokerGSTAmount"] != DBNull.Value)  //added for redmine #34313
                        {
                            txtBrokerageGSTAmount.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["BrokerGSTAmount"].ToString()));
                        }
                        if (dsObj.Tables[0].Rows[0]["PolicyCharge"] != DBNull.Value) //added for redmine #34313
                        {
                            textBox43.Value      = "Policy Charges";
                            txtOtherCharge.Value = Convert.ToDecimal(dsObj.Tables[0].Rows[0]["PolicyCharge"]).ToString("#,##0.00");
                        }
                    }

                    //
                    //if (dsObj.Tables[0].Rows[0]["PolicyCharge"] != DBNull.Value)
                    //    txtPolicyCharge.Value = "";// dsObj.Tables[0].Rows[0]["PolicyCharge"].ToString();
                    if (dsObj.Tables[0].Rows[0]["ClientName"] != DBNull.Value)
                    {
                        txtInsuredName.Value = dsObj.Tables[0].Rows[0]["ClientName"].ToString();
                    }
                }

                //Values from Table 1
                if (dsObj.Tables[1].Rows.Count > 0)
                {
                    txtClientName.Value     = dsObj.Tables[1].Rows[0]["ClientName"].ToString();
                    txtClientAddress1.Value = dsObj.Tables[1].Rows[0]["ClientAddress1"].ToString();
                    txtClientAddress2.Value = dsObj.Tables[1].Rows[0]["ClientAddress2"].ToString();
                    txtClientAddress3.Value = dsObj.Tables[1].Rows[0]["ClientAddress3"].ToString();
                    txtClientAddress4.Value = dsObj.Tables[1].Rows[0]["ClientAddress4"].ToString();
                    txtClientAddress5.Value = Convert.ToString(dsObj.Tables[1].Rows[0]["PostalCode"]) + " " + Convert.ToString(dsObj.Tables[1].Rows[0]["ProvinceName"]) + " " + Convert.ToString(dsObj.Tables[1].Rows[0]["TerritoryName"]);
                }

                //Values from Table 2
                if (dsObj.Tables[2].Rows.Count > 0)
                {
                    txtCompanyName.Value    = txtCompanyName1.Value = Convert.ToString(dsObj.Tables[2].Rows[0]["TopCompanyName"]).ToUpper();
                    txtCompanyAddress.Value = dsObj.Tables[2].Rows[0]["TopCompanyAddress"].ToString();
                }

                if (dsObj.Tables[3].Rows.Count > 0)
                {
                    DataTable dtAgent = new DataTable();
                    dtAgent = dsObj.Tables[3];
                    DataTable objDataTableAgent = new DataTable();
                    objDataTableAgent.Columns.Add("Col1");
                    objDataTableAgent.Columns.Add("Col2");
                    objDataTableAgent.Columns.Add("Col3");
                    objDataTableAgent.Columns.Add("Col4");
                    int maxRow = dsObj.Tables[3].Rows.Count - 1;
                    for (int i = 0; i <= maxRow; i++)
                    {
                        DataRow objDataRow = objDataTableAgent.NewRow();
                        objDataRow["Col1"] = (_customizedClient.ToUpper() == "HOWDENSG" ? "Introducer " : "Agent ") + (i + 1).ToString();
                        objDataRow["Col2"] = dtAgent.Rows[i]["AgentCode"].ToString();
                        objDataRow["Col3"] = (_customizedClient.ToUpper() == "HOWDENSG" ? "Introducer ":"Agent ") + "Comm " + (i + 1).ToString();
                        objDataRow["Col4"] = dtAgent.Rows[i]["AgentShare"].ToString() + "%";
                        objDataTableAgent.Rows.Add(objDataRow);
                    }
                    tblAgent.DataSource = objDataTableAgent;
                    //added for redmine #34313
                    if (_customizedClient.ToUpper() == "HOWDENSG" && !String.IsNullOrEmpty(dsObj.Tables[3].Rows[0]["AgentName"].ToString()))
                    {
                        txtIntroducerName.Value = dsObj.Tables[3].Rows[0]["AgentName"].ToString();
                        txtcommValue.Value      = dsObj.Tables[3].Rows[0]["TotalDue"].ToString(); //redmine #34313
                    }
                }

                if (_customizedClient.ToUpper() == "HOWDENSG") // added for redmine #34313
                {
                    decimal _grandTotal = 0.00M;
                    //txtGrandTotal.Value = String.Empty;
                    int       _rowInfo  = 1;
                    DataTable objDataUW = new DataTable();
                    objDataUW.Columns.Add("Col1");
                    objDataUW.Columns.Add("Col2");
                    objDataUW.Columns.Add("Col3");
                    objDataUW.Columns.Add("Col4");
                    objDataUW.Columns.Add("Col5");
                    bool _coInsurer = false;
                    if (!String.IsNullOrEmpty(dsObj.Tables[6].Rows[0]["Coinsurer"].ToString()))
                    {
                        _coInsurer = dsObj.Tables[6].Rows[0]["Coinsurer"].ToString() == "Y" ? true : false;
                    }
                    for (int i = 0; i < dsObj.Tables[4].Rows.Count; i++)
                    {
                        string  _label           = "Insurer : ";
                        DataRow objDataRow       = null;
                        DataRow _objDatablankRow = null;
                        //if (_coInsurer == false && !String.IsNullOrEmpty(dsObj.Tables[4].Rows[i]["UnderwriterName"].ToString()))
                        //{
                        //    _label = _label + dsObj.Tables[4].Rows[i]["UnderwriterName"].ToString();
                        //}
                        //else
                        //{
                        //    _label = dsObj.Tables[4].Rows[i]["UnderwriterName"].ToString();
                        //}

                        if (!String.IsNullOrEmpty(dsObj.Tables[4].Rows[i]["UwCode"].ToString()))
                        {
                            if (_rowInfo == 1)
                            {
                                objDataRow = objDataUW.NewRow();
                                if (_coInsurer == false && !String.IsNullOrEmpty(dsObj.Tables[4].Rows[i]["UnderwriterName"].ToString()))
                                {
                                    objDataRow["Col1"] = "Insurer : ";
                                }
                                else
                                {
                                    objDataRow["Col1"] = String.Empty;
                                }

                                objDataRow["Col2"] = dsObj.Tables[4].Rows[i]["UwCode"].ToString();
                                objDataRow["Col3"] = dsObj.Tables[4].Rows[i]["UnderwriterName"].ToString();;
                                objDataRow["Col4"] = String.Empty;
                                objDataRow["Col5"] = String.Empty;
                                objDataUW.Rows.Add(objDataRow);
                                //_objDatablankRow = setBlankRow(_objDatablankRow, objDataUW);
                                objDataUW.Rows.Add(setBlankRow(_objDatablankRow, objDataUW));
                                _rowInfo++;
                            }
                            if (_rowInfo == 2)
                            {
                                objDataRow         = objDataUW.NewRow();
                                objDataRow["Col1"] = "Gross Premium";
                                objDataRow["Col2"] = Convert.ToDecimal(dsObj.Tables[4].Rows[i]["TotalDue"]).ToString("#,##0.00");
                                objDataRow["Col3"] = dsObj.Tables[4].Rows[i]["UWShare"].ToString() + " %";
                                objDataRow["Col4"] = "GST";
                                objDataRow["Col5"] = Convert.ToDecimal(dsObj.Tables[4].Rows[i]["InsurerGSTAmount"]).ToString("#,##0.00");
                                objDataUW.Rows.Add(objDataRow);
                                _rowInfo++;
                            }
                            if (_rowInfo == 3)
                            {
                                objDataRow         = objDataUW.NewRow();
                                objDataRow["Col1"] = "Commission";
                                objDataRow["Col2"] = Convert.ToDecimal(dsObj.Tables[4].Rows[i]["Brokerage"]).ToString("#,##0.00");
                                objDataRow["Col3"] = dsObj.Tables[4].Rows[i]["BrokerageRate"].ToString() + " %";
                                objDataRow["Col4"] = "GST";
                                objDataRow["Col5"] = Convert.ToDecimal(dsObj.Tables[4].Rows[i]["PolicyCharge"]).ToString("#,##0.00");
                                objDataUW.Rows.Add(objDataRow);
                                _rowInfo++;
                            }
                            if (_rowInfo == 4)
                            {
                                objDataRow         = objDataUW.NewRow();
                                objDataRow["Col1"] = "Ins Net Premium";
                                decimal _brokerage       = 0.00m;
                                decimal _clientDiscount  = 0.00m;
                                decimal _introducerValue = 0.00m;
                                if (!String.IsNullOrEmpty(dsObj.Tables[4].Rows[i]["Brokerage"].ToString()))
                                {
                                    _brokerage = Convert.ToDecimal(dsObj.Tables[4].Rows[i]["Brokerage"]);
                                }
                                if (!String.IsNullOrEmpty(dsObj.Tables[0].Rows[0]["Discount"].ToString()))
                                {
                                    _clientDiscount = Convert.ToDecimal(dsObj.Tables[0].Rows[0]["Discount"]);
                                }
                                if (!String.IsNullOrEmpty(dsObj.Tables[3].Rows[0]["TotalDue"].ToString()))
                                {
                                    _introducerValue = Convert.ToDecimal(dsObj.Tables[3].Rows[0]["TotalDue"]);
                                }
                                objDataRow["Col2"] = (_brokerage - _clientDiscount - _introducerValue).ToString("#,##0.00");
                                objDataUW.Rows.Add(objDataRow);
                                objDataUW.Rows.Add(setBlankRow(_objDatablankRow, objDataUW));
                                _rowInfo = 1;
                            }
                        }
                        _grandTotal = _grandTotal + Convert.ToDecimal(dsObj.Tables[4].Rows[i]["TotalDue"]);

                        if (dsObj.Tables[4].Rows.Count > 3)
                        {
                            txtInsurerName.Value = ": PLEASE SEE ATTACHED";
                        }
                    }

                    if (_coInsurer == true)
                    {
                        DataTable _dt = new DataTable();
                        _dt.Columns.Add("Col1");
                        _dt.Columns.Add("Col2");
                        _dt.Columns.Add("Col3");
                        _dt.Columns.Add("Col4");
                        _dt.Columns.Add("Col5");
                        DataRow objDataRow = _dt.NewRow();
                        objDataRow["Col1"] = "Grand Total: ";
                        objDataRow["Col2"] = _grandTotal.ToString("#,##0.00");
                        objDataRow["Col3"] = String.Empty;
                        objDataRow["Col4"] = String.Empty;
                        objDataRow["Col5"] = String.Empty;
                        _dt.Rows.Add(objDataRow);
                        tblmain.DataSource = objDataUW;
                    }
                    tblUW.DataSource = objDataUW;
                }
                else
                {
                    if (dsObj.Tables[4].Rows.Count > 0)
                    {
                        DataTable dtDW = new DataTable();
                        dtDW = dsObj.Tables[4];
                        tblInsurerList.DataSource = dsObj.Tables[4];
                        DataTable objDataUW = new DataTable();
                        objDataUW.Columns.Add("Col1");
                        objDataUW.Columns.Add("Col2");
                        objDataUW.Columns.Add("Col3");
                        objDataUW.Columns.Add("Col4");
                        objDataUW.Columns.Add("Col5");
                        int maxRow = dsObj.Tables[4].Rows.Count - 1;
                        for (int i = 0; i <= maxRow; i++)
                        {
                            DataRow objDataRow = objDataUW.NewRow();
                            objDataRow["Col1"] = "Insurer " + (i + 1).ToString();
                            objDataRow["Col2"] = dtDW.Rows[i]["UnderWriterCode"].ToString();
                            objDataRow["Col3"] = "Premium " + (i + 1).ToString();
                            objDataRow["Col4"] = dtDW.Rows[i]["UWShare"].ToString() + "%";
                            objDataRow["Col5"] = ConvertIntoNumeric(Convert.ToDecimal(dtDW.Rows[i]["TotalDue"].ToString()));
                            objDataUW.Rows.Add(objDataRow);
                        }
                        tblUW.DataSource = objDataUW;
                    }
                    if (dsObj.Tables[4].Rows.Count > 3)
                    {
                        tblInsurerList.Visible    = true;
                        lblInsurer.Visible        = true;
                        tblInsurerList.DataSource = dsObj.Tables[4];
                        txtInsurerName.Value      = ": PLEASE SEE ATTACHED";
                    }
                }
                if (dsObj.Tables[5].Rows.Count > 0)
                {
                    dsObj.Tables[5].Columns["TotalDue"].DataType = typeof(Decimal);
                    foreach (DataRow dr in dsObj.Tables[5].Rows)
                    {
                        dr["TotalDue"] = (dr["TotalDue"] == DBNull.Value) ? Convert.ToDecimal(0.00) : Convert.ToDecimal(dr["TotalDue"]);
                    }
                    //foreach (DataRow dr in dsObj.Tables[5].Rows)
                    //{
                    //    dr["UnderwriterName"] = (dr["UnderwriterName"] == DBNull.Value) ? String.Empty : "Insurer : " + dr["UnderwriterName"].ToString() + dr["UwCode"].ToString();
                    //}
                    tblInstalment.Visible = true;
                    lblInstalment.Visible = true;
                    if (dsObj.Tables[0].Rows.Count > 0)
                    {
                        if (_customizedClient.ToUpper() == "HOWDENSG")
                        {
                            textBox59.Value = "Gross Premium " + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString(); //redmine #34313
                        }
                        else
                        {
                            textBox59.Value = "Gross Premium " + "<" + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString() + ">";
                        }
                    }

                    tblInstalment.DataSource = dsObj.Tables[5];
                }
            }
        }
        public DebitNoteRptGeneral(DataSet dsObj, string strClientCode, string strOriDup)
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();

            // added for #23256 --begin
            foreach (DataRow row in dsObj.Tables["LogoInformation"].Rows)
            {
                picBox1.Visible = row["PrintCompLogo"].ToString() == "Yes" ? true : false;
            }
            // added for #23256 --end

            //txtTextDN.Value = "DEBIT NOTE :";
            if (dsObj.Tables.Contains("reprint"))
            {
                textBox49.Value = "DUPLICATE";
            }
            string _customizedClient = String.Empty;

            BusinessAccessLayer.Common.clsCommon _cmn = new BusinessAccessLayer.Common.clsCommon();
            _customizedClient = _cmn.GetCustomizedClient();
            if (dsObj.Tables.Count > 0)
            {
                // Values from Table 0
                if (dsObj.Tables[0].Rows.Count > 0)
                {
                    //commented for redmine #34313
                    //if (dsObj.Tables[0].Rows[0]["DebitNoteNo"] != DBNull.Value)
                    //    txtCoveNoteNo.Value = txtCoverNote1.Value = ": " + dsObj.Tables[0].Rows[0]["DebitNoteNo"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["DebitNotedate"] != DBNull.Value)
                    //    txtCoverNoteDate.Value = ": " + dsObj.Tables[0].Rows[0]["DebitNotedate"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["ClientCode"] != DBNull.Value)
                    //    txtClientCode.Value = txtClientCode1.Value = ": " + dsObj.Tables[0].Rows[0]["ClientCode"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["CoverNoteNo"] != DBNull.Value)
                    //    txtClosingSlipNo.Value = ": " + dsObj.Tables[0].Rows[0]["CoverNoteNo"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["Servicer"] != DBNull.Value)
                    //    txtServicer.Value = ": " + dsObj.Tables[0].Rows[0]["Servicer"].ToString();       // added for #23642
                    //if (dsObj.Tables[0].Rows[0]["BillingDueDate"] != DBNull.Value)
                    //    txtDueDate.Value = ": " + dsObj.Tables[0].Rows[0]["BillingDueDate"].ToString();       // added for #23642
                    //--End ---

                    DataTable _dtLabels = new DataTable();
                    _dtLabels.Columns.Add("Col1");
                    _dtLabels.Columns.Add("Col2");

                    DataRow _rowLable = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Debit Note No.";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["DebitNoteNo"].ToString();
                    _dtLabels.Rows.Add(_rowLable);
                    if (_customizedClient.ToUpper() != "HOWDENSG")
                    {
                        _rowLable         = _dtLabels.NewRow();
                        _rowLable["Col1"] = "Debit Note Date.";
                        _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["DebitNotedate"].ToString();
                        _dtLabels.Rows.Add(_rowLable);
                    }
                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Client Code";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["ClientCode"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Cover Note No.";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["CoverNoteNo"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Servicer.";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["Servicer"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    _rowLable         = _dtLabels.NewRow();
                    _rowLable["Col1"] = "Due Date";
                    _rowLable["Col2"] = ": " + dsObj.Tables[0].Rows[0]["BillingDueDate"].ToString();
                    _dtLabels.Rows.Add(_rowLable);

                    tbllables.DataSource = _dtLabels;

                    if (dsObj.Tables[0].Rows[0]["BankName"] != DBNull.Value)
                    {
                        txtBankName.Value = "" + dsObj.Tables[0].Rows[0]["BankName"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["SwiftCode"] != DBNull.Value)
                    {
                        textBox42.Value = "" + dsObj.Tables[0].Rows[0]["SwiftCode"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["ACNo"] != DBNull.Value)
                    {
                        textBox7.Value = "" + dsObj.Tables[0].Rows[0]["ACNo"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["Remarks"] != DBNull.Value)
                    {
                        txtParticular.Value = ": " + dsObj.Tables[0].Rows[0]["Remarks"].ToString();
                    }



                    //PolicyDetails
                    if (dsObj.Tables[0].Rows[0]["SubClassName"] != DBNull.Value)
                    {
                        txtClassofInsurance.Value = ": " + dsObj.Tables[0].Rows[0]["SubClassName"].ToString();       // added for #23642
                    }
                    if (dsObj.Tables[0].Rows[0]["PolicyNo"] != DBNull.Value)
                    {
                        txtEndtNo.Value = ": " + dsObj.Tables[0].Rows[0]["PolicyNo"].ToString();       // added for #23642
                    }
                    if (dsObj.Tables[0].Rows[0]["POIToDate"].ToString() == null || dsObj.Tables[0].Rows[0]["POIToDate"].ToString() == "")
                    {
                        txtPOIFrom.Visible = false;
                        txtPOITo.Visible   = false;
                    }
                    else
                    {
                        txtPOIFrom.Value = ": " + dsObj.Tables[0].Rows[0]["POIFromDate"].ToString();
                        txtPOITo.Value   = "" + dsObj.Tables[0].Rows[0]["POIToDate"].ToString();
                    }
                    if (dsObj.Tables[0].Rows[0]["UnderWriterName"] != DBNull.Value)
                    {
                        txtInsurerName.Value = ": " + dsObj.Tables[0].Rows[0]["UnderWriterName"].ToString();       // added for #23642
                    }
                    if (dsObj.Tables[0].Rows[0]["SumInsuredCurrency"] != DBNull.Value)
                    {
                        if (_customizedClient.ToUpper() == "HOWDENSG")
                        {
                            txtCurrency.Value = txtCurr1.Value = ": " + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString(); //redmine #34313
                        }
                        else
                        {
                            txtCurrency.Value = txtCurr1.Value = ": <" + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString() + ">";       // added for #23642
                        }
                    }

                    if (dsObj.Tables[0].Rows[0]["TotalDue"] != DBNull.Value)
                    {
                        txtAmount.Value = txtAmt1.Value = ConvertIntoNumeric(Convert.ToDecimal(dsObj.Tables[0].Rows[0]["TotalDue"].ToString()));   // added for #23642
                    }

                    if (dsObj.Tables[0].Rows[0]["SubClassType"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["SubClassType"].ToString() == "NLF") && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "1"))
                    {
                        pnlGeneral.Visible = true;
                    }
                    //#32117
                    //if (dsObj.Tables[0].Rows[0]["CoverageToInclude"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["CoverageToInclude"].ToString() == "EB" || dsObj.Tables[0].Rows[0]["CoverageToInclude"].ToString() == "V"))
                    //    pnlGeneral.Visible = false;= txtInsuredName.Value

                    if (dsObj.Tables[0].Rows[0]["SubClassType"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["SubClassType"].ToString() == "LIF") && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "1"))
                    {
                        pnlLife.Visible = true;
                    }

                    if (dsObj.Tables[0].Rows[0]["PremWarranty"] != DBNull.Value && (dsObj.Tables[0].Rows[0]["PremWarranty"].ToString() == "0"))
                    {
                        pnlNonLife.Visible = true;
                    }

                    if (dsObj.Tables[0].Rows[0]["ClientName"] != DBNull.Value)
                    {
                        txtInsuredName.Value = dsObj.Tables[0].Rows[0]["ClientName"].ToString();
                    }

                    if (pnlGeneral.Visible == false)
                    {
                        var p1 = pnlLife.Location;
                        pnlLife.Location    = pnlGeneral.Location;
                        pnlNonLife.Location = p1;
                    }
                    if (pnlGeneral.Visible == false && pnlLife.Visible == false)
                    {
                        pnlNonLife.Location = pnlGeneral.Location;
                    }
                    if (pnlGeneral.Visible == false && pnlLife.Visible == true)
                    {
                        pnlNonLife.Location = pnlNonLife.Location;
                    }

                    //if (pnlLife.Visible == false && pnlNonLife.Visible == true)
                    //{
                    //    pnlNonLife.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.01, Telerik.Reporting.Drawing.UnitType.Cm),
                    //                            new Telerik.Reporting.Drawing.Unit(13.80, Telerik.Reporting.Drawing.UnitType.Cm));
                    //}
                }

                //Values from Table 1
                if (dsObj.Tables[1].Rows.Count > 0)
                {
                    txtClientName.Value     = dsObj.Tables[1].Rows[0]["ClientName"].ToString();
                    txtClientAddress1.Value = dsObj.Tables[1].Rows[0]["ClientAddress1"].ToString();
                    txtClientAddress2.Value = dsObj.Tables[1].Rows[0]["ClientAddress2"].ToString();
                    txtClientAddress3.Value = dsObj.Tables[1].Rows[0]["ClientAddress3"].ToString();
                    txtClientAddress4.Value = dsObj.Tables[1].Rows[0]["ClientAddress4"].ToString();
                    txtClientAddress5.Value = Convert.ToString(dsObj.Tables[1].Rows[0]["PostalCode"]) + " " + Convert.ToString(dsObj.Tables[1].Rows[0]["ProvinceName"]) + " " + Convert.ToString(dsObj.Tables[1].Rows[0]["TerritoryName"]);
                }

                //Values from Table 2
                if (dsObj.Tables[2].Rows.Count > 0)
                {
                    //txtImpNotice6.Value="6. All Cheques should be crossed and made payable to \"" +dsObj.Tables[2].Rows[0]["TopCompanyName"].ToString()+"\"";
                    txtCompanyName.Value    = txtCompanyName1.Value = Convert.ToString(dsObj.Tables[2].Rows[0]["TopCompanyName"]).ToUpper();
                    txtCompanyAddress.Value = dsObj.Tables[2].Rows[0]["TopCompanyAddress"].ToString();
                }

                if (_customizedClient.ToUpper() == "HOWDENSG")
                {
                    if (dsObj.Tables[4].Rows.Count > 3) // fixed for redmine #34313 as per document.
                    {
                        tblInsurerList.Visible    = true;
                        lblInsurer.Visible        = true;
                        tblInsurerList.DataSource = dsObj.Tables[4];
                        txtInsurerName.Value      = ": PLEASE SEE ATTACHED";
                    }
                }
                else
                {
                    if (dsObj.Tables[4].Rows.Count > 2)
                    {
                        tblInsurerList.Visible    = true;
                        lblInsurer.Visible        = true;
                        tblInsurerList.DataSource = dsObj.Tables[4];
                        txtInsurerName.Value      = ": PLEASE SEE ATTACHED";
                    }
                }

                if (dsObj.Tables[5].Rows.Count > 0)
                {
                    dsObj.Tables[5].Columns["TotalDue"].DataType = typeof(Decimal);
                    foreach (DataRow dr in dsObj.Tables[5].Rows)
                    {
                        dr["TotalDue"] = (dr["TotalDue"] == DBNull.Value) ?Convert.ToDecimal(0.00) : Convert.ToDecimal(dr["TotalDue"]);
                    }
                    tblInstalment.Visible = true;
                    lblInstalment.Visible = true;
                    if (dsObj.Tables[0].Rows.Count > 0)
                    {
                        if (_customizedClient.ToUpper() == "HOWDENSG")
                        {
                            textBox39.Value = "Gross Premium " + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString();  //redmine #34313
                        }
                        else
                        {
                            textBox39.Value = "Gross Premium " + "<" + dsObj.Tables[0].Rows[0]["SumInsuredCurrency"].ToString() + ">";
                        }
                    }
                    tblInstalment.DataSource = dsObj.Tables[5];
                }
            }

            if (_customizedClient.ToUpper() == "HOWDENSG")
            {
                //textBox11.Visible = false;
                //txtCoverNoteDate.Visible = false;
                textBox20.Value = textBox20.Value.Replace("1. ", "");
                textBox28.Value = textBox20.Value.Replace("2. ", "");
                textBox33.Value = textBox20.Value.Replace("3. ", "");
                textBox2.Value  = "GROSS PREMIUM TO BE COLLECTED ON BEHALF OF INSURER";
                textBox39.Value = "Gross Premium (Incl GST)";
            }
        }