Beispiel #1
0
 /// <summary>
 ///  To bind Content Lead details in gridview
 /// </summary>
 /// <param name="DtConLead"></param>
 private void BindConLead(DataTable DtConLead)
 {
     if (DtConLead.Rows.Count > 0)
     {
         GrdContentLead.DataSource = DtConLead;
         GrdContentLead.DataBind();
         for (int i = 0; i < GrdContentLead.Rows.Count; i++)
         {
             Label      lblConLeadUser = (GrdContentLead.Rows[i].FindControl("lblUser") as Label);
             Label      lblStatus      = (GrdContentLead.Rows[i].FindControl("lnkStatus") as Label);
             LinkButton lnkStatus      = (GrdContentLead.Rows[i].FindControl("lnkEdit") as LinkButton);
             string     Status         = lblStatus.CssClass.ToString();
             if (Status == "True")
             {
                 lblStatus.Text           = "Active";
                 lnkStatus.Text           = "Deactivate";
                 lnkStatus.Font.Underline = true;
             }
             else
             {
                 lblStatus.Text           = "InActive";
                 lnkStatus.Text           = "Activate";
                 lnkStatus.Font.Underline = true;
             }
         }
     }
     else
     {
         GrdContentLead.DataSource = null;
         GrdContentLead.DataBind();
     }
 }
Beispiel #2
0
    DataView DvConDev;                     // For Content Developer view

    /// <summary>
    /// Page Load Method
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        // To set Selected accordion open
        Accordion MasterAcc    = (Accordion)Master.FindControl("acdnMaster");
        int       ConLeadInd   = MasterAcc.SelectedIndex;
        int       ConLeadIndex = Convert.ToInt16(Session["SrNo"]);

        MasterAcc.SelectedIndex = ConLeadIndex - 1;
        // To select loginuser id and login username
        Login objConLead = new Login();

        objConLead.Start();
        UserName  = objConLead.LogedInUser;
        LoginUser = objConLead.LoginUser;
        Ret       = objConLead.Ret;
        if (!Page.IsPostBack)
        {
            IsActive = true;
            // To sort defaulty by Ascending order
            ViewState["Sort"] = "ASC";
            // To fetch Content Lead details having active status
            DataTable DtConLead = ConLeadActiveDetails(IsActive);
            ViewState["DtConLead"] = DtConLead;
            if (DtConLead.Rows.Count > 0)
            {
                BindConLead(DtConLead);
            }
            else
            {
                GrdContentLead.DataSource = null;
                GrdContentLead.DataBind();
            }
        }
    }