// GET: Position/Details/5 public ActionResult Details(int id) { var result = PositionLoader.GetById(id); return(View(result)); }
// GET: Staff public ActionResult Index() { var list = StaffLoader.GetAll(); foreach (var item in list) { item.Brunch = BrunchLoader.GetInsertedById(item.Brunch_id); item.Position = PositionLoader.GetInsertedById(item.Position_id); } return(View(list)); }
public ActionResult Delete(int id) { try { PositionLoader.Delete(id); TempData["SuccessMessage"] = "Deleted Successfully"; return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(PositionDto position) { try { PositionLoader.Save(position); TempData["SuccessMessage"] = "Created Successfully"; // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, PositionDto position) { try { PositionLoader.Save(position); TempData["SuccessMessage"] = "Updated Successfully"; return(Json(new { result = "Redirect", url = Url.Action("Index", "Position") })); // return RedirectToAction("Index"); } catch { return(Json(new { result = "InvalidLogin" }, JsonRequestBehavior.AllowGet)); // return View(); } }
// GET: Position public ActionResult Index() { var positions = PositionLoader.GetAll(); return(View(positions)); }
// GET: Staff/Edit/5 public ActionResult Edit(int id) { ViewBag.Positions = PositionLoader.GetAll(); ViewBag.Brunches = BrunchLoader.GetBrunches(); return(View()); }
// GET: Staff/Create public ActionResult Create() { ViewBag.Positions = PositionLoader.GetAll(); ViewBag.Brunches = BrunchLoader.GetBrunches(); return(View()); }