Esempio n. 1
0
        public SimpleResponse <CategoryDto> Create(CategoryDto dto)
        {
            var response = new SimpleResponse <CategoryDto>();

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

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

            return(response);
        }
        public IHttpActionResult CreatePost(CategoryViewModel model)
        {
            var response = new SimpleResponse <CategoryViewModel>();

            response = iCategoryBusiness.Create(model);
            return(Json(response));
        }
 public CategoryModel CreateCategory([FromBody] CategoryModel model)
 {
     model.category_id        = Guid.NewGuid().ToString();
     model.parent_category_id = "10";
     _CategoryBusiness.Create(model);
     return(model);
 }
        public IActionResult CreateCategory(CategoryModel category)
        {
            var model = new Category()
            {
                CategoryName        = category.CategoryName,
                CategoryDescription = category.CategoryDescription,
                Url = category.Url,
            };

            categoryBusiness.Create(model);

            return(RedirectToAction("CategoryList"));
        }
Esempio n. 5
0
        public IActionResult CreatePost(CategoryViewModel model)
        {
            var response = iCategoryBusiness.Create(model);

            if (response.ResponseCode > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError(string.Empty, response.ResponseMessage);
                return(View("Create", model));
            }
        }
Esempio n. 6
0
 public CategoryModel CreateCategory([FromBody] CategoryModel model)
 {
     _itemGroupBusiness.Create(model);
     return(model);
 }
Esempio n. 7
0
        public SimpleResponse <CategoryViewModel> Create(CategoryViewModel model)
        {
            var response = iCategoryBusiness.Create(model);

            return(response);
        }