Exemplo n.º 1
0
        public async Task <bool> CheckIsUsed(short id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            return(await _workflowStateRepo.CheckIsUsed(para));
        }
Exemplo n.º 2
0
        public async Task <bool> CheckIsUsed(byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            return(await _language.CheckIsUsed(para));
        }
Exemplo n.º 3
0
        public async Task<bool> CheckExist(string name, byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            return await _offeradvise.CheckExist(para);
        }
Exemplo n.º 4
0
        public async Task <List <ModuleApplication> > Initial(string group)
        {
            var data = new List <ModuleApplication>();
            var principalIdentity = RequestContext.Principal.Identity;
            var userId            = principalIdentity.GetUserId();

            //1 - CMS, 2 - Patient Services, 3 - Internal Services
            if (userId.Length > 0)
            {
                string key = ":" + group + ":" + userId;
                data = (List <ModuleApplication>)MemoryCacheObject.GetCacheObject(ObjectCacheProfile.CACHE_MODULE_USER + key);
                if (data == null)
                {
                    List <string> list = new List <string> {
                        "Group", "Userid", "DefaultRoleInitial"
                    };
                    var para = APIProvider.APIGeneratorParameter(list, group, userId, APIConstant.DefaultRoleInitial);

                    var source = await _module.Initial(para);

                    data = Mapper.Map <List <ModuleApplication> >(source);

                    MemoryCacheObject.CacheObject(ObjectCacheProfile.CACHE_MODULE_USER + key, data, 1200); //6h
                }

                if (data == null)
                {
                    data = new List <ModuleApplication>();
                }

                return(data);
            }
            return(data);
        }
Exemplo n.º 5
0
        public async Task <bool> CheckExist(string title, short id)
        {
            List <string> list = new List <string> {
                "title", "id"
            };
            var para = APIProvider.APIGeneratorParameter(list, title, id);

            return(await _module.CheckExist(para));
        }
Exemplo n.º 6
0
        public async Task <bool> CheckIsUsed(short id)
        {
            List <string> list = new List <string> {
                "id"
            };
            var para = APIProvider.APIGeneratorParameter(list, id);

            return(await _module.CheckIsUsed(para));
        }
        public async Task <bool> CheckExist(string name, byte id)
        {
            List <string> list = new List <string> {
                nameof(name), nameof(id)
            };
            var para = APIProvider.APIGeneratorParameter(list, name, id);

            return(await _workflow.CheckExist(para));
        }
Exemplo n.º 8
0
        public async Task <bool> CheckExist(string name, short id, short departmentId)
        {
            //var list = this.RequestContext.RouteData.Values.Keys;
            var list = new List <string> {
                nameof(name), nameof(id), nameof(departmentId)
            };
            var para = APIProvider.APIGeneratorParameter(list, name, id, departmentId);

            return(await _departmentServices.CheckExist(para));
        }
        public async Task <bool> CheckExistName(string name, byte id)
        {
            //var list = this.RequestContext.RouteData.Values.Keys;
            List <string> list = new List <string> {
                "name", "id"
            };
            var para = APIProvider.APIGeneratorParameter(list, name, id);

            return(await _category.CheckExist(para));
        }
Exemplo n.º 10
0
        public async Task <bool> CheckExistName(string name, short id, byte workflowId)
        {
            //var list = this.RequestContext.RouteData.Values.Keys;
            List <string> list = new List <string> {
                "Name", "Id", "WorkflowId"
            };
            var para = APIProvider.APIGeneratorParameter(list, name, id, workflowId);

            return(await _workflowStateRepo.CheckExist(para));
        }
Exemplo n.º 11
0
        public async Task <bool> CheckExist(string name, byte id)
        {
            //var list = this.RequestContext.RouteData.Values.Keys;
            var list = new List <string> {
                nameof(name), nameof(id)
            };
            var para = APIProvider.APIGeneratorParameter(list, name, id);

            return(await _gallery.CheckExist(para));
        }
Exemplo n.º 12
0
        public async Task <bool> CheckExist(byte id, string code)
        {
            //var parameter = Request.GetQueryNameValuePairs();
            List <string> list = new List <string> {
                nameof(code), nameof(id)
            };
            var para = APIProvider.APIGeneratorParameter(list, code, id);

            return(await _language.CheckExist(para));
        }
Exemplo n.º 13
0
        public async Task<OfferAdviseViewModel> Get(byte id)
        {
            List<string> list = new List<string> { "id" };
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _offeradvise.SingleQuery(para);
            var dest = Mapper.Map<OfferAdviseViewModel>(source);

            return (dest == null ? new OfferAdviseViewModel() : dest);
        }
Exemplo n.º 14
0
        public async Task <bool> CheckExistTitle(short id, string title)
        {
            //var list = this.RequestContext.RouteData.Values.Keys;
            List <string> list = new List <string> {
                "title", "id"
            };
            var para = APIProvider.APIGeneratorParameter(list, title, id);

            return(await _link.CheckExist(para));
        }
