コード例 #1
0
 public AjaxRspJson LoadMenu(string Language, string UserCode)
 {
     try
     {
         LoadMenuUnionCompany loadMenuUnion = _login.LoadMenu(UserCode, Language);
         return(new AjaxRspJson {
             RspCode = RspStatus.Successed, ObjectData = loadMenuUnion, RspMsg = ""
         });
     }
     catch (Exception ex)
     {
         return(new AjaxRspJson {
             RspCode = RspStatus.Failed, ObjectData = null, RspMsg = ex.Message
         });
     }
 }
コード例 #2
0
        public static LoadMenuUnionCompany LoadMenu(string UserCode, string Language)
        {
            string sql = @"Select * from V_FLC_MENU where lan = :lan 
                                       and menucode in (select menu_id from FLC_MENU_AUTH where role_code 
                                       in (select role_code from DATA_ROLE_USER where user_code = :user_code))  and is_show=1 and is_admin in (0)
                                       order by disp_order";

            string sqladmins = @"select count(1) from data_role_user where role_code in('admins_group' ,'DATA-MANAGER')  and user_code='" + UserCode + "'";

            object o = AppDataBase.ExecuteScalar(sqladmins);

            if (o != null && o.ToString() != "0")
            {
                sql = "select * from V_FLC_MENU where lan = :lan  and is_show=1 and is_sys <> 1 and is_admin in (0,1) order by disp_order";
            }
            if (System.IO.File.Exists("admin"))
            {
                sql = @"select * from V_FLC_MENU where lan = :lan  and is_show=1 order by disp_order";
            }

            var param = new DynamicParameters();

            param.Add(":user_code", UserCode);
            param.Add(":lan", Language);

            IEnumerable <LoadMenu> menuRoles = AppDataBase.Query <LoadMenu>(sql, param);

            sql = "select id,name from data_company where rownum=1";
            Company company = AppDataBase.QuerySingle <Company>(sql);

            LoadMenuUnionCompany loadMenuUnionCompany = new LoadMenuUnionCompany();

            loadMenuUnionCompany.company  = company;
            loadMenuUnionCompany.loadMenu = menuRoles;

            return(loadMenuUnionCompany);
        }
コード例 #3
0
        public LoadMenuUnionCompany LoadMenu(string UserCode, string Language)
        {
            LoadMenuUnionCompany loadMenuUnionCompany = LoginDataAccess.LoadMenu(UserCode, Language);

            return(loadMenuUnionCompany);
        }