// 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"));
        }
        public ProjectHubSessions(int ProjectID, dynamic Session, string ConnectionID)
        {
            this.ProjectID = ProjectID;
            using (MVCTaskMasterAppDataEntities2 DB = new MVCTaskMasterAppDataEntities2())
            {
                using (ObjectResult <SelectProjectByID_Result> oj = DB.SelectProjectByID(ProjectID))
                {
                    ProjectOverView = oj.First();
                }

                ProjectTasks = new Project_Tasks_And_Links(DB, ProjectID);


                AddSession(Session, ConnectionID);
                UsersConnected[ConnectionID]["Permission"] = DB.ValidateWithProjectViewPriv((int)UsersConnected[ConnectionID]["SessionUserID"], (string)UsersConnected[ConnectionID]["SessionCode"], ProjectID);
            }
        }
Exemplo n.º 3
0
        public JsonResult ProjectData(int ID)
        {
            if (Session["SessionUserID"] == null)
            {
                return(Json(@"Access Denied", JsonRequestBehavior.AllowGet));
            }

            string          ErrorMessage          = "";
            ObjectParameter ErrorMessageParameter = new ObjectParameter("ErrorMessage", ErrorMessage);

            SelectProjectByID_Result ProjectData;

            using (ObjectResult <SelectProjectByID_Result> TempResults = DB.SelectProjectByID(ID))
                ProjectData = TempResults.First();

            if (ProjectData.ManagerPicture == null)
            {
                ProjectData.ManagerPicture = new Bitmap(HostingEnvironment.MapPath("~/Images/NoProfilePicPic.jpg")).ToByteArray();
            }

            //Project_IndexView_ViewOverViewAsSubView Return = new Project_IndexView_ViewOverViewAsSubView(ProjectData);

            return(Json(ProjectData, JsonRequestBehavior.AllowGet));
        }