public JsonResult GetAnimates(string questionId) { var temp = db.Animates.Where(x => x.IsDeleted == false && x.QuestionId == new Guid(questionId)); AnimatesController ac = new AnimatesController(); List <AnimateViewModel> a = new List <AnimateViewModel>(); foreach (var item in temp) { AnimateViewModel animate = new AnimateViewModel(item); string[] s = i.GetImageType((Guid)item.ImageId).Split(' '); animate.imageType = s[0]; animate.Location = db.Images.Where(x => x.Id == (Guid)item.ImageId).FirstOrDefault().Location; a.Add(animate); } a.OrderBy(x => x.imageType); return(Json(a, JsonRequestBehavior.AllowGet)); }
// GET: Designs/Create public ActionResult Create() { if (AccountController.CheckPermission("Design-Create")) { System.Web.HttpContext.Current.Session["action"] = "Survey-Create"; UpdateList(); AnimatesController a = new AnimatesController(); ViewBag.Question = a.GetQuestion(AccountController.GetSurveyId()).OrderBy(x => x.Number); ViewBag.QuestionId = new SelectList(a.GetQuestion(AccountController.GetSurveyId()), "Id", "Content"); ViewBag.ImageTypeId = listImageType.ToList(); return(View()); } else { return(RedirectToAction("Index", "Home")); } }