Exemplo n.º 1
0
        public async Task <string> CreateProjKeyValueAsync([FromBody] ProjKeyValueViewModel request)
        {
            // HttpRequest res = null;
            var response = new ListModelResponse <ProjKeyValueViewModel>();
            var projkeyvalueDataModel = false;

            try
            {
                projkeyvalueDataModel = await _projkeyvalueRepository.CreateKeyValuePair(request.ToEntity());

                if (projkeyvalueDataModel)
                {
                    // response.Message = String.Format("Created User Successfully");
                    response.Message = Messages.SuccessMsg;
                }
                else
                {
                    //response.Message = String.Format("Create User failed");
                    response.Message = Messages.FailMsg;
                }
            }

            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }

            return(response.Message);
        }
Exemplo n.º 2
0
        public async Task <string> UpdateProjectAsync([FromBody] ProjKeyValueViewModel request, int varId)
        {
            var response          = new ListModelResponse <ProjKeyValueViewModel>();
            var projectsDataModel = false;


            try
            {
                projectsDataModel = await _projkeyvalueRepository.UpdateProjKeyValuePair(request.ToEntity(), varId);

                if (projectsDataModel)
                {
                    response.Message = Messages.SuccessMsg;
                }
                else
                {
                    response.Message = Messages.FailMsg;
                }
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }

            return(response.Message);
        }