Exemplo n.º 1
0
        public SimpleResponse <AddressDto> Create(AddressDto dto)
        {
            var response = new SimpleResponse <AddressDto>();

            try
            {
                var model = SimpleMapper.Map <AddressDto, AddressViewModel>(dto);
                var resp  = iAddressBusiness.Create(model);
                response = new SimpleResponse <AddressDto>()
                {
                    ResponseCode    = resp.ResponseCode,
                    ResponseMessage = resp.ResponseMessage,
                    RCode           = resp.RCode
                };

                response.Data = SimpleMapper.Map <AddressViewModel, AddressDto>(resp.Data);
            }
            catch (Exception ex)
            {
                response.ResponseCode    = BusinessResponseValues.InternalError;
                response.ResponseMessage = "Okuma iþleminde hata oluþtu.";
                SimpleFileLogger.Instance.Error(ex);
            }

            return(response);
        }
Exemplo n.º 2
0
        public IHttpActionResult CreatePost(AddressViewModel model)
        {
            var response = new SimpleResponse <AddressViewModel>();

            response = iAddressBusiness.Create(model);
            return(Json(response));
        }
Exemplo n.º 3
0
        public IActionResult CreatePost(AddressViewModel model)
        {
            var response = iAddressBusiness.Create(model);

            if (response.ResponseCode > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError(string.Empty, response.ResponseMessage);
                return(View("Create", model));
            }
        }
Exemplo n.º 4
0
        public SimpleResponse <AddressViewModel> Create(AddressViewModel model)
        {
            var response = iAddressBusiness.Create(model);

            return(response);
        }
 public Address Create(Address value)
 {
     return(_addressBusiness.Create(value));
 }