public ActionResult EditPosition(int id) { TechCareerFair.DAL.PositionDAL.PositionRepository pr = new DAL.PositionDAL.PositionRepository(); position position = pr.SelectOne(id); return(View(position)); }
public ActionResult DeletePosition(int id, FormCollection collection) { TechCareerFair.DAL.PositionDAL.PositionRepository pr = new DAL.PositionDAL.PositionRepository(); position position = pr.SelectOne(id); int businessID = position.Business; pr.Delete(id); return(RedirectToAction("ListPositions", new { id = businessID })); }
public ActionResult DeletePosition(int id) { TechCareerFair.DAL.PositionDAL.PositionRepository pr = new DAL.PositionDAL.PositionRepository(); position position = pr.SelectOne(id); BusinessRepository br = new BusinessRepository(); business bus = br.SelectOne(position.Business); ViewBag.Business = bus.BusinessName; return(View(position)); }
// GET public ActionResult EditPosition(int id, string businessEmail) { if (businessEmail == User.Identity.GetUserName()) { ViewBag.BusinessEmail = businessEmail; TechCareerFair.DAL.PositionDAL.PositionRepository pr = new DAL.PositionDAL.PositionRepository(); position position = pr.SelectOne(id); return(View(position)); } else { return(RedirectToAction("AccessDenied", "Error")); } }
public ActionResult DeletePosition(int id, FormCollection collection, string businessEmail) { if (businessEmail == User.Identity.GetUserName()) { TechCareerFair.DAL.PositionDAL.PositionRepository pr = new DAL.PositionDAL.PositionRepository(); position position = pr.SelectOne(id); int businessID = position.Business; pr.Delete(id); return(RedirectToAction("ListPositions", new { id = businessID })); } else { return(RedirectToAction("AccessDenied", "Error")); } }
// GET public ActionResult DeletePosition(int id, string businessEmail) { if (businessEmail == User.Identity.GetUserName()) { TechCareerFair.DAL.PositionDAL.PositionRepository pr = new DAL.PositionDAL.PositionRepository(); position position = pr.SelectOne(id); BusinessRepository br = new BusinessRepository(); business bus = br.SelectOne(position.Business); ViewBag.Business = bus.BusinessName; ViewBag.BusinessEmail = bus.Email; return(View(position)); } else { return(RedirectToAction("AccessDenied", "Error")); } }