public ActionResult Index() { List <TIM_ProjectCreationModel> lstProjectCreation = new List <TIM_ProjectCreationModel>(); try { //int TaskId = Convert.ToInt32(Request.Cookies["TaskId"].Value); int ProjectId = Convert.ToInt32(Request.Cookies["ProjectId"].Value); //int MilestoneId = Convert.ToInt32(Request.Cookies["MilestoneId"].Value); var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { lstProjectCreation = BalProjectCreation.GetProjectCreationById(clientContext, ProjectId); ViewBag.MilestoneData = BalMilestone.GetMilestoneByProjectId(clientContext, ProjectId); ViewBag.TaskData = BalTask.GetTaskByProjectId(clientContext, ProjectId); ViewBag.SubTaskData = BalSubTask.GetSubTaskByProjectId(clientContext, ProjectId); ViewBag.StatusData = BalStatus.GetStatusForAction(clientContext); ViewBag.EmpData = BalEmp.GetEmp(clientContext); } } catch (Exception ex) { throw new Exception(string.Format("An error occured while performing action. GUID: {0}", ex.ToString())); } return(View(lstProjectCreation[0])); }
// GET: ProjectCreation public ActionResult Index() { try { var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { ViewBag.ProjectTypeData = BalProjectType.GetProjectType(clientContext); ViewBag.ClientData = BalClient.GetClient(clientContext); ViewBag.EmpData = BalEmp.GetEmp(clientContext); } } catch (Exception ex) { throw new Exception(string.Format("An error occured while performing action. GUID: {0}", ex.ToString())); } return(View()); }