public ActionResult Create(UserRegisteration register)
 {
     try
     {
         if (ModelState.IsValid)
         {
             DBHelper da = new DBHelper();
             da.SaveUserDetails(register);
             return RedirectToAction("SendEmail", "Account", register);
         }
         else
         {
             //this will return view with validation msg
             return View("Index", register);
         }
     }
     catch (Exception e)
     {
         throw new ApplicationException("Plz fill out the data" + e);
     }
 }
        /// <summary>
        /// This method will display the view having
        /// development status
        /// </summary>
        /// <param name="id">Project Id</param>
        /// <returns>GetTreeView view</returns>
        public ActionResult GetTreeView(int id)
        {
            DBHelper dataObj = new DBHelper();
            ProjectParentModel parentProjectModel;
            T_Status t = new T_Status();

            using (ContinuousIntegrationEntities ci = new ContinuousIntegrationEntities())
            {
                var userId = Convert.ToInt32(Session["LoggedUserID"]);

                //Linq to check user has access to given project or not
                var isUser = (from a in ci.T_UserProjectMappings
                              where a.C_RegisterID == userId && a.C_ProjectID == id
                              select a).FirstOrDefault();

                var isAdmin = (from t1 in ci.T_UserRoleMappings
                               where t1.C_RoleID == 1 && t1.C_RegisterID == userId
                               select t1).FirstOrDefault();

                var doesProjectExists = (from t1 in ci.T_Projects
                                         where t1.C_ProjectID == id
                                         select t1).FirstOrDefault();

                if (doesProjectExists == null)
                {
                    ViewBag.Msg = "This project does not exists!";
                    return View("ErrorPage");
                }
                else if (isAdmin == null && isUser == null)
                {
                    ViewBag.Msg = "You are not assigned this project.";
                    return View("ErrorPage");
                }
                else
                {
                    var projectDetails = ci.ProjectDetails(userId, id);

                    parentProjectModel = new ProjectParentModel
                    {
                        Releases = new List<T_Releases>(),
                        SubReleases = new List<T_SubReleases>(),
                        ProjectStatus = new List<T_Status>(),
                        Streams = new List<T_Streams>()
                    };
                    parentProjectModel.Statuses = dataObj.GetAllStatuses();

                    foreach (var item in projectDetails) //loop to populate with Pdetails
                    {
                        #region Streams

                        var stream = new T_Streams()
                        {
                            C_StreamName = item.C_StreamName,
                            C_StreamID = item.C_StreamID
                        };
                        parentProjectModel.Streams.Add(stream);

                        #endregion

                        #region Release

                        var release = new T_Releases()
                        {
                            C_ReleaseName = item.C_ReleaseName,
                            C_StreamID = item.C_StreamID,
                            C_ReleaseID = Convert.ToInt32(item.C_ReleaseID)
                        };
                        parentProjectModel.Releases.Add(release);

                        #endregion

                        #region SubRelease

                        T_SubReleases subRelease = new T_SubReleases()
                        {
                            C_SubReleaseName = item.C_SubReleaseName,
                            C_ReleaseID = Convert.ToInt32(item.C_ReleaseID),
                            C_StatusID = Convert.ToInt32(item.C_StatusID)
                        };
                        parentProjectModel.SubReleases.Add(subRelease);

                        #endregion

                        #region ProjectStatus

                        T_Status status = new T_Status()
                        {
                            C_StatusName = item.C_StatusName,
                            C_StatusID = Convert.ToInt32(item.C_StatusID)
                        };
                        parentProjectModel.ProjectStatus.Add(status);

                        #endregion
                    }

                    return View("GetTreeView", parentProjectModel);
                }
            }
        }