Пример #1
0
    public static DataTable GetUserlist()
    {
        string sql = "select FNAME  from T_SEC_USER ";

        DataAccess.DALTranscation dal = new DataAccess.DALTranscation();
        DataTable dt = dal.GetDataTableBySQLText(sql);

        return(dt);
    }
Пример #2
0
    public static DataTable GetModeRoleName()
    {
        string sql = "select ModeRoleName  from ModelRoleManage";

        DataAccess.DALTranscation dal = new DataAccess.DALTranscation();
        DataTable dt = dal.GetDataTableBySQLText(sql);

        return(dt);
    }
Пример #3
0
    public static DataTable GetModeType()
    {
        string sql = "select '请选择' as ModeType, '' as value , 'A' as seq  union  select distinct ModeType,  ModeType as value, 'b' as seq from ModelRoleManage order by seq";

        DataAccess.DALTranscation dal = new DataAccess.DALTranscation();
        DataTable dt = dal.GetDataTableBySQLText(sql);

        return(dt);
    }
Пример #4
0
    public static bool  SaveModeRole(string username, string moderolename)
    {
        DC_Error error     = new DC_Error();
        int      iAffected = 0;
        Dictionary <string, object> dic = new Dictionary <string, object>();

        dic.Add("@username", username);
        dic.Add("@moleRoleName", moderolename);
        DataAccess.DALTranscation myDALTranscation = new DataAccess.DALTranscation();
        bool result = myDALTranscation.ExecuteTransactionSP("usp_SaveModeRoleManage", dic, ref error, ref iAffected);

        return(result);
    }
Пример #5
0
    public static bool CheckModelByUserID(int userid, string type, string mode, ref string errorMessage)
    {
        string strsql = "select * from ModelRoleManage m inner join UserRoleManage u on m.id = u.id " +
                        "where m.moderoleName = '" + mode + "' and m.modetype = '" + type + "' and u.fuserid = " + userid + " ";

        DataAccess.DALTranscation dal = new DataAccess.DALTranscation();
        DataTable dt = dal.GetDataTableBySQLText(strsql);

        if (dt != null && dt.Rows.Count > 0)
        {
            return(true);
        }
        else
        {
            errorMessage = "当前用户没有权限操作,请联系管理员.";
            return(false);
        }
    }
Пример #6
0
    public static DataTable GetUserData(string modename, string username)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("select t.FNAME ,m.modeRoleName, m.ModeType from ModelRoleManage m inner join UserRoleManage u on m.id = u.id ");
        strSql.Append(" inner join T_SEC_USER t on t.FUSERID = u.fuserid  where 1=1 ");
        if (modename != "")
        {
            strSql.Append(" and m.modetype='" + modename + "'");
        }
        if (username != "")
        {
            strSql.Append(" and t.FNAME like '%" + username + "%'");
        }
        strSql.Append(" order by t.fname");
        DataAccess.DALTranscation dal = new DataAccess.DALTranscation();
        DataTable dt = dal.GetDataTableBySQLText(strSql.ToString());

        return(dt);
    }