Ejemplo n.º 1
0
        public ActionResult Post([FromBody] GroupTypeRequest groupTypeRequest)
        {
            var entity = groupTypeRequest.TO <GroupType>();
            var result = _repository.Add(entity);

            return(CreatedAtAction(nameof(Get), new { id = result.GroupTypeId }, result.TO <GroupTypeResponse>()));
        }
Ejemplo n.º 2
0
        public ActionResult Put(Guid id, [FromBody] GroupTypeRequest groupTypeRequest)
        {
            var entity = _repository.Get(id);

            if (entity != null)
            {
                entity = groupTypeRequest.CopyTo(entity);

                _repository.Update(entity);
                return(new OkObjectResult(entity.TO <GroupTypeResponse>()));
            }
            return(new NoContentResult());
        }
Ejemplo n.º 3
0
        public BaseResponse UpdateGroupType(GroupTypeRequest request)
        {
            BaseResponse groupTypeResponse = new BaseResponse();

            try
            {
                var orderID = repository.UpdateGroupType(request.groupType);
                groupTypeResponse.Success = true;
            }
            catch (Exception ex)
            {
                groupTypeResponse.Success    = false;
                groupTypeResponse.Message    = ex.Message;
                groupTypeResponse.StackTrace = ex.StackTrace;
            }

            return(groupTypeResponse);
        }
Ejemplo n.º 4
0
 public BaseResponse UpdateGroupType(GroupTypeRequest request)
 {
     return(service.UpdateGroupType(request));
 }
Ejemplo n.º 5
0
 public BaseResponse CreateGroupType(GroupTypeRequest request)
 {
     return(service.InsertGroupType(request));
 }