using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OracleClient;
using System.Diagnostics;

public partial class POS_ClaimHistory : System.Web.UI.Page
{
    
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            
            loadStatus();
            rdATM_CheckedChanged(sender, e);

            string ClaimID = Request.QueryString["clID"] as string;
            if (!String.IsNullOrWhiteSpace(ClaimID))
            {
                txtClaimID.Text = ClaimID;
                loadClaims(Helper.gridSize(), 1);
            }
          
        }
    }

    private void loadStatus()
    {
        try
        {
            string DBConnection = Helper.dbConnection();

            OracleConnection oracon = new OracleConnection(DBConnection);
            oracon.Open();

            OracleCommand oracom = new OracleCommand();
            oracom.Connection = oracon;

            oracom.CommandType = CommandType.StoredProcedure;
            oracom.CommandText = "poslookup_getter.get_claim_status";

            oracom.Parameters.Add("p_claim_id", OracleType.Cursor).Direction = ParameterDirection.Output;

            OracleDataAdapter da = new OracleDataAdapter(oracom);
            DataSet ds = new DataSet();
            da.Fill(ds);

            ddlClaimType.DataSource = ds;
            ddlClaimType.DataBind();


            ddlClaimType.Items.Insert(0, "------ All ------");
            oracon.Close();
        }
        catch (Exception ex)
        {
           
        }
    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        txtClaimID.Text = txtClaimID.Text.Trim();
        txtReference.Text = txtReference.Text.Trim();
        txtCardNumber.Text = txtCardNumber.Text.Trim();
       
        loadClaims(Helper.gridSize(), 1);
        

    }

    protected void ddlPages_SelectedIndexChanged(object sender, EventArgs e)
    {
        
      
        loadClaims(Helper.gridSize(), int.Parse(ddlPages.SelectedValue));
    }

    private void loadClaims(int pageSize, int pageNumber)
    {
       
        try
        {
            string currentMethod = "";
            StackTrace stackTrace = new StackTrace();
            currentMethod = stackTrace.GetFrame(1).GetMethod().Name;
            string DBConnection = Helper.dbConnection();

            OracleConnection oracon = new OracleConnection(DBConnection);
            oracon.Open();

            OracleCommand oracom = new OracleCommand();
            oracom.Connection = oracon;

            oracom.CommandType = CommandType.StoredProcedure;
            oracom.CommandText = "claim_history.get_claim_history";

            oracom.Parameters.Add("c_current_uid", OracleType.Number).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("c_claim_id", OracleType.VarChar).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("c_card_number", OracleType.VarChar).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("c_claim_date", OracleType.VarChar).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("c_claim_status", OracleType.VarChar).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("c_rrn", OracleType.VarChar).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("p_page_size", OracleType.Number).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("p_page_num", OracleType.Number).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("p_lang", OracleType.VarChar).Direction = ParameterDirection.Input;
            oracom.Parameters.Add("p_res_code", OracleType.Number).Direction = ParameterDirection.Output;
            oracom.Parameters.Add("p_res_type", OracleType.VarChar, 250).Direction = ParameterDirection.Output;
            oracom.Parameters.Add("p_res_msg", OracleType.VarChar, 250).Direction = ParameterDirection.Output;
            oracom.Parameters.Add("p_out_claim_hist", OracleType.Cursor).Direction = ParameterDirection.Output;
            oracom.Parameters.Add("p_total_pages", OracleType.Number).Direction = ParameterDirection.Output;


            oracom.Parameters["c_claim_id"].Value = txtClaimID.Text;              
            oracom.Parameters["c_card_number"].Value = txtCardNumber.Text;              
            oracom.Parameters["c_claim_date"].Value = dtTranDate.date;               
            if (ddlClaimType.SelectedIndex > 0)
            {               
                oracom.Parameters["c_claim_status"].Value = ddlClaimType.SelectedValue;
            }
            else
                oracom.Parameters["c_claim_status"].Value = OracleString.Null;
            oracom.Parameters["c_rrn"].Value = txtReference.Text.Trim ();
            oracom.Parameters["p_page_size"].Value = pageSize;
            oracom.Parameters["p_page_num"].Value = pageNumber;
            oracom.Parameters["p_lang"].Value = "EN";
            oracom.Parameters["c_current_uid"].Value = Session["uid"].ToString();

            OracleDataAdapter da = new OracleDataAdapter(oracom);
            DataSet ds = new DataSet();
            da.Fill(ds);

            int nop = int.Parse(oracom.Parameters["p_total_pages"].Value.ToString());
            oracon.Close();

            GridView1.DataSource = ds;
            GridView1.DataBind();
            if (pageNumber == 1)
            {
                ddlPages.Items.Clear();
                for (int i = 1; i <= nop; i++)
                {
                    ddlPages.Items.Add(i.ToString());
                }
            }
            
           
        }
        catch (Exception ex)
        {
           
        }
    }

    protected void rdATM_CheckedChanged(object sender, EventArgs e)
    {
        rowATM.Visible = true;
        rowPOS.Visible = false;
        rowPOS2.Visible = false;
    }

    protected void rdPOS_CheckedChanged(object sender, EventArgs e)
    {
        rowATM.Visible = false;
        rowPOS.Visible = true;
        rowPOS2.Visible = true;
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("v"))
        {
            pnlClaim.Visible = true;
           
                int index = int.Parse(e.CommandArgument.ToString());
                string claimID = GridView1.DataKeys[index].Value.ToString();
                string lastAmendmentDate = GridView1.Rows[index].Cells[11].Text.Trim();
               
                loadClaimHistoryDetails(claimID, lastAmendmentDate);
                
            
        }
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        pnlClaim.Visible = false;
        
        
    }
    private void loadClaimHistoryDetails(string claimID,string lastAmendmentDate)
    {
        string fromAcct="", toAcct="", newRRN="", lastAmendmentDate1="", note="", claimStatus="",messageText="",samaStatus="",creditIssuer="",creditAcquirer="",debitIssuer="",debitAcquirer="",claimType="",samaFileID="",samaClaimID="",cardNumber="",tranDate="",tranTime="",termID="",tranCurr="",tranAmount="",pCode="",traceID="",authCode="",rrn="",financialFlag="",claimSource="",claimCurr="",claimAmount="",onUsFileID="",acquirerBankCode="",issuerBankCode="";
        string DBConnection = Helper.dbConnection();

        OracleConnection oracon = new OracleConnection(DBConnection);
        oracon.Open();

        OracleCommand oracom = new OracleCommand();
        oracom.Connection = oracon;

        oracom.CommandType = CommandType.StoredProcedure;
        oracom.CommandText = "CLAIM_HISTORY.get_claim_history_details";

        oracom.Parameters.Add("p_claim_id", OracleType.VarChar).Direction = ParameterDirection.Input;
        oracom.Parameters.Add("p_last_amendment_date", OracleType.DateTime).Direction = ParameterDirection.Input;
        oracom.Parameters.Add("p_outputclaim", OracleType.Cursor).Direction = ParameterDirection.Output;

        oracom.Parameters["p_claim_id"].Value = claimID;
        oracom.Parameters["p_last_amendment_date"].Value = lastAmendmentDate;

        OracleDataAdapter da = new OracleDataAdapter(oracom);
        DataSet ds = new DataSet();
        da.Fill(ds);

        oracon.Close();

        lblClaimStatus.BackColor = System.Drawing.Color.Transparent;
        lblLastAmendmentDate.BackColor = System.Drawing.Color.Transparent;
        lblNoteText.BackColor = System.Drawing.Color.Transparent;
        lblFromAccount.BackColor = System.Drawing.Color.Transparent;
        lblToAccount.BackColor = System.Drawing.Color.Transparent;
        lblNewRRN.BackColor = System.Drawing.Color.Transparent;
        lblMessageText.BackColor = System.Drawing.Color.Transparent;
        lblSAMAStatus.BackColor = System.Drawing.Color.Transparent;
        lblCreditIssuer.BackColor = System.Drawing.Color.Transparent;
        lblCreditAquirer.BackColor = System.Drawing.Color.Transparent;
        lblDebitIssuer.BackColor = System.Drawing.Color.Transparent;
        lblDebitAcquirer.BackColor = System.Drawing.Color.Transparent;
        lblClaimType.BackColor = System.Drawing.Color.Transparent;
        lblSAMAFileID.BackColor = System.Drawing.Color.Transparent;
        lblSamaClaimId.BackColor = System.Drawing.Color.Transparent;
        lblCardNo.BackColor = System.Drawing.Color.Transparent;
        lblTransactionDate.BackColor = System.Drawing.Color.Transparent;
        lblTransactionTime.BackColor = System.Drawing.Color.Transparent;
        lblTerminalID.BackColor = System.Drawing.Color.Transparent;
        lblTransactionCurrency.BackColor = System.Drawing.Color.Transparent;
        lblTransactionAmount.BackColor = System.Drawing.Color.Transparent;
        lblProcessCode.BackColor = System.Drawing.Color.Transparent;
        lblTraceID.BackColor = System.Drawing.Color.Transparent;
        lblAuthorizationCode.BackColor = System.Drawing.Color.Transparent;
        lbl_RRN.BackColor = System.Drawing.Color.Transparent;
        lblFinancialFlag.BackColor = System.Drawing.Color.Transparent;
        lblClaimSource.BackColor = System.Drawing.Color.Transparent;
        lblClaimCurrency.BackColor = System.Drawing.Color.Transparent;
        lblClaimAmount.BackColor = System.Drawing.Color.Transparent;
        lblOnUsFileID.BackColor = System.Drawing.Color.Transparent;
        lblIssuerBank.BackColor = System.Drawing.Color.Transparent;
        lblAcquirerBank.BackColor = System.Drawing.Color.Transparent;

        lblMessageText1.Font.Bold = false;
        lblSamaClaimId1.Font.Bold = false;
        lblClaimStatus1.Font.Bold = false;
        lblTransactionAmount1.Font.Bold = false;
        lblClaimType1.Font.Bold = false;
        lblClaimAmount1.Font.Bold = false;
        lblSAMAFileID1.Font.Bold = false;
        lblOnUsFileID1.Font.Bold = false;
        lblNoteText.Font.Bold = false;
        lblSAMAStatus.Font.Bold = false;
        lblFromAccount.Font.Bold = false;
        lblToAccount.Font.Bold = false;
        lblNewRRN.Font.Bold = false;
        lblCreditIssuer.Font.Bold = false;
        lblCreditAquirer.Font.Bold = false;
        lblDebitIssuer.Font.Bold = false;
        lblDebitAcquirer.Font.Bold = false;
        //set the data in the controls
        int count = ds.Tables[0].Rows.Count;
        
        lblClaim.Text = claimID;
        lblSamaClaimId.Text = ds.Tables[0].Rows[0]["org_claim_id"].ToString();
        lblClaimStatus.Text = ds.Tables[0].Rows[0]["claim_status"].ToString(); 
        lblLastAmendmentDate.Text = ds.Tables[0].Rows[0]["last_modified_by"].ToString();      
        lblCardNo.Text = ds.Tables[0].Rows[0]["card_number"].ToString();
        lblTransactionDate.Text = ds.Tables[0].Rows[0]["tran_date"].ToString();
        lblTransactionTime.Text = ds.Tables[0].Rows[0]["tran_time"].ToString();
        lblTerminalID.Text = ds.Tables[0].Rows[0]["term_id"].ToString();
        lblTransactionCurrency.Text = ds.Tables[0].Rows[0]["tran_curr"].ToString();
        lblTransactionAmount.Text = ds.Tables[0].Rows[0]["tran_amount"].ToString();
        lblProcessCode.Text = ds.Tables[0].Rows[0]["pcode"].ToString();
        lblTraceID.Text = ds.Tables[0].Rows[0]["trace_id"].ToString();
        lblAuthorizationCode.Text = ds.Tables[0].Rows[0]["auth_code"].ToString();
        lbl_RRN.Text = ds.Tables[0].Rows[0]["rrn"].ToString();
        lblFinancialFlag.Text = ds.Tables[0].Rows[0]["financial_flag"].ToString();
        lblClaimSource.Text = ds.Tables[0].Rows[0]["claim_source"].ToString();
        lblClaimType.Text = ds.Tables[0].Rows[0]["claim_type"].ToString();
        lblClaimCurrency.Text = ds.Tables[0].Rows[0]["claim_curr"].ToString();
        lblClaimAmount.Text = ds.Tables[0].Rows[0]["claim_amount"].ToString();
        lblSAMAFileID.Text = ds.Tables[0].Rows[0]["sama_file_id"].ToString();
        lblOnUsFileID.Text = ds.Tables[0].Rows[0]["onus_file_id"].ToString();
        lblIssuerBank.Text = ds.Tables[0].Rows[0]["issuer_bank_code"].ToString();
        lblAcquirerBank.Text = ds.Tables[0].Rows[0]["ACQUIRER_BANK_CODE"].ToString();
        lblMessageText.Text = ds.Tables[0].Rows[0]["message_text"].ToString();
        lblNoteText.Text = ds.Tables[0].Rows[0]["note_text"].ToString();       
        lblParentClaimID.Text = ds.Tables[0].Rows[0]["parent_claim_id"].ToString();
        lblClientNumber.Text = ds.Tables[0].Rows[0]["client_number"].ToString();
        lblSAMAStatus.Text = ds.Tables[0].Rows[0]["sama_status"].ToString();
        lblProduct.Text = ds.Tables[0].Rows[0]["product_desc"].ToString();
        lblEventCode.Text = ds.Tables[0].Rows[0]["event"].ToString();
        lblFromAccount.Text = ds.Tables[0].Rows[0]["from_acct_desc"].ToString();      
        lblToAccount.Text = ds.Tables[0].Rows[0]["to_acct_desc"].ToString();
        lblNewRRN.Text = ds.Tables[0].Rows[0]["new_rrn"].ToString();      
        lblCreditIssuer.Text = ds.Tables[0].Rows[0]["credit_issuer"].ToString();
        lblCreditAquirer.Text = ds.Tables[0].Rows[0]["credit_acquirer"].ToString();
        lblDebitIssuer.Text = ds.Tables[0].Rows[0]["debit_issuer"].ToString();
        lblDebitAcquirer.Text = ds.Tables[0].Rows[0]["debit_acquirer"].ToString();

        if (count == 2)
        {
            fromAcct = ds.Tables[0].Rows[1]["from_acct_desc"].ToString();
            toAcct = ds.Tables[0].Rows[1]["to_acct_desc"].ToString();
            newRRN = ds.Tables[0].Rows[1]["new_rrn"].ToString();
            lastAmendmentDate1 = ds.Tables[0].Rows[1]["last_modified_by"].ToString();
            note = ds.Tables[0].Rows[1]["note_text"].ToString();
            claimStatus = ds.Tables[0].Rows[1]["claim_status"].ToString();
            messageText = ds.Tables[0].Rows[1]["message_text"].ToString();
            samaStatus = ds.Tables[0].Rows[1]["sama_status"].ToString();
            creditIssuer = ds.Tables[0].Rows[1]["credit_issuer"].ToString();
            creditAcquirer  = ds.Tables[0].Rows[1]["credit_acquirer"].ToString();
            debitIssuer  = ds.Tables[0].Rows[1]["debit_issuer"].ToString();
            debitAcquirer  = ds.Tables[0].Rows[1]["debit_acquirer"].ToString();
            claimType = ds.Tables[0].Rows[1]["claim_type"].ToString();
            samaFileID  = ds.Tables[0].Rows[1]["sama_file_id"].ToString();
            samaClaimID = ds.Tables[0].Rows[1]["org_claim_id"].ToString();
            cardNumber  = ds.Tables[0].Rows[1]["card_number"].ToString();
            tranDate  = ds.Tables[0].Rows[1]["tran_date"].ToString();
            tranTime = ds.Tables[0].Rows[1]["tran_time"].ToString();
            termID = ds.Tables[0].Rows[1]["term_id"].ToString();
            tranCurr = ds.Tables[0].Rows[1]["tran_curr"].ToString();
            tranAmount  = ds.Tables[0].Rows[1]["tran_amount"].ToString();
            pCode  = ds.Tables[0].Rows[1]["pcode"].ToString();
            traceID  = ds.Tables[0].Rows[1]["trace_id"].ToString();
            authCode  = ds.Tables[0].Rows[1]["auth_code"].ToString();
            rrn  = ds.Tables[0].Rows[1]["rrn"].ToString();
            financialFlag = ds.Tables[0].Rows[1]["financial_flag"].ToString();
            claimSource  = ds.Tables[0].Rows[1]["claim_source"].ToString();
            claimCurr = ds.Tables[0].Rows[1]["claim_curr"].ToString();
            claimAmount  = ds.Tables[0].Rows[1]["claim_amount"].ToString();
            onUsFileID  = ds.Tables[0].Rows[1]["onus_file_id"].ToString();
            issuerBankCode  = ds.Tables[0].Rows[1]["issuer_bank_code"].ToString();
            acquirerBankCode  = ds.Tables[0].Rows[1]["ACQUIRER_BANK_CODE"].ToString();

            if (!fromAcct.Equals(lblFromAccount.Text))
            {
                lblFromAccount.BackColor = System.Drawing.Color.DarkGray;
                if (lblFromAccount.Text.Trim().Length == 0)
                    lblFromAccount1.Font.Bold = true;
            }
            if (!toAcct.Equals(lblToAccount.Text))
            {
                lblToAccount.BackColor = System.Drawing.Color.DarkGray;
                if (lblToAccount.Text.Trim().Length == 0)
                    lblToAccount1.Font.Bold = true;
            }
            if (!newRRN.Equals(lblNewRRN.Text))
            {
                lblNewRRN.BackColor = System.Drawing.Color.DarkGray;
                if (lblNewRRN.Text.Trim().Length == 0)
                    lblNewRRN1.Font.Bold = true;
            }
            if (!lastAmendmentDate1.Equals(lblLastAmendmentDate.Text))            
                lblLastAmendmentDate.BackColor = System.Drawing.Color.DarkGray;

            if (!note.Equals(lblNoteText.Text))
            {
                lblNoteText.BackColor = System.Drawing.Color.DarkGray;
                if (lblNoteText.Text.Trim().Length == 0)
                    lblNoteText1.Font.Bold = true;
            }
            if (!claimStatus.Equals(lblClaimStatus.Text))
                lblClaimStatus.BackColor = System.Drawing.Color.DarkGray;
            if (!messageText.Equals(lblMessageText.Text))
            {
                lblMessageText.BackColor = System.Drawing.Color.DarkGray;
                if (lblMessageText.Text.Trim().Length ==0)
                    lblMessageText1.Font.Bold = true;
                
            }
            if (!samaStatus.Equals(lblSAMAStatus.Text))
            {
                lblSAMAStatus.BackColor = System.Drawing.Color.DarkGray;
                if (lblSAMAStatus.Text.Trim().Length == 0)
                    lblSAMAStatus1.Font.Bold = true;
            }
            if (!creditIssuer.Equals(lblCreditIssuer.Text))
            {
                lblCreditIssuer.BackColor = System.Drawing.Color.DarkGray;
                if (lblCreditIssuer.Text.Trim().Length == 0)
                    lblCreditIssuer1.Font.Bold = true;
            }
            if (!creditAcquirer.Equals(lblCreditAquirer.Text))
            {
                lblCreditAquirer.BackColor = System.Drawing.Color.DarkGray;
                if (lblCreditAquirer.Text.Trim().Length == 0)
                    lblCreditAcquirer1.Font.Bold = true;
            }
            if (!debitIssuer.Equals(lblDebitIssuer.Text))
            {
                lblDebitIssuer.BackColor = System.Drawing.Color.DarkGray;
                if (lblCreditAquirer.Text.Trim().Length == 0)
                    lblCreditAcquirer1.Font.Bold = true;
            }
            if (!debitAcquirer.Equals(lblDebitAcquirer.Text))
            {
                lblDebitAcquirer.BackColor = System.Drawing.Color.DarkGray;
                if (lblDebitAcquirer.Text.Trim().Length == 0)
                    lblDebitAcquirer1.Font.Bold = true;
            }
            if (!claimType.Equals(lblClaimType.Text))
            {
                lblClaimType.BackColor = System.Drawing.Color.DarkGray;
                if (lblClaimType.Text.Trim().Length == 0)
                    lblClaimType1.Font.Bold = true;
            }
            if (!samaFileID.Equals(lblSAMAFileID.Text))
            {
                lblSAMAFileID.BackColor = System.Drawing.Color.DarkGray;
                if (lblSAMAFileID.Text.Trim().Length == 0)
                    lblSAMAFileID1.Font.Bold = true;
            }
            if (!samaClaimID.Equals(lblSamaClaimId.Text))
            {
                lblSamaClaimId.BackColor = System.Drawing.Color.DarkGray;
                if (lblSamaClaimId.Text.Trim().Length == 0)
                    lblSamaClaimId1.Font.Bold = true;
            }
            if (!cardNumber.Equals(lblCardNo.Text))           
                lblCardNo.BackColor = System.Drawing.Color.DarkGray;
                
            if (!tranTime .Equals(lblTransactionTime .Text))
                lblTransactionTime.BackColor = System.Drawing.Color.DarkGray;
            if (!tranDate .Equals(lblTransactionDate .Text))
                lblTransactionDate.BackColor = System.Drawing.Color.DarkGray;
            if (!termID.Equals(lblTerminalID.Text))
                lblTerminalID.BackColor = System.Drawing.Color.DarkGray;
            if (!tranCurr .Equals(lblTransactionCurrency .Text))
                lblTransactionCurrency.BackColor = System.Drawing.Color.DarkGray;
            if (!tranAmount.Equals(lblTransactionAmount.Text))
            {
                lblTransactionAmount.BackColor = System.Drawing.Color.DarkGray;
                if (lblTransactionAmount.Text.Trim().Length == 0)
                    lblTransactionAmount1.Font.Bold = true;
            }
            if (!pCode.Equals(lblProcessCode .Text))
                lblProcessCode.BackColor = System.Drawing.Color.DarkGray;
            if (!traceID.Equals(lblTraceID .Text))
                lblTraceID.BackColor = System.Drawing.Color.DarkGray;
            if (!authCode .Equals(lblAuthorizationCode .Text))
                lblAuthorizationCode.BackColor = System.Drawing.Color.DarkGray;
            if (!rrn.Equals(lbl_RRN .Text))
                lbl_RRN.BackColor = System.Drawing.Color.DarkGray;
            if (!financialFlag .Equals(lblFinancialFlag .Text))
                lblFinancialFlag.BackColor = System.Drawing.Color.DarkGray;
            if (!claimSource .Equals(lblClaimSource .Text))
                lblClaimSource.BackColor = System.Drawing.Color.DarkGray;
            if (!claimCurr .Equals(lblClaimCurrency .Text))
                lblClaimCurrency.BackColor = System.Drawing.Color.DarkGray;
            if (!claimAmount.Equals(lblClaimAmount.Text))
            {
                lblClaimAmount.BackColor = System.Drawing.Color.DarkGray;
                if (lblClaimAmount.Text.Trim().Length == 0)
                    lblClaimAmount1.Font.Bold = true;
            }
            if (!onUsFileID.Equals(lblOnUsFileID.Text))
            {
                lblOnUsFileID.BackColor = System.Drawing.Color.DarkGray;
                if (lblOnUsFileID.Text.Trim().Length == 0)
                    lblOnUsFileID.Font.Bold = true;
            }
            if (!issuerBankCode.Equals(lblIssuerBank.Text))
                lblIssuerBank.BackColor = System.Drawing.Color.DarkGray;
            if (!acquirerBankCode.Equals(lblAcquirerBank .Text))
                lblAcquirerBank.BackColor = System.Drawing.Color.DarkGray;
        }
       
      
    }
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow || e.Row .RowType ==DataControlRowType.Header)
        {
            e.Row.Cells[11].Visible = false;
        }
    }
}
