Example #1
0
        private static List <AppService> GetAppServiceByAppId(int appId)
        {
            var parmater = new AppServiceSearchPamater();

            parmater.SetAppId(appId, PamaterOperationType.Equal);
            parmater.SetStatus(null, PamaterOperationType.In);
            parmater.StatusList = new List <byte>()
            {
                0, 1
            };
            var source = AppServiceDal.GetList(parmater);

            if (source != null)
            {
                var functionParamter = new AppFunctionSearchPamater();
                functionParamter.SetAppServiceId(null, PamaterOperationType.In);
                functionParamter.AppServiceIdList = source.Select(a => a.AppServiceId).ToList();
                functionParamter.SetStatus(null, PamaterOperationType.In);
                functionParamter.StatusList = new List <byte>()
                {
                    0, 1
                };
                var functionSource = AppFunctionDal.GetList(functionParamter);
                if (functionSource != null)
                {
                    source.ForEach(ap =>
                    {
                        ap.AppFunctions = functionSource.FindAll(af => af.AppServiceId == ap.AppServiceId);
                    });
                }
            }

            return(source);
        }
Example #2
0
        public FunctionOpenResult <bool> ExistAppService(int appId)
        {
            var r = new FunctionOpenResult <bool>();

            var parmater = new AppServiceSearchPamater();

            parmater.SetAppId(appId, PamaterOperationType.Equal);
            var source = AppServiceDal.GetList(parmater);

            if ((source != null) && (source.Count > 0))
            {
                r.Data = true;
            }
            else
            {
                r.Data = false;
            }
            return(r);
        }
Example #3
0
 public FunctionListResult <AppService> GetList(AppServiceSearchPamater pamater)
 {
     var r = new FunctionListResult <AppService>(); r.Data = AppServiceDal.GetList(pamater); return(r);
 }