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

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

                response.Data = SimpleMapper.Map <LanguageViewModel, LanguageDto>(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(LanguageViewModel model)
        {
            var response = new SimpleResponse <LanguageViewModel>();

            response = iLanguageBusiness.Create(model);
            return(Json(response));
        }
Exemplo n.º 3
0
        public ActionResult CreatePost(LanguageViewModel model)
        {
            var response = iLanguageBusiness.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 <LanguageViewModel> Create(LanguageViewModel model)
        {
            var response = iLanguageBusiness.Create(model);

            return(response);
        }