Ejemplo n.º 1
0
    private void ChnageGroupRoleStatus(int grId, int roleid, bool IsActive)
    {
        GroupRoleBAL gr     = new GroupRoleBAL();
        DataTable    dTable = new DataTable();

        try
        {
            int res = gr.UpdateGroupRole(grId, IsActive, LoginUser, Ret);
        }
        catch
        {
        }
        finally
        {
            gr = null;
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// To change status of Group Role details
    /// </summary>
    /// <param name="GrId"></param>
    /// <param name="RoleId"></param>
    /// <param name="IsActive"></param>
    private void ChangeGroupRoleStatus(int GrId, int RoleId, bool IsActive)
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();

        try
        {
            int IntResult = GroupRoleBAL.UpdateGroupRole(GrId, IsActive, LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            GroupRoleBAL = null;
        }
    }
    /// <summary>
    /// To get Group Role Details from database
    /// </summary>
    /// <param name="GroupRoleId"></param>
    /// <returns></returns>
    private DataTable GetGroupRoleDetails(int GroupRoleId)
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
        DataTable    DtGrpRolDe   = new DataTable();

        try
        {
            DtGrpRolDe = GroupRoleBAL.SelectGroupRoleID(GroupRoleId, LoginUser, Ret);
        }
        catch
        {
        }
        finally
        {
            GroupRoleBAL = null;
        }

        return(DtGrpRolDe);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// To get group Role details from Business logic layer
    /// </summary>
    /// <returns></returns>
    private DataTable GridDataSource()
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
        DataTable    DtGridDet    = new DataTable();

        try
        {
            DtGridDet = GroupRoleBAL.LoadAllGroupRole(LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            GroupRoleBAL = null;
        }
        return(DtGridDet);
    }
Ejemplo n.º 5
0
    /// <summary>
    /// To get Active Status group role details
    /// </summary>
    /// <returns></returns>
    private DataTable ActiveGridDataSource()
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
        DataTable    DtActSou     = new DataTable();

        try
        {
            DtActSou = GroupRoleBAL.LoadActiveGroupRole(true, LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            GroupRoleBAL = null;
        }
        return(DtActSou);
    }
Ejemplo n.º 6
0
    private DataTable getRoledetails(int Groupid)
    {
        GroupRoleBAL gr     = new GroupRoleBAL();
        DataTable    dTable = new DataTable();

        try
        {
            dTable = gr.SelectGroupID(true, Groupid, LoginUser, Ret);
        }
        catch
        {
        }
        finally
        {
            gr = null;
        }

        return(dTable);
    }
    /// <summary>
    /// To check status of group role
    /// </summary>
    /// <param name="NGRID"></param>
    /// <returns></returns>
    private DataTable CheckGroupRoleStatus(int NGRID)
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
        DataTable    DtGrpRolSta  = new DataTable();

        try
        {
            DtGrpRolSta = GroupRoleBAL.SelectGroupRoleID(NGRID, LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            GroupRoleBAL = null;
        }
        return(DtGrpRolSta);
    }
    /// <summary>
    /// To take Group Role list from database
    /// </summary>
    /// <returns></returns>
    private DataTable ddlGroupRoleDe()
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
        DataTable    DtGrpRolDe   = new DataTable();

        try
        {
            DtGrpRolDe = GroupRoleBAL.GroupRoleLoad(LoginUser, Ret);
        }
        catch
        {
            throw;
        }
        finally
        {
            GroupRoleBAL = null;
        }
        return(DtGrpRolDe);
    }
    /// <summary>
    /// To save and update Group Role Details
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string Status = ddlGroupRoleStatus.SelectedItem.Text;

        GroupId = Convert.ToInt16(ddlGroupName.SelectedValue);
        RoleId  = Convert.ToInt16(ddlRoleName.SelectedValue);
        if (Session["GroupRoleId"] != null)
        {
            GroupRoleId = Convert.ToInt32(Session["GroupRoleId"].ToString());
        }
        bool GroupRolestatus = false;

        if (ddlGroupRoleStatus.SelectedItem.Text != "Select")
        {
            if (Status == "Active")
            {
                GroupRolestatus = true;
            }
            else if (Status == "InActive")
            {
                GroupRolestatus = false;
            }
            if (btnSave.Text == "Save")
            {
                int          IntResult    = 0;
                GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
                try
                {
                    // 'InsertGroupRole' is GroupRole business Access Layer function called
                    // to insert GroupRole details
                    IntResult = GroupRoleBAL.InsertGroupRole(GroupId, RoleId, GroupRolestatus, LoginUser, Ret);
                    ClearGroupRole();
                    msgGroupRole.Msg = "Group Role details submitted successfully";
                    msgGroupRole.showmsg();
                }
                catch (Exception ee)
                {
                    // Duplicate Entry is catched when inserting GroupRole
                    if (ee.Message == "Duplicate Entry")
                    {
                        msgGroupRole.Msg = "Duplicate Entry!";
                        msgGroupRole.showmsg();
                        ClearGroupRole();
                    }
                }
                finally
                {
                    GroupRoleBAL = null;
                }
            }
            else if (btnSave.Text == "Update")
            {
                int          IntResult    = 0;
                GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
                try
                {
                    // 'UpdateGroupRole' is GroupRole business Access Layer function called
                    // to update GroupRole details
                    IntResult = GroupRoleBAL.UpdateGroupRole(GroupRoleId, GroupRolestatus, LoginUser, Ret);
                    ClearGroupRole();
                    Session["GroupId"] = null;
                    btnSave.Text       = "Save";
                    msgGroupRole.Msg   = "Group Role updated successfully";
                    msgGroupRole.showmsg();
                    //Response.Redirect("GroupRoleList.aspx",false);
                }
                catch (Exception ee)
                {
                    // Duplicate Entry is catched when updating GroupRole
                    if (ee.Message == "Duplicate Entry")
                    {
                        msgGroupRole.Msg = "Duplicate Entry!";
                        msgGroupRole.showmsg();
                    }
                }
                finally
                {
                    GroupRoleBAL = null;
                }
            }
        }
    }
 /// <summary>
 /// To get group Role details from Business logic layer
 /// </summary>
 /// <returns></returns>
 private DataTable GridDataSource()
 {
     GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
     DataTable DtGridDet = new DataTable();
     try
     {
         DtGridDet = GroupRoleBAL.LoadAllGroupRole(LoginUser, Ret);
     }
     catch
     {
         throw;
     }
     finally
     {
         GroupRoleBAL = null;
     }
     return DtGridDet;
 }
 /// <summary>
 /// To get Active Status group role details
 /// </summary>
 /// <returns></returns>
 private DataTable ActiveGridDataSource()
 {
     GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
     DataTable DtActSou = new DataTable();
     try
     {
         DtActSou = GroupRoleBAL.LoadActiveGroupRole(true, LoginUser, Ret);
     }
     catch
     {
         throw;
     }
     finally
     {
         GroupRoleBAL = null;
     }
     return DtActSou;
 }
 /// <summary>
 /// To take Group Role list from database
 /// </summary>
 /// <returns></returns>
 private DataTable ddlGroupRoleDe()
 {
     GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
     DataTable DtGrpRolDe = new DataTable();
     try
     {
         DtGrpRolDe = GroupRoleBAL.GroupRoleLoad(LoginUser, Ret );
     }
     catch
     {
         throw;
     }
     finally
     {
         GroupRoleBAL = null;
     }
     return DtGrpRolDe;
 }
 /// <summary>
 /// To check status of group role
 /// </summary>
 /// <param name="NGRID"></param>
 /// <returns></returns>
 private DataTable CheckGroupRoleStatus(int NGRID)
 {
     GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
     DataTable DtGrpRolSta = new DataTable();
     try
     {
         DtGrpRolSta = GroupRoleBAL.SelectGroupRoleID(NGRID, LoginUser, Ret);
     }
     catch
     {
         throw;
     }
     finally
     {
         GroupRoleBAL = null;
     }
     return DtGrpRolSta;
 }
 /// <summary>
 /// To save and update Group Role Details
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string Status = ddlGroupRoleStatus.SelectedItem.Text;
         GroupId = Convert.ToInt16(ddlGroupName.SelectedValue);
         RoleId = Convert.ToInt16(ddlRoleName.SelectedValue);
         if (Session["GroupRoleId"] != null)
         {
             GroupRoleId = Convert.ToInt32(Session["GroupRoleId"].ToString());
         }
         bool GroupRolestatus = false;
         if (ddlGroupRoleStatus.SelectedItem.Text != "Select")
         {
             if (Status == "Active")
             {
                 GroupRolestatus = true;
             }
             else if (Status == "InActive")
             {
                 GroupRolestatus = false;
             }
             if (btnSave.Text == "Save")
             {
                 int IntResult = 0;
                 GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
                 try
                 {
                     // 'InsertGroupRole' is GroupRole business Access Layer function called
                     // to insert GroupRole details
                     IntResult = GroupRoleBAL.InsertGroupRole(GroupId, RoleId, GroupRolestatus, LoginUser, Ret);
                     ClearGroupRole();
                     msgGroupRole.Msg = "Group Role details submitted successfully";
                     msgGroupRole.showmsg();
                 }
                 catch (Exception ee)
                 {
                     // Duplicate Entry is catched when inserting GroupRole
                     if (ee.Message == "Duplicate Entry")
                     {
                         msgGroupRole.Msg = "Duplicate Entry!";
                         msgGroupRole.showmsg();
                         ClearGroupRole();
                     }
                 }
                 finally
                 {
                     GroupRoleBAL = null;
                 }
             }
             else if (btnSave.Text == "Update")
             {
                 int IntResult = 0;
                 GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
                 try
                 {
                     // 'UpdateGroupRole' is GroupRole business Access Layer function called
                     // to update GroupRole details
                     IntResult = GroupRoleBAL.UpdateGroupRole(GroupRoleId, GroupRolestatus, LoginUser, Ret);
                     ClearGroupRole();
                     Session["GroupId"] = null;
                     btnSave.Text = "Save";
                     msgGroupRole.Msg = "Group Role updated successfully";
                     msgGroupRole.showmsg();
                     //Response.Redirect("GroupRoleList.aspx",false);
                 }
                 catch (Exception ee)
                 {
                     // Duplicate Entry is catched when updating GroupRole
                     if (ee.Message == "Duplicate Entry")
                     {
                         msgGroupRole.Msg = "Duplicate Entry!";
                         msgGroupRole.showmsg();
                     }
                 }
                 finally
                 {
                     GroupRoleBAL = null;
                 }
             }
         }
 }
    /// <summary>
    /// To get Group Role Details from database
    /// </summary>
    /// <param name="GroupRoleId"></param>
    /// <returns></returns>
    private DataTable GetGroupRoleDetails(int GroupRoleId)
    {
        GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
            DataTable DtGrpRolDe = new DataTable();
            try
            {
                DtGrpRolDe = GroupRoleBAL.SelectGroupRoleID(GroupRoleId, LoginUser, Ret);
            }
            catch
            {

            }
            finally
            {
                GroupRoleBAL = null;
            }

            return DtGrpRolDe;
    }
    private void ChnageGroupRoleStatus(int grId, int roleid, bool IsActive)
    {
        GroupRoleBAL gr = new GroupRoleBAL();
        DataTable dTable = new DataTable();
        try
        {
            int res = gr.UpdateGroupRole(grId, IsActive, LoginUser, Ret);

        }
        catch
        {

        }
        finally
        {
            gr = null;
        }
    }
    private DataTable getRoledetails(int Groupid)
    {
        GroupRoleBAL gr = new GroupRoleBAL();
        DataTable dTable = new DataTable();
        try
        {
            dTable = gr.SelectGroupID(true, Groupid, LoginUser, Ret);
        }
        catch
        {

        }
        finally
        {
            gr = null;
        }

        return dTable;
    }
 /// <summary>
 /// To change status of Group Role details
 /// </summary>
 /// <param name="GrId"></param>
 /// <param name="RoleId"></param>
 /// <param name="IsActive"></param>
 private void ChangeGroupRoleStatus(int GrId, int RoleId, bool IsActive)
 {
     GroupRoleBAL GroupRoleBAL = new GroupRoleBAL();
     try
     {
         int IntResult = GroupRoleBAL.UpdateGroupRole(GrId, IsActive, LoginUser, Ret);
     }
     catch
     {
         throw;
     }
     finally
     {
         GroupRoleBAL = null;
     }
 }