public ActionResult Create()
        {
            ViewBag.DefaultPropertyDataType = _dataTypeService.Get(d => d.Name.Equals("متن"))
                                              .Select(d => new SelectListItem {
                Text = d.Name, Value = d.Id.ToString(), Selected = true
            });

            ViewBag.Categories = _categoryService.Get()
                                 .Select(c => new SelectListItem {
                Text = c.Name, Value = c.Id.ToString()
            });

            return(View("~/Areas/Admin/Views/ProductTypes/Create.cshtml", new ProductTypeDto()));
        }
Esempio n. 2
0
        public ActionResult List()
        {
            List <DataTypeDto> categories = _dataTypeService.Get();

            return(View(categories as object));
        }
Esempio n. 3
0
        public JsonResult GetDataTypes()
        {
            var dataTypes = _dataTypeService.Get();

            return(Json(dataTypes, JsonRequestBehavior.AllowGet));
        }