コード例 #1
0
        public ModifyPosStatusSimResponse ModifyPosStatusSim(ModifyPosStatusSimRequest request)
        {
            ModifyPosStatusSimResponse response = new ModifyPosStatusSimResponse();

            PosStatusSim posStatusSim = _posStatusSimRepository
                                        .FindBy(request.StatusId);

            posStatusSim.Id         = request.StatusId;
            posStatusSim.StatusName = request.StatusName;
            posStatusSim.PosSims    = request.PosSims.ConvertToPosSims();


            if (posStatusSim.GetBrokenRules().Count() > 0)
            {
                response.Errors = posStatusSim.GetBrokenRules().ToList();
            }
            else
            {
                try {
                    _posStatusSimRepository.Save(posStatusSim);
                    _uow.Commit();
                    response.Errors = new List <BusinessRule>();
                } catch (Exception ex)
                {
                    response.Errors = new List <BusinessRule>();
                    response.Errors.Add(new BusinessRule("DAL", "DAL_ERROR: " + ex.Message));
                }
            }


            return(response);
        }
コード例 #2
0
        public JsonResult Update(PosStatusSimDetailView vm)
        {
            GetPosStatusSimRequest request = new GetPosStatusSimRequest();

            request.StatusId = vm.StatusId;

            ModifyPosStatusSimRequest updateRequest = _posStatusSimService.GetPosStatusSim(request).PosStatusSim.ConvertToModifyPosStatusSimRequest();

            updateRequest.StatusId   = vm.StatusId;
            updateRequest.StatusName = vm.StatusName;

            ModifyPosStatusSimResponse response = _posStatusSimService.ModifyPosStatusSim(updateRequest);

            return(Json(response));
        }