Exemplo n.º 1
0
    public bool checkBranchRole()
    {
        bool result = false;

        adminTableAdapters.tbl_secondary_rolesTableAdapter roles = new adminTableAdapters.tbl_secondary_rolesTableAdapter();
        admin.tbl_secondary_rolesDataTable tblroles = roles.GetRoleID(MySessionManager.CurrentUser.UserID);
        if (tblroles.Rows.Count > 0)
        {
            for (int i = 0; i < tblroles.Count; i++)
            {
                if (tblroles[i].datRoleID == 10 || tblroles[i].datRoleID == 11 || tblroles[i].datRoleID == 12)
                {
                    return(result = true);
                }
            }
        }
        return(result);
    }
Exemplo n.º 2
0
    public bool RoleExist(int role)
    {
        bool result = false;

        //string[] mroles;
        try
        {
            adminTableAdapters.tbl_secondary_rolesTableAdapter roles = new adminTableAdapters.tbl_secondary_rolesTableAdapter();
            admin.tbl_secondary_rolesDataTable tblroles = roles.GetRoleID(MySessionManager.CurrentUser.UserID);
            if (tblroles.Rows.Count > 0)
            {
                //mroles = new  string[tblroles.Count];
                for (int i = 0; i < tblroles.Count; i++)
                {
                    if (tblroles[i].datRoleID == role)
                    {
                        result = true;
                    }
                }
            }
        }
        catch (Exception ex) { }
        return(result);
    }
Exemplo n.º 3
0
    public string  getCTPartQuery(int userID)
    {
        string qry = "";

        try{
            adminTableAdapters.tbl_secondary_rolesTableAdapter roles = new adminTableAdapters.tbl_secondary_rolesTableAdapter();
            admin.tbl_secondary_rolesDataTable tblroles = roles.GetRoleID(MySessionManager.CurrentUser.UserID);
            if (tblroles.Rows.Count > 0)
            {
                for (int i = 0; i < tblroles.Count; i++)
                {
                    if (tblroles[i].datRoleID == 2)
                    {
                        qry += "AND tbl_loan_application.datCreditTeamID=" + tblroles[i].datTeamID.ToString() + "";
                    }
                }
            }
        }catch (Exception ex) { qry = ""; }
        if (qry == null || qry == "")
        {
            qry = " AND 0=1 ";
        }
        return(qry);
    }