예제 #1
0
        public ActionResult Index()
        {
            AdminCategoryIndexModel adminCategoryIndexModel = new AdminCategoryIndexModel();
            CategoryModelResponse   categoryChangeResponse  = WebApiOperation.SendPost <int, CategoryModelResponse>(Constants.PRODUCT_API_BASE_URI, Constants.PRODUCT_API_INDEX_URI, 0);

            adminCategoryIndexModel.CategoryModelResponse = categoryChangeResponse;
            return(View(adminCategoryIndexModel));
        }
        public CategoryModelResponse GetSubCategoriesByCategoryID(int?id)
        {
            if (id == 0)
            {
                id = null;
            }
            CategoryModelResponse categoryResponse = new CategoryModelResponse();

            try
            {
                List <Category> categories = _repository.Get(t => t.MasterCategoryID == id).ToList();


                categoryResponse.Categories = CategoryModel.GetCategoryModelFromData(categories);
                categoryResponse.SetStatus(ResponseCode.SUCCESS);
                return(categoryResponse);
            }
            catch (Exception ex)
            {
                categoryResponse.SetStatus(ResponseCode.FAILED_ON_DB_PROCESS, ex.Message);
                return(categoryResponse);
            }
        }
예제 #3
0
        public JsonResult GetCategoryByMasterID(int id)
        {
            CategoryModelResponse categoryChangeResponse = WebApiOperation.SendPost <int, CategoryModelResponse>(Constants.PRODUCT_API_BASE_URI, Constants.PRODUCT_API_INDEX_URI, id);

            return(Json(categoryChangeResponse));
        }
예제 #4
0
        public JsonResult GetAllCategories()
        {
            CategoryModelResponse categoryChangeResponse = WebApiOperation.SendPost <int, CategoryModelResponse>(Constants.PRODUCT_API_BASE_URI, Constants.PRODUCT_API_INDEX_URI, 0);

            return(Json(categoryChangeResponse, JsonRequestBehavior.AllowGet));
        }
 public AdminCategoryIndexModel()
 {
     CategoryAddRequest    = new CategoryAddRequest();
     CategoryModelResponse = new CategoryModelResponse();
 }
예제 #6
0
        public IActionResult GetSubCategoriesByCategoryID([FromBody] int id)
        {
            CategoryModelResponse response = _service.GetSubCategoriesByCategoryID(id);

            return(response.Code != (int)Constants.ResponseCode.SUCCESS ? StatusCode(500, response) : StatusCode(200, response));
        }