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())); }
public ActionResult List() { List <DataTypeDto> categories = _dataTypeService.Get(); return(View(categories as object)); }
public JsonResult GetDataTypes() { var dataTypes = _dataTypeService.Get(); return(Json(dataTypes, JsonRequestBehavior.AllowGet)); }