public JsonResult GetAllSize(StoneShape shape, int?order, int?selected) { Response response; try { List <ShapeSize> list; int dataCount; using (var db = new KiaGalleryContext()) { var query = db.ShapeSize.Where(x => x.StoneShape == shape && x.Active == true); dataCount = query.Count(); query = query.OrderBy(x => x.Order); list = query.ToList(); } response = new Response() { status = 200, data = new { list = list.Select(item => new { id = item.Id, order = item.Order, size = item.SizeLength + "x" + item.SizeWidth }), count = dataCount, order = order, selected = selected } }; } catch (Exception ex) { response = Core.GetExceptionResponse(ex); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult Details(StoneShape id) { ViewBag.StoneShape = id; ViewBag.StoneShapeTitle = Enums.GetTitle(id); return(View()); }