public ActionResult Details(int?id) { ScrimRoll bl = new ScrimRoll(); ViewBag.ScrimRoll = bl.GetScrimRollModels(); if (id == null) { ((List <ScrimRollModel>)ViewBag.ScrimRoll).Insert(0, new ScrimRollModel()); GetRollTypesList(); GetUoMList(); //return View(bl.GetScrimRollModelsByTypeID(1)); return(View(new List <ScrimRollModel>())); } else { GetRollTypesList(); GetUoMList(); //ScrimRollModel model = bl.GetScrimRollModelByID((int)id); List <ScrimRollModel> model = bl.GetScrimRollModelsByTypeID((int)id); if (model == null) { //TempData["ActionMessage"] = string.Format("ScrimRoll with ID {0} not found.", id); TempData["ActionMessage"] = TPO.BL.Repositories.Message.MessageRepository.GetStringValue(MessageKeys.ResponseMessageFailNoId); TempData["ActionMessageType"] = TPO.BL.Repositories.Message.MessageRepository.GetStringValue(MessageKeys.ResponseTypeError); return(RedirectToAction("Details")); //return HttpNotFound(string.Format("ScrimRoll with ID {0} not found.", id)); } return(View(model)); } }
public JsonResult ListByType(int typeID) { ScrimRoll scrimBL = new ScrimRoll(); List <ScrimRollModel> list = scrimBL.GetScrimRollModelsByTypeID(typeID); return(Json(list, JsonRequestBehavior.AllowGet)); }
public JsonResult ScrimRollGridByType(string typeID, int rows, int page) { int testtypeID = Convert.ToInt32(typeID); ScrimRoll bl = new ScrimRoll(); //ScrimRollModel model = bl.GetScrimRollModelByID(testtypeID); List <ScrimRollModel> list = bl.GetScrimRollModelsByTypeID(testtypeID); //add logic for pagination //var z = testRecords.Skip((page - 1) * rows).Take(rows); //object[] results = new [] //{ //} return(Json(list, JsonRequestBehavior.AllowGet)); }