Example #1
0
        public static DataSet GetSingleOrderByMenuId(string meunuPId, string roleId)
        {
            IRoleMenuAppService service = IocManager.Instance.Resolve <IRoleMenuAppService>();

            if (service == null)
            {
                return(null);
            }
            else
            {
                int pid = 0;
                int.TryParse(meunuPId, out pid);
                var list = service.GetList(pid, roleId);
                list = list.OrderBy(x => x.Menu_id).ToList();
                if ((list != null) && (list.Count > 0))
                {
                    List <RoleMenu> userList = new List <RoleMenu>();
                    userList.Add(ConvertFromDto(list[0]));
                    return(userList.ToDataSet <RoleMenu>());
                }
                else
                {
                    DataSet ds = new DataSet();
                    return(ds);
                }
            }
        }
Example #2
0
        public static DataSet GetList(string meunuPId, string roleId)
        {
            IRoleMenuAppService service = IocManager.Instance.Resolve <IRoleMenuAppService>();

            if (service == null)
            {
                return(null);
            }
            else
            {
                int pid = 0;
                int.TryParse(meunuPId, out pid);
                var list = service.GetList(pid, roleId);
                if (list != null)
                {
                    List <RoleMenu> userList = new List <RoleMenu>();
                    list.ForEach(x => userList.Add(ConvertFromDto(x)));
                    return(userList.ToDataSet <RoleMenu>());
                }
                else
                {
                    DataSet ds = new DataSet();
                    return(ds);
                }
            }
        }