ProjectPrivages GetProjectPriv(int ItemID) { int ID = (int)Session["SessionUserID"]; //Simply validate code agenst session string Code = (string)Session["SessionCode"]; ProjectPrivages ProjectPriv = new ProjectPrivages(); using (ObjectResult <ValidateWithProjectViewPriv_Result> Result = DB.ValidateWithProjectViewPriv(ID, Code, ItemID)) ProjectPriv.In(Result.First()); return(ProjectPriv); }
// GET: Project /// <summary> /// Gets a Project interface page /// </summary> /// <param name="ID">THe Projects ID</param> /// <returns>the Page if the Project if you have Privs</returns> public ActionResult Index(int ID) { ProjectPrivages PP = GetProjectPriv(ID); if (PP.CanView) { ViewBag.Priv = this.GetJsonAsString(PP); SelectProjectByID_Result Project = null; using (ObjectResult <SelectProjectByID_Result> Result = DB.SelectProjectByID(ID)) Project = Result.First(); return(View(Project)); } return(RedirectToAction("Index", "Dashboard")); }