Exemplo n.º 15
0
        public async Task <WorkflowViewModel> GetById(byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _workflow.SingleQuery(para);

            WorkflowViewModel dest = Mapper.Map <WorkflowViewModel>(source);

            return(dest);
        }
Exemplo n.º 16
0
        public async Task <ArticleViewModel> Get(byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _articleRepo.SingleQuery(para);

            var dest = Mapper.Map <ArticleViewModel>(source);

            return(dest);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Get Link by Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns>Category view model</returns>
        // GET api/values/5
        public async Task <LinkBuildingViewModel> GetById(short id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _link.SingleQuery(para);

            LinkBuildingViewModel dest = Mapper.Map <LinkBuildingViewModel>(source);

            return(dest);
        }
Exemplo n.º 18
0
        public async Task<SettingViewModel> GetById(byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _setting.SingleQuery(para);
            var dest = Mapper.Map<SettingViewModel>(source);
            if(dest == null)
                dest = new SettingViewModel();
            return dest;
        }
Exemplo n.º 19
0
        // GET api/values
        ///[Filters.DeflateCompression]
        public async Task <List <CategoryViewModel> > GetByParentId(byte parentId)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, parentId);

            //Mapping
            var source = await _category.Query(para);

            List <CategoryViewModel> dest = Mapper.Map <List <CategoryViewModel> >(source);

            return(dest);
        }
Exemplo n.º 20
0
        public async Task <DoctorProfileViewModel> Get(string id)
        {
            List <string> list = new List <string> {
                "userid"
            };
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _doctor.SingleQuery(para);

            var dest = Mapper.Map <DoctorProfileViewModel>(source);

            return(dest == null ? new DoctorProfileViewModel() : dest);
        }
Exemplo n.º 21
0
        public async Task <ModuleViewModel> Get(byte id)
        {
            List <string> list = new List <string> {
                "id"
            };
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _module.SingleQuery(para);

            var dest = Mapper.Map <ModuleViewModel>(source);

            return(dest);
        }
Exemplo n.º 22
0
        public async Task <ArticleCommentViewModel> GetComment(int id, int idArticle)
        {
            IList <string> list = new List <string> {
                "TypeGet", "Id", "ArticleId"
            };
            var para = APIProvider.APIGeneratorParameter(list, 1, id, idArticle);

            var source = await _articleCommentRepo.SingleQuery(para);

            var dest = Mapper.Map <ArticleCommentViewModel>(source);

            return(dest);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Get by Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns>Category view model</returns>
        // GET api/values/5
        public async Task <CMSConfigurationViewModel> GetById(byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _config.SingleQuery(para);

            CMSConfigurationViewModel dest = Mapper.Map <CMSConfigurationViewModel>(source);

            if (dest == null)
            {
                dest = new CMSConfigurationViewModel();
            }
            return(dest);
        }
        public async Task <DoctorProfileViewModel> Get(string id)
        {
            var result = await redisCache.GetAsync <DoctorProfileViewModel>(id);

            if (result == null)
            {
                List <string> list = new List <string> {
                    "UserId"
                };
                var para = APIProvider.APIGeneratorParameter(list, id);

                var source = await _doctor.SingleQuery(para);

                result = Mapper.Map <DoctorProfileViewModel>(source);
            }
            return(result);
        }
Exemplo n.º 25
0
        public async Task <SurveyViewModel> Get(string id)
        {
            try
            {
                var listId = new List <string> {
                    "Id"
                };
                var listSurveyId = new List <string> {
                    "SurveyId"
                };
                var listQuestionId = new List <string> {
                    "QuestionId"
                };

                var paraId       = APIProvider.APIGeneratorParameter(listId, id);
                var paraSurveyId = APIProvider.APIGeneratorParameter(listSurveyId, id);

                //Get & Map survey
                var source = await _survey.SingleQuery(paraId);

                var dest = Mapper.Map <SurveyViewModel>(source);

                //Get & Map questions of survey
                var questions = await _survey.QuestionsQuery(paraSurveyId);

                dest.SurveyQuestionsModel = Mapper.Map <List <SurveyQuestionsViewModel> >(questions);

                //Get & Map answers of question
                foreach (var surveyquestion in dest.SurveyQuestionsModel)
                {
                    var paraQuestionId = APIProvider.APIGeneratorParameter(listQuestionId, surveyquestion.Id);
                    var answers        = await _survey.AnswersQuery(paraQuestionId);

                    surveyquestion.SurveyAnswersModel = Mapper.Map <List <SurveyAnswersViewModel> >(answers);
                }
                return(dest);
            }
            catch (Exception ex)
            {
                throw ex.GetBaseException();
            }
        }