Пример #1
0
 /// <summary>
 ///  To edit content lead details in grid
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void lnkEdit_Click(object sender, EventArgs e)
 {
     LinkButton     lnk       = sender as LinkButton;
     GridViewRow    row       = (GridViewRow)lnk.Parent.Parent;
     int            Idx       = row.RowIndex;
     int            IntResult = 0;
     bool           Status;
     int            ConLeadID;
     ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
     LinkButton     lblIsActive    = (GrdContentLead.Rows[Idx].FindControl("lnkEdit") as LinkButton);
     Label          lblStatus      = (GrdContentLead.Rows[Idx].FindControl("lnkStatus") as Label);
     {
         if (lblStatus.Text == "Active" || lblStatus.Text == "True")
         {
             Status           = false;
             lblStatus.Text   = "InActive";
             lblIsActive.Text = "Activate";
         }
         else
         {
             Status           = true;
             lblStatus.Text   = "Active";
             lblIsActive.Text = "Deactivate";
         }
         ConLeadID            = Convert.ToInt32(lnk.CommandArgument.ToString());
         lblSelectID.Text     = ConLeadID.ToString();
         Session["ConLeadID"] = lblSelectID.Text;
         IntResult            = ContentLeadBAL.UpdateContentLead(ConLeadID, Status, LoginUser, Ret);
     }
 }
Пример #2
0
    /// <summary>
    ///  To save content lead details
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
        int            UserID         = Convert.ToInt32(ddlConLeadUser.SelectedValue.ToString());
        string         Status         = ddlConLeadStatus.SelectedValue.ToString();
        bool           IsActive       = true;

        if (Status == "Active")
        {
            IsActive = true;
        }
        else if (Status == "InActive")
        {
            IsActive = false;
        }
        if (btnSave.Text == "Save")
        {
            try
            {
                // 'InsertContentLead' is Content lead business Access Layer function called
                // to insert Content lead details
                int Result = ContentLeadBAL.InsertContentLead(UserID, IsActive, LoginUser, Ret);
                DtConLead = ConLeadDetails();
                ViewState["DtConLead"] = DtConLead;
                BindConLead(DtConLead);
                MsgConLead.Msg = "Record added successfully";
                MsgConLead.showmsg();
            }
            catch (Exception ee)
            {
                // Duplicate Entry is catched when inserting Content Developer
                if (ee.Message == "Duplicate Entry")
                {
                    MsgConLead.Msg = "Duplicate Entry!";
                    MsgConLead.showmsg();
                    ClearConLead();
                }
            }
            finally
            {
                // Object is closed after use
                ContentLeadBAL = null;
            }
        }
    }
Пример #3
0
    /// <summary>
    ///  To Load Active Status Content Lead details from 'Content Lead Business Access Layer'
    /// </summary>
    /// <param name="IsActive"></param>
    /// <returns></returns>
    protected DataTable ConLeadActiveDetails(bool IsActive)
    {
        ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
        DataTable      DtConLeadDet   = new DataTable();

        try
        {
            DtConLeadDet = ContentLeadBAL.LoadActiveContentLead(LoginUser, Ret, IsActive);
        }
        catch
        {
            throw;
        }
        finally
        {
            ContentLeadBAL = null;
        }

        return(DtConLeadDet);
    }
Пример #4
0
    /// <summary>
    ///  To get specific Content developer details
    /// </summary>
    /// <param name="ConLeadID"></param>
    /// <returns></returns>

    protected DataTable GetUserDetails(int ConLeadID)
    {
        ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
        DataTable      DtGetUserDet   = new DataTable();

        try
        {
            DtGetUserDet = ContentLeadBAL.SelectContentLeadId(ConLeadID, LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            ContentLeadBAL = null;
        }

        return(DtGetUserDet);
    }
 /// <summary>
 ///  To edit content lead details in grid
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void lnkEdit_Click(object sender, EventArgs e)
 {
     LinkButton lnk = sender as LinkButton;
     GridViewRow row = (GridViewRow)lnk.Parent.Parent;
     int Idx = row.RowIndex;
     int IntResult = 0;
     bool Status;
     int ConLeadID;
     ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
     LinkButton lblIsActive = (GrdContentLead.Rows[Idx].FindControl("lnkEdit") as LinkButton);
     Label lblStatus = (GrdContentLead.Rows[Idx].FindControl("lnkStatus") as Label);
     {
         if (lblStatus.Text == "Active" || lblStatus.Text == "True")
         {
             Status = false;
             lblStatus.Text = "InActive";
             lblIsActive.Text = "Activate";
         }
         else
         {
             Status = true;
             lblStatus.Text = "Active";
             lblIsActive.Text = "Deactivate";
         }
         ConLeadID = Convert.ToInt32(lnk.CommandArgument.ToString());
         lblSelectID.Text = ConLeadID.ToString();
         Session["ConLeadID"] = lblSelectID.Text;
         IntResult = ContentLeadBAL.UpdateContentLead(ConLeadID, Status, LoginUser, Ret);
     }
 }
    /// <summary>
    ///  To get specific Content developer details 
    /// </summary>
    /// <param name="ConLeadID"></param>
    /// <returns></returns>
    protected DataTable GetUserDetails(int ConLeadID)
    {
        ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
        DataTable DtGetUserDet = new DataTable();
        try
        {
            DtGetUserDet = ContentLeadBAL.SelectContentLeadId(ConLeadID, LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            ContentLeadBAL = null;
        }

        return DtGetUserDet;
    }
    /// <summary>
    /// To bind Content lead of 'Active' and 'InActive' Status
    /// </summary>
    /// <returns></returns>
    protected DataTable ConLeadDetails()
    {
        ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
        DataTable DtConLeadDet = new DataTable();
        try
        {
            DtConLeadDet = ContentLeadBAL.LoadContentLeadAll(LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            ContentLeadBAL = null;
        }

        return DtConLeadDet;
    }
    /// <summary>
    ///  To Load Active Status Content Lead details from 'Content Lead Business Access Layer'
    /// </summary>
    /// <param name="IsActive"></param>
    /// <returns></returns>
    protected DataTable ConLeadActiveDetails(bool IsActive)
    {
        ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
        DataTable DtConLeadDet = new DataTable();
        try
        {
            DtConLeadDet = ContentLeadBAL.LoadActiveContentLead(LoginUser, Ret, IsActive);
        }
        catch
        {
            throw;
        }
        finally
        {
            ContentLeadBAL = null;
        }

        return DtConLeadDet;
    }
 /// <summary>
 ///  To save content lead details 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ContentLeadBAL ContentLeadBAL = new ContentLeadBAL();
     int UserID = Convert.ToInt32(ddlConLeadUser.SelectedValue.ToString());
     string Status = ddlConLeadStatus.SelectedValue.ToString();
     bool IsActive = true;
     if (Status == "Active")
     {
         IsActive = true;
     }
     else if (Status == "InActive")
     {
         IsActive = false;
     }
     if (btnSave.Text == "Save")
     {
         try
         {
             // 'InsertContentLead' is Content lead business Access Layer function called
             // to insert Content lead details
             int Result = ContentLeadBAL.InsertContentLead(UserID, IsActive, LoginUser, Ret);
             DtConLead = ConLeadDetails();
             ViewState["DtConLead"] = DtConLead;
             BindConLead(DtConLead);
             MsgConLead.Msg = "Record added successfully";
             MsgConLead.showmsg();
         }
         catch(Exception ee)
         {
             // Duplicate Entry is catched when inserting Content Developer
             if (ee.Message == "Duplicate Entry")
             {
                 MsgConLead.Msg = "Duplicate Entry!";
                 MsgConLead.showmsg();
                 ClearConLead();
             }
         }
         finally
         {
             // Object is closed after use
             ContentLeadBAL = null;
         }
     }
 }