Esempio n. 1
0
    protected void GridView1009_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.Header)
            {
                ((CheckBox)e.Row.FindControl("allchk")).Attributes.Add("onclick",
                                                                       "javascript:SelectAll('" +
                                                                       ((CheckBox)e.Row.FindControl("allchk")).ClientID + "')");
            }

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string Princ = string.IsNullOrEmpty(((Label)e.Row.FindControl("lbls1Bal")).Text) ? "0" : ((Label)e.Row.FindControl("lbls1Bal")).Text;
                TotalValue1      = Convert.ToDouble(Princ);
                SumFooterValue1 += TotalValue1;
                string Inttr = string.IsNullOrEmpty(((Label)e.Row.FindControl("lbls1Inst")).Text) ? "0" : ((Label)e.Row.FindControl("lbls1Inst")).Text;
                TotalValue3      = Convert.ToDouble(Inttr);
                SumFooterValue3 += TotalValue3;
                string PriCrDr = string.IsNullOrEmpty(((TextBox)e.Row.FindControl("lbls1Bal_R")).Text) ? "0" : ((TextBox)e.Row.FindControl("lbls1Bal_R")).Text;
                TotalValue2      = Convert.ToDouble(PriCrDr);
                SumFooterValue2 += TotalValue2;
                string PInst = string.IsNullOrEmpty(((TextBox)e.Row.FindControl("lbls1Inst_R")).Text) ? "0" : ((TextBox)e.Row.FindControl("lbls1Inst_R")).Text;
                TotalValue4      = Convert.ToDouble(PInst);
                SumFooterValue4 += TotalValue4;
                string PInstR = string.IsNullOrEmpty(((Label)e.Row.FindControl("lblTotal")).Text) ? "0" : ((Label)e.Row.FindControl("lblTotal")).Text;
                TotalValue5      = Convert.ToDouble(PInstR);
                SumFooterValue5 += TotalValue5;

                TextBox txtInt   = (TextBox)e.Row.FindControl("lbls1Bal_R");
                TextBox txtDiv   = (TextBox)e.Row.FindControl("lbls1Inst_R");
                Label   lblTotal = (Label)e.Row.FindControl("lblTotal");
                lblTotal.Attributes.Add("onkeyup", "CalcSellPrice2(" + txtDiv.ClientID + ", '" + txtInt.ClientID + "','" + lblTotal.ClientID + "')");
            }

            if (e.Row.RowType == DataControlRowType.Footer)
            {
                Label lbl1 = (Label)e.Row.FindControl("lbls1Bal_tot");
                lbl1.Text = SumFooterValue1.ToString() + "";
                Label lbl3 = (Label)e.Row.FindControl("lbls1Inst_tot");
                lbl3.Text = SumFooterValue3.ToString() + "";
                TextBox lbl2 = (TextBox)e.Row.FindControl("lbls1Bal_R_tot");
                lbl2.Text = SumFooterValue2.ToString() + "";
                TextBox lbl4 = (TextBox)e.Row.FindControl("lbls1Inst_R_tot");
                lbl4.Text = SumFooterValue4.ToString() + "";
                Label lbl5 = (Label)e.Row.FindControl("lblTotal_tot");
                lbl5.Text = SumFooterValue5.ToString() + "";
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    //protected void GrdDividend_PageIndexChanging(object sender, GridViewPageEventArgs e)
    //{

    //}
    //protected void GrdOtherAccDetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
    //{

    //}
    protected void GrdDirectLiab_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string sanc = string.IsNullOrEmpty(((Label)e.Row.FindControl("lblsancamt")).Text) ? "0" : ((Label)e.Row.FindControl("lblsancamt")).Text;
                TotalValue      = Convert.ToDouble(sanc);
                SumFooterValue += TotalValue;
                string sanc1 = string.IsNullOrEmpty(((Label)e.Row.FindControl("lbloutbal")).Text) ? "0" : ((Label)e.Row.FindControl("lbloutbal")).Text;
                TotalValue1      = Convert.ToDouble(sanc1);
                SumFooterValue1 += TotalValue1;
                string sanc2 = string.IsNullOrEmpty(((Label)e.Row.FindControl("lblodamt")).Text) ? "0" : ((Label)e.Row.FindControl("lblodamt")).Text;
                TotalValue2      = Convert.ToDouble(sanc2);
                SumFooterValue2 += TotalValue2;
                string Amt = string.IsNullOrEmpty(((Label)e.Row.FindControl("lblInstAmt")).Text) ? "0" : ((Label)e.Row.FindControl("lblInstAmt")).Text;
                TotalValue3      = Convert.ToDouble(Amt);
                SumFooterValue3 += TotalValue3;
            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                Label lbl = (Label)e.Row.FindControl("Lbl_TotalLimit");
                lbl.Text = SumFooterValue.ToString() + ".00";
                Label lbl1 = (Label)e.Row.FindControl("Lbl_TotalBal");
                lbl1.Text = SumFooterValue1.ToString() + ".00";
                Label lbl2 = (Label)e.Row.FindControl("Lbl_TotalOD");
                lbl2.Text = SumFooterValue2.ToString() + ".00";
                Label lbl3 = (Label)e.Row.FindControl("Lbl_TotaliNSTALL");
                lbl3.Text = SumFooterValue3.ToString() + ".00";
                if (lbl.Text == "0")
                {
                    lbl.Text = "";
                }
                if (lbl1.Text == "0")
                {
                    lbl1.Text = "";
                }
                if (lbl2.Text == "0")
                {
                    lbl2.Text = "";
                }
                if (lbl3.Text == "0")
                {
                    lbl3.Text = "";
                }
            }
        }
        catch (Exception ex)
        {
            ExceptionLogging.SendErrorToText(ex);
        }
    }
    protected void Grd_SROAccount_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string Princ = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2Principle")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2Principle")).Text;
            TotalValue1      = Convert.ToDouble(Princ);
            SumFooterValue1 += TotalValue1;
            string PriCrDr = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2PCrDr")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2PCrDr")).Text;
            TotalValue2      = Convert.ToDouble(PriCrDr);
            SumFooterValue2 += TotalValue2;
            string Inttr = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2Interest")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2Interest")).Text;
            TotalValue3      = Convert.ToDouble(Inttr);
            SumFooterValue3 += TotalValue3;
            string PInst = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2PInterest")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2PInterest")).Text;
            TotalValue4      = Convert.ToDouble(PInst);
            SumFooterValue4 += TotalValue4;
            string InstRec = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2InterestRec")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2InterestRec")).Text;
            TotalValue5      = Convert.ToDouble(InstRec);
            SumFooterValue5 += TotalValue5;
            string Notc = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2NoticeChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2NoticeChrg")).Text;
            TotalValue6      = Convert.ToDouble(Notc);
            SumFooterValue6 += TotalValue6;
            string Serchrg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2ServiceChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2ServiceChrg")).Text;
            TotalValue7      = Convert.ToDouble(Serchrg);
            SumFooterValue7 += TotalValue7;
            string Court = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2CourtChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2CourtChrg")).Text;
            TotalValue8      = Convert.ToDouble(Court);
            SumFooterValue8 += TotalValue8;
            string Sur = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2SurChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2SurChrg")).Text;
            TotalValue9      = Convert.ToDouble(Sur);
            SumFooterValue9 += TotalValue9;
            string OtrChrg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2OtherChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2OtherChrg")).Text;
            TotalValue10      = Convert.ToDouble(OtrChrg);
            SumFooterValue10 += TotalValue10;
            string BnkCrg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2BankChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2BankChrg")).Text;
            TotalValue11      = Convert.ToDouble(BnkCrg);
            SumFooterValue11 += TotalValue11;
            string InstCrgg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2InsChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2InsChrg")).Text;
            TotalValue12      = Convert.ToDouble(InstCrgg);
            SumFooterValue12 += TotalValue12;
            string Totttt = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2TotalDueAmt")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2TotalDueAmt")).Text;
            TotalValue14      = Convert.ToDouble(Totttt);
            SumFooterValue14 += TotalValue14;
            string Totsan = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L2SanAmount")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L2SanAmount")).Text;
            TotalValue15      = Convert.ToDouble(Totsan);
            SumFooterValue15 += TotalValue15;
        }

        if (e.Row.RowType == DataControlRowType.Footer)
        {
            Label lbl1 = (Label)e.Row.FindControl("lbl_L2PrinciTt");
            lbl1.Text = SumFooterValue1.ToString() + "";
            Label lbl2 = (Label)e.Row.FindControl("lbl_L2PCrDramt");
            lbl2.Text = SumFooterValue2.ToString() + "";
            Label lbl3 = (Label)e.Row.FindControl("lbl_L2InttTt");
            lbl3.Text = SumFooterValue3.ToString() + "";
            Label lbl4 = (Label)e.Row.FindControl("lbl_L2PPInttTt");
            lbl4.Text = SumFooterValue4.ToString() + "";
            Label lbl5 = (Label)e.Row.FindControl("lbl_L2IntRec");
            lbl5.Text = SumFooterValue5.ToString() + "";
            Label lbl6 = (Label)e.Row.FindControl("lbl_L2NtcChrg");
            lbl6.Text = SumFooterValue6.ToString() + "";
            Label lbl7 = (Label)e.Row.FindControl("lbl_L2ServiceChrg");
            lbl7.Text = SumFooterValue7.ToString() + "";
            Label lbl8 = (Label)e.Row.FindControl("lbl_L2CourtChrg");
            lbl8.Text = SumFooterValue8.ToString() + "";
            Label lbl9 = (Label)e.Row.FindControl("lbl_L2SurTChrg");
            lbl9.Text = SumFooterValue9.ToString() + "";
            Label lbl10 = (Label)e.Row.FindControl("lbl_L2OtherTChrg");
            lbl10.Text = SumFooterValue10.ToString() + "";
            Label lbl11 = (Label)e.Row.FindControl("lbl_L2BankTTChrg");
            lbl11.Text = SumFooterValue11.ToString() + "";
            Label lbl12 = (Label)e.Row.FindControl("lbl_L2InsTChrg");
            lbl12.Text = SumFooterValue12.ToString() + "";
            Label lbl14 = (Label)e.Row.FindControl("lbl_L2TtotalRec");
            lbl14.Text = SumFooterValue14.ToString() + "";
            Label lbl15 = (Label)e.Row.FindControl("Lbl_L2Sanction");
            lbl15.Text = SumFooterValue15.ToString() + "";
        }
    }
    protected void Grd_LoanAccount_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string Inst = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1Installment")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1Installment")).Text;
            TotalValue      = Convert.ToDouble(Inst);
            SumFooterValue += TotalValue;
            string Princ = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1Principle")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1Principle")).Text;
            TotalValue1      = Convert.ToDouble(Princ);
            SumFooterValue1 += TotalValue1;

            string ODbal = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1OverDueBal")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1OverDueBal")).Text;
            TotalValue2      = Convert.ToDouble(ODbal);
            SumFooterValue2 += TotalValue2;
            string Inttr = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1Interest")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1Interest")).Text;
            TotalValue3      = Convert.ToDouble(Inttr);
            SumFooterValue3 += TotalValue3;
            string PInst = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1PInterest")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1PInterest")).Text;
            TotalValue4      = Convert.ToDouble(PInst);
            SumFooterValue4 += TotalValue4;
            string InstRec = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1InterestRec")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1InterestRec")).Text;
            TotalValue5      = Convert.ToDouble(InstRec);
            SumFooterValue5 += TotalValue5;
            string Notc = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1NoticeChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1NoticeChrg")).Text;
            TotalValue6      = Convert.ToDouble(Notc);
            SumFooterValue6 += TotalValue6;
            string Serchrg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1ServiceChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1ServiceChrg")).Text;
            TotalValue7      = Convert.ToDouble(Serchrg);
            SumFooterValue7 += TotalValue7;
            string Court = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1CourtChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1CourtChrg")).Text;
            TotalValue8      = Convert.ToDouble(Court);
            SumFooterValue8 += TotalValue8;
            string Sur = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1SurChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1SurChrg")).Text;
            TotalValue9      = Convert.ToDouble(Sur);
            SumFooterValue9 += TotalValue9;
            string OtrChrg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1OtherChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1OtherChrg")).Text;
            TotalValue10      = Convert.ToDouble(OtrChrg);
            SumFooterValue10 += TotalValue10;
            string BnkCrg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1BankChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1BankChrg")).Text;
            TotalValue11      = Convert.ToDouble(BnkCrg);
            SumFooterValue11 += TotalValue11;
            string InstCrgg = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1InsChrg")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1InsChrg")).Text;
            TotalValue12      = Convert.ToDouble(InstCrgg);
            SumFooterValue12 += TotalValue12;
            string Noofinst = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1NoOfInst")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1NoOfInst")).Text;
            TotalValue13      = Convert.ToDouble(Noofinst);
            SumFooterValue13 += TotalValue13;
            string Totttt = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1TotalDueAmt")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1TotalDueAmt")).Text;
            TotalValue14      = Convert.ToDouble(Totttt);
            SumFooterValue14 += TotalValue14;
            string SanAMount = string.IsNullOrEmpty(((Label)e.Row.FindControl("Lbl_L1SanAmount")).Text) ? "0" : ((Label)e.Row.FindControl("Lbl_L1SanAmount")).Text;
            TotalValue15      = Convert.ToDouble(SanAMount);
            SumFooterValue15 += TotalValue15;
        }

        if (e.Row.RowType == DataControlRowType.Footer)
        {
            Label lbl = (Label)e.Row.FindControl("lblInstTt");
            lbl.Text = SumFooterValue.ToString() + "";
            Label lbl1 = (Label)e.Row.FindControl("lblPrinciTt");
            lbl1.Text = SumFooterValue1.ToString() + "";
            Label lbl2 = (Label)e.Row.FindControl("lblOverdueTt");
            lbl2.Text = SumFooterValue2.ToString() + "";

            Label lbl3 = (Label)e.Row.FindControl("lblInttTt");
            lbl3.Text = SumFooterValue3.ToString() + "";
            Label lbl4 = (Label)e.Row.FindControl("lblPPInttTt");
            lbl4.Text = SumFooterValue4.ToString() + "";
            Label lbl5 = (Label)e.Row.FindControl("lblIntRec");
            lbl5.Text = SumFooterValue5.ToString() + "";

            Label lbl6 = (Label)e.Row.FindControl("lblNtcChrg");
            lbl6.Text = SumFooterValue6.ToString() + "";
            Label lbl7 = (Label)e.Row.FindControl("lblServiceChrg");
            lbl7.Text = SumFooterValue7.ToString() + "";
            Label lbl8 = (Label)e.Row.FindControl("lblCourtChrg");
            lbl8.Text = SumFooterValue8.ToString() + "";
            Label lbl9 = (Label)e.Row.FindControl("lblSurTChrg");
            lbl9.Text = SumFooterValue9.ToString() + "";
            Label lbl10 = (Label)e.Row.FindControl("lblOtherTChrg");
            lbl10.Text = SumFooterValue10.ToString() + "";
            Label lbl11 = (Label)e.Row.FindControl("lblBankTTChrg");
            lbl11.Text = SumFooterValue11.ToString() + "";
            Label lbl12 = (Label)e.Row.FindControl("lblInsTChrg");
            lbl12.Text = SumFooterValue12.ToString() + "";
            Label lbl13 = (Label)e.Row.FindControl("lblNoInsTChrg");
            lbl13.Text = SumFooterValue13.ToString() + "";
            Label lbl14 = (Label)e.Row.FindControl("lblTtotaldue");
            lbl14.Text = SumFooterValue14.ToString() + "";
            Label lbl15 = (Label)e.Row.FindControl("LblSanction");
            lbl15.Text = SumFooterValue15.ToString() + "";

            //if (lbl.Text == "0")
            //    lbl.Text = "";
            //if (lbl1.Text == "0")
            //    lbl1.Text = "";
            //if (lbl2.Text == "0")
            //    lbl2.Text = "";
            //if (lbl3.Text == "0")
            //    lbl3.Text = "";
            //if (lbl4.Text == "0")
            //    lbl4.Text = "";
            //if (lbl5.Text == "0")
            //    lbl5.Text = "";
            //if (lbl6.Text == "0")
            //    lbl6.Text = "";
            //if (lbl7.Text == "0")
            //    lbl7.Text = "";
            //if (lbl8.Text == "0")
            //    lbl8.Text = "";
            //if (lbl9.Text == "0")
            //    lbl9.Text = "";
            //if (lbl10.Text == "0")
            //    lbl10.Text = "";
            //    if (lbl11.Text == "0")
            //        lbl11.Text = "";
            //if (lbl12.Text == "0")
            //    lbl12.Text = "";
            //if (lbl13.Text == "0")
            //    lbl13.Text = "";
            //if (lbl14.Text == "0")
            //    lbl14.Text = "";
            //if (lbl15.Text == "0")
            //    lbl15.Text = "";
        }
    }