Exemplo n.º 1
0
        // GET: Position/Details/5
        public ActionResult Details(int id)
        {
            var result = PositionLoader.GetById(id);


            return(View(result));
        }
Exemplo n.º 2
0
        // 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));
        }
Exemplo n.º 3
0
        public ActionResult Delete(int id)
        {
            try
            {
                PositionLoader.Delete(id);
                TempData["SuccessMessage"] = "Deleted Successfully";

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 4
0
        public ActionResult Create(PositionDto position)
        {
            try
            {
                PositionLoader.Save(position);
                TempData["SuccessMessage"] = "Created Successfully";
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        // GET: Position

        public ActionResult Index()
        {
            var positions = PositionLoader.GetAll();

            return(View(positions));
        }
Exemplo n.º 7
0
 // GET: Staff/Edit/5
 public ActionResult Edit(int id)
 {
     ViewBag.Positions = PositionLoader.GetAll();
     ViewBag.Brunches  = BrunchLoader.GetBrunches();
     return(View());
 }
Exemplo n.º 8
0
 // GET: Staff/Create
 public ActionResult Create()
 {
     ViewBag.Positions = PositionLoader.GetAll();
     ViewBag.Brunches  = BrunchLoader.GetBrunches();
     return(View());
 }