public ActionResult EnterpriseSvcCard(string strid)
        {
            int UserIDX = strid.ConvertOrDefault <int>();
            int id      = strid.ConvertOrDefault <int>();

            if (id > 100000)
            {
                id = id - 100000;
            }

            var model = new vmDashboardEntSvcCard();

            model.entsvc = db_EECIP.GetT_OE_ORGANIZATION_ENT_SVCS_ByID(id);
            if (model.entsvc != null)
            {
                T_OE_ORGANIZATION _org = db_Ref.GetT_OE_ORGANIZATION_ByID(model.entsvc.ORG_IDX.ConvertOrDefault <Guid>());
                if (_org != null)
                {
                    model.OrgName = _org.ORG_NAME;
                }

                T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(model.entsvc.MODIFY_USERIDX ?? model.entsvc.CREATE_USERIDX ?? -1);
                if (u != null)
                {
                    model.LastUpdatedUser = u.FNAME + " " + u.LNAME;
                }
            }
            //model.User = db_Accounts.GetT_OE_USERSByIDX(UserIDX);
            //model.UserOrg = db_Ref.GetT_OE_ORGANIZATION_ByID(model.User.ORG_IDX.ConvertOrDefault<Guid>());

            //            if (model.User != null)
            return(View(model));

            //return RedirectToAction("Index", "Dashboard");
        }
        public ActionResult Governance(Guid?selAgency)
        {
            int UserIDX = db_Accounts.GetUserIDX();

            var model = new vmDashboardGovernance();

            T_OE_USERS user = db_Accounts.GetT_OE_USERSByIDX(UserIDX);

            if (user != null)
            {
                model.UnlockedInd = user.ALLOW_GOVERNANCE;

                //if user has unlocked governance, display more
                if (model.UnlockedInd == true)
                {
                    if (selAgency != null)
                    {
                        model.selAgency = selAgency;
                        model.projects  = db_EECIP.GetT_OE_PROJECTS_ByOrgIDX(selAgency.ConvertOrDefault <Guid>());

                        T_OE_ORGANIZATION o = db_Ref.GetT_OE_ORGANIZATION_ByID(selAgency.ConvertOrDefault <Guid>());
                        if (o != null)
                        {
                            model.selAgencyName = o.ORG_NAME;
                        }
                    }
                }
            }

            return(View(model));
        }
Exemplo n.º 3
0
        // GET: /Account/UserProfile/2
        public ActionResult UserProfile(int?id, string a)
        {
            if (id == null)
            {
                id = db_Accounts.GetUserIDX();
            }

            //security validation: only admins can (only allow site admin or user to edit their own profile)
            if (!User.IsInRole("Admins") && a == "a")
            {
                return(RedirectToAction("AccessDenied", "Home"));
            }

            //security validation (only allow site admin or user to edit their own profile)
            if ((!User.IsInRole("Admins")) && (id != db_Accounts.GetUserIDX()))
            {
                return(RedirectToAction("AccessDenied", "Home"));
            }


            var        model = new vmAccountUserProfile();
            T_OE_USERS u     = db_Accounts.GetT_OE_USERSByIDX(id ?? 0);

            if (u != null)
            {
                model.UserIDX        = u.USER_IDX;
                model.UserID         = u.USER_ID;
                model.FName          = u.FNAME;
                model.LName          = u.LNAME;
                model.Email          = u.EMAIL;
                model.Phone          = u.PHONE;
                model.PhoneExt       = u.PHONE_EXT;
                model.OrgIDX         = u.ORG_IDX;
                model.JobTitle       = u.JOB_TITLE;
                model.LinkedIn       = u.LINKEDIN;
                model.NodeAdmin      = u.NODE_ADMIN;
                model.HasAvatar      = (u.USER_AVATAR != null);
                model.ImageUniqueStr = (u.MODIFY_DT ?? u.CREATE_DT).ConvertOrDefault <DateTime>().Ticks.ToString();
                model.ActInd         = u.ACT_IND;
                model.uListInd       = a;
                model.ExcludeBadges  = u.EXCLUDE_POINTS_IND;


                //expertise
                model.SelectedExpertise = db_EECIP.GetT_OE_USER_EXPERTISE_ByUserIDX(id ?? 0);
                model.AllExpertise      = db_EECIP.GetT_OE_USER_EXPERTISE_ByUserIDX_All(id ?? 0).Select(x => new SelectListItem {
                    Value = x, Text = x
                });

                //org name
                T_OE_ORGANIZATION org = db_Ref.GetT_OE_ORGANIZATION_ByID(model.OrgIDX.ConvertOrDefault <Guid>());
                if (org != null)
                {
                    model.OrgName = org.ORG_NAME;
                }
            }

            return(View(model));
        }
        // GET: /Dashboard/ProjectCard/1
        public ActionResult ProjectCard(string strid)
        {
            int UserIDX = db_Accounts.GetUserIDX();

            Guid id;

            if (Guid.TryParse(strid, out id))
            {
                var model = new vmDashboardProjectCard();
                model.project = db_EECIP.GetT_OE_PROJECTS_ByIDX(id);
                if (model.project != null)
                {
                    T_OE_ORGANIZATION _org = db_Ref.GetT_OE_ORGANIZATION_ByID(model.project.ORG_IDX.ConvertOrDefault <Guid>());
                    if (_org != null)
                    {
                        model.OrgName = _org.ORG_NAME;
                    }

                    model.SelectedProgramAreas = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeSelected(model.project.PROJECT_IDX, "Program Area");
                    model.SelectedFeatures     = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeSelected(model.project.PROJECT_IDX, "Project Feature");
                    model.sProjectUrlList      = db_EECIP.GetT_OE_PROJECTS_URL_ByProjIDX(model.project.PROJECT_IDX);
                    T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(model.project.MODIFY_USERIDX ?? model.project.CREATE_USERIDX ?? -1);
                    if (u != null)
                    {
                        model.LastUpdatedUser = u.FNAME + " " + u.LNAME;
                    }
                    model.ProjectVotePoints          = db_EECIP.GetT_OE_PROJECT_VOTES_TotalByProject(model.project.PROJECT_IDX);
                    model.HasVoted                   = db_EECIP.GetT_OE_PROJECT_VOTES_HasVoted(model.project.PROJECT_IDX, UserIDX);
                    model.UserBelongsToProjectAgency = db_Accounts.UserCanEditOrgIDX(db_Accounts.GetUserIDX(), model.project.ORG_IDX.ConvertOrDefault <Guid>());
                    //project contact
                    if (model.project.PROJECT_CONTACT_IDX != null)
                    {
                        model.ProjectContact = db_Accounts.GetT_OE_USERSByIDX(model.project.PROJECT_CONTACT_IDX ?? -1);
                    }
                    model.files_existing = db_EECIP.GetT_OE_DOCUMENTS_ByProjectID(model.project.PROJECT_IDX);
                }

                if (model.project != null)
                {
                    return(View(model));
                }
            }

            TempData["Error"] = "No project found";
            return(RedirectToAction("Index", "Dashboard"));
        }
Exemplo n.º 5
0
        public ActionResult RefAgencyEdit(T_OE_ORGANIZATION agency)
        {
            int UserIDX = db_Accounts.GetUserIDX();

            Guid?SuccID = db_Ref.InsertUpdatetT_OE_ORGANIZATION(agency.ORG_IDX, agency.ORG_ABBR, agency.ORG_NAME, agency.STATE_CD, agency.EPA_REGION, null, null, true, UserIDX);

            if (SuccID != null)
            {
                TempData["Success"] = "Update successful.";
            }
            else
            {
                TempData["Error"] = "Error updating data.";
            }

            //return View(model);
            return(RedirectToAction("RefAgencyEdit", new { id = agency.ORG_IDX }));
        }
        // GET: /Dashboard/Projects
        public ActionResult Projects(Guid?selAgency)
        {
            int UserIDX = db_Accounts.GetUserIDX();

            if (selAgency == null || selAgency == Guid.Empty)
            {
                // get agency for which the logged in user is associated
                T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(UserIDX);
                if (u != null && u.ORG_IDX != null)
                {
                    selAgency = u.ORG_IDX.ConvertOrDefault <Guid>();
                }
            }

            //if still no agency (and not an Admin, then return error)
            if (!User.IsInRole("Admins") && (selAgency == null || selAgency == Guid.Empty || !db_Accounts.UserCanEditOrgIDX(UserIDX, selAgency.ConvertOrDefault <Guid>())))
            {
                TempData["Error"] = "You are not associated with an agency.";
                return(RedirectToAction("AccessDenied", "Home"));
            }


            var model           = new vmDashboardProjects();
            T_OE_ORGANIZATION o = db_Ref.GetT_OE_ORGANIZATION_ByID(selAgency.ConvertOrDefault <Guid>());

            if (o != null)
            {
                model.selAgencyName = o.ORG_NAME;
            }

            model.projects  = db_EECIP.GetT_OE_PROJECTS_ByOrgIDX(selAgency.ConvertOrDefault <Guid>());
            model.selAgency = selAgency;

            if (User.IsInRole("Admins"))
            {
                model.ddl_Agencies = ddlHelpers.get_ddl_organizations(true, true);
            }

            return(View(model));
        }
        // GET: /Dashboard/ProjectDetails/1
        /// <param name="id">Only supply for existing case</param>
        /// <param name="orgIDX">Only supply for new case</param>
        public ActionResult ProjectDetails(Guid?id, Guid?orgIDX, string returnURL)
        {
            int UserIDX = db_Accounts.GetUserIDX();
            var model   = new vmDashboardProjectDetails();

            //new case
            if (id == null)
            {
                //if new case and either no org supplied or the org supplied the user doesn't have rights to edit, then fail
                if ((orgIDX == null) || (User.IsInRole("Admins") == false && db_Accounts.UserCanEditOrgIDX(UserIDX, orgIDX.ConvertOrDefault <Guid>()) == false))
                {
                    TempData["Error"] = "You cannot edit projects for this agency.";
                    return(RedirectToAction("AccessDenied", "Home"));
                }

                //if got this far then initialize valid new project
                model.project = new T_OE_PROJECTS
                {
                    ORG_IDX     = orgIDX,
                    PROJECT_IDX = Guid.NewGuid(),
                };
                model.NewProjInd = true;
            }
            else
            {
                model.project = db_EECIP.GetT_OE_PROJECTS_ByIDX(id);
                if (model.project == null)
                {
                    TempData["Error"] = "Project not found.";
                    return(RedirectToAction("AccessDenied", "Home"));
                }
                else
                {
                    //should be existing case
                    if (User.IsInRole("Admins") == false && db_Accounts.UserCanEditOrgIDX(UserIDX, model.project.ORG_IDX.ConvertOrDefault <Guid>()) == false)
                    {
                        TempData["Error"] = "You cannot edit projects for this agency.";
                        return(RedirectToAction("AccessDenied", "Home"));
                    }

                    //existing case, no failure
                    model.SelectedProgramAreas = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeSelected(model.project.PROJECT_IDX, "Program Area");
                    model.SelectedFeatures     = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeSelected(model.project.PROJECT_IDX, "Project Feature");
                    model.files_existing       = db_EECIP.GetT_OE_DOCUMENTS_ByProjectID(model.project.PROJECT_IDX);
                }
            }


            //if got this far (regardless of new or existing) then add more to the model
            T_OE_ORGANIZATION _org = db_Ref.GetT_OE_ORGANIZATION_ByID(model.project.ORG_IDX.ConvertOrDefault <Guid>());

            if (_org != null)
            {
                model.orgName = _org.ORG_NAME;
                model.orgType = _org.ORG_TYPE;
            }
            model.sProjectUrlList = db_EECIP.GetT_OE_PROJECTS_URL_ByProjIDX(model.project.PROJECT_IDX);
            model.ddl_AgencyUsers = ddlHelpers.get_ddl_users_by_organization(model.project.ORG_IDX.ConvertOrDefault <Guid>());
            model.AllProgramAreas = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeAll(model.project.PROJECT_IDX, "Program Area").Select(x => new SelectListItem {
                Value = x, Text = x
            });
            model.AllFeatures = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeAll(model.project.PROJECT_IDX, "Project Feature").Select(x => new SelectListItem {
                Value = x, Text = x
            });
            model.ReturnURL = returnURL ?? "Projects";
            return(View(model));
        }
Exemplo n.º 8
0
        public ActionResult ExportData(string[] exportdata)
        {
            DataTable dtProject  = new DataTable("Project");
            DataTable dtServices = new DataTable("Service");
            Guid?     selAgency  = null;
            int       UserIDX    = db_Accounts.GetUserIDX();

            // get agency for which the logged in user is associated
            T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(UserIDX);

            if (u != null && u.ORG_IDX != null)
            {
                selAgency = u.ORG_IDX.ConvertOrDefault <Guid>();
            }

            //if still no agency (and not an Admin, then return error)
            if (!User.IsInRole("Admins") && (selAgency == null || selAgency == Guid.Empty || !db_Accounts.UserCanEditOrgIDX(UserIDX, selAgency.ConvertOrDefault <Guid>())))
            {
                TempData["Error"] = "You are not associated with an agency.";
                return(RedirectToAction("AccessDenied", "Home"));
            }
            T_OE_ORGANIZATION o = db_Ref.GetT_OE_ORGANIZATION_ByID(selAgency.ConvertOrDefault <Guid>());

            List <T_OE_ORGANIZATION> oOrgList = new List <T_OE_ORGANIZATION>();

            if (User.IsInRole("Admins"))
            {
                oOrgList = db_Ref.GetT_OE_ORGANIZATION(true, true);
            }
            if (exportdata.Contains("Projects"))
            {
                dtProject.Columns.AddRange(new DataColumn[24] {
                    new DataColumn("Agency Name"),
                    new DataColumn("Record Source"),
                    new DataColumn("Project Name"),
                    new DataColumn("Project Description"),
                    new DataColumn("Media"),
                    new DataColumn("Start Year"),
                    new DataColumn("Project Status"),
                    new DataColumn("Year Last Updated"),
                    new DataColumn("Project URL"),
                    new DataColumn("Mobile Ind"),
                    new DataColumn("Mobile Description"),
                    new DataColumn("Adv Mon Ind"),
                    new DataColumn("Adv Mon Description"),
                    new DataColumn("BP Improvement Ind"),
                    new DataColumn("BP Improvement Desc"),
                    new DataColumn("COTS"),
                    new DataColumn("Vendor"),
                    new DataColumn("Project Contact"),
                    new DataColumn("EECIP Project ID"),
                    new DataColumn("Import ID"),
                    new DataColumn("Program Areas"),
                    new DataColumn("Features"),
                    new DataColumn("Delete Ind"),
                    new DataColumn("External Source ID")
                });
                foreach (var oOneOrgName in oOrgList)
                {
                    List <T_OE_PROJECTS> oProject = db_EECIP.GetT_OE_PROJECTS_ByOrgIDX(oOneOrgName.ORG_IDX.ConvertOrDefault <Guid>());
                    foreach (var oOneProject in oProject)
                    {
                        string AgencyName         = oOneOrgName.ORG_NAME;
                        string RecordSource       = oOneProject.RECORD_SOURCE;
                        string ProjectName        = oOneProject.PROJ_NAME;
                        string ProjectDescription = oOneProject.PROJ_DESC;
                        string Media = "";
                        if (oOneProject.T_OE_REF_TAGS2 != null)
                        {
                            Media = oOneProject.T_OE_REF_TAGS2.TAG_NAME;
                        }
                        int?   StartYear       = oOneProject.START_YEAR;
                        string ProjectStatus   = oOneProject.PROJ_STATUS;
                        int?   YearLastUpdated = oOneProject.DATE_LAST_UPDATE;
                        string ProjectURL      = "";

                        List <T_OE_PROJECT_URLS> oURL = db_EECIP.GetT_OE_PROJECTS_URL_ByProjIDX(oOneProject.PROJECT_IDX);
                        foreach (var suburl in oURL)
                        {
                            if (suburl.PROJECT_URL != "")
                            {
                                if (ProjectURL == "")
                                {
                                    ProjectURL = suburl.PROJECT_URL;
                                }
                                else
                                {
                                    ProjectURL = ProjectURL + "|" + suburl.PROJECT_URL;
                                }
                            }
                        }

                        int?   MobileInd         = oOneProject.MOBILE_IND;
                        string MobileDescription = oOneProject.MOBILE_DESC;
                        int?   AdvMonInd         = oOneProject.ADV_MON_IND;
                        string AdvMonDescription = oOneProject.ADV_MON_DESC;
                        int?   BPImprovementInd  = oOneProject.BP_MODERN_IND;
                        string BPImprovementDesc = oOneProject.BP_MODERN_DESC;
                        string COTS           = oOneProject.COTS;
                        string Vendor         = oOneProject.VENDOR;
                        string ProjectContact = oOneProject.PROJECT_CONTACT;
                        Guid   EECIPProjectID = oOneProject.PROJECT_IDX;
                        string ImportID       = oOneProject.IMPORT_ID;
                        string ProgramAreas   = "";
                        foreach (var subitem in oOneProject.T_OE_PROJECT_TAGS)
                        {
                            if (subitem.PROJECT_ATTRIBUTE == "Program Area")
                            {
                                if (ProgramAreas == "")
                                {
                                    ProgramAreas = subitem.PROJECT_TAG_NAME;
                                }
                                else
                                {
                                    ProgramAreas = ProgramAreas + "|" + subitem.PROJECT_TAG_NAME;
                                }
                            }
                        }
                        string ProjectFeature = "";
                        foreach (var subfeature in oOneProject.T_OE_PROJECT_TAGS)
                        {
                            if (subfeature.PROJECT_ATTRIBUTE == "Project Feature")
                            {
                                if (ProjectFeature == "")
                                {
                                    ProjectFeature = subfeature.PROJECT_TAG_NAME;
                                }
                                else
                                {
                                    ProjectFeature = ProjectFeature + "|" + subfeature.PROJECT_TAG_NAME;
                                }
                            }
                        }

                        dtProject.Rows.Add(AgencyName, RecordSource, ProjectName, ProjectDescription, Media, StartYear, ProjectStatus, YearLastUpdated, ProjectURL, MobileInd,
                                           MobileDescription, AdvMonInd, AdvMonDescription, BPImprovementInd, BPImprovementDesc, COTS, Vendor, ProjectContact, EECIPProjectID, ImportID,
                                           ProgramAreas, ProjectFeature, "", "");
                    }
                }
            }
            if (exportdata.Contains("Services"))
            {
                dtServices.Columns.AddRange(new DataColumn[15] {
                    new DataColumn("Agency Name"),
                    new DataColumn("Record Source"),
                    new DataColumn("Enterprise Service Name"),
                    new DataColumn("Active Interest IND"),
                    new DataColumn("Project Name"),
                    new DataColumn("Vendor"),
                    new DataColumn("Status"),
                    new DataColumn("Project Contact"),
                    new DataColumn("Comments"),
                    new DataColumn("EECIP Ent Service ID"),
                    new DataColumn("Import ID"),
                    new DataColumn("Created By"),
                    new DataColumn("Created Date"),
                    new DataColumn("Last Modified By"),
                    new DataColumn("Last Modified Date")
                });
                foreach (var oOneOrgName in oOrgList)
                {
                    List <OrganizationEntServicesDisplayType> oServicesList = db_EECIP.GetT_OE_ORGANIZATION_ENT_SVCS_NoLeftJoin(oOneOrgName.ORG_IDX.ConvertOrDefault <Guid>());

                    foreach (var oOneService in oServicesList)
                    {
                        string   AgencyName            = oOneOrgName.ORG_NAME;
                        string   RecordSource          = oOneService.RECORD_SOURCE;
                        string   EnterpriseServiceName = oOneService.ENT_PLATFORM_NAME;
                        bool     ActiveInterestIND     = oOneService.ACTIVE_INTEREST_IND;
                        string   ProjectName           = oOneService.PROJECT_NAME;
                        string   Vendor            = oOneService.VENDOR;
                        string   ProjectStatus     = oOneService.IMPLEMENT_STATUS;
                        string   ProjectContact    = oOneService.PROJECT_CONTACT;
                        string   Comments          = oOneService.COMMENTS;
                        int?     EECIPEntServiceID = oOneService.ORG_ENT_SVCS_IDX;
                        string   ImportID          = "";
                        int?     CreatedBy         = oOneService.CREATE_USERIDX;
                        DateTime?CreatedDate       = oOneService.CREATE_DT;
                        int?     LastModifiedBy    = oOneService.MODIFY_USERIDX;
                        DateTime?LastModifiedDate  = oOneService.MODIFY_DT;

                        dtServices.Rows.Add(AgencyName, RecordSource, EnterpriseServiceName, ActiveInterestIND, ProjectName, Vendor, ProjectStatus, ProjectContact,
                                            Comments, EECIPEntServiceID, ImportID, CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate);
                    }
                }
            }
            DataSet dsExport = new DataSet();

            if (dtProject.Rows.Count > 0)
            {
                dsExport.Tables.Add(dtProject);
            }
            if (dtServices.Rows.Count > 0)
            {
                dsExport.Tables.Add(dtServices);
            }
            using (XLWorkbook wb = new XLWorkbook())
            {
                wb.Worksheets.Add(dsExport);
                wb.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
                wb.Style.Font.Bold            = true;

                Response.Clear();
                Response.Buffer      = true;
                Response.Charset     = "";
                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                Response.AddHeader("content-disposition", "attachment;filename= ProjectsAndServicesReport.xlsx");

                using (MemoryStream MyMemoryStream = new MemoryStream())
                {
                    wb.SaveAs(MyMemoryStream);
                    MyMemoryStream.WriteTo(Response.OutputStream);

                    Response.Flush();
                    Response.End();
                }
            }

            return(View());
        }
Exemplo n.º 9
0
        // GET: /Dashboard/ProjectDetails/1
        /// <param name="id">Only supply for existing case</param>
        /// <param name="orgIDX">Only supply for new case</param>
        public ActionResult ProjectDetails(Guid?id, Guid?orgIDX, string returnURL)
        {
            int UserIDX = db_Accounts.GetUserIDX();
            var model   = new vmDashboardProjectDetails();

            //new case********************************************
            if (id == null)
            {
                //if new case and either no org supplied or the org supplied the user doesn't have rights to edit, then fail
                if ((orgIDX == null) || (User.IsInRole("Admins") == false && db_Accounts.UserCanEditOrgIDX(UserIDX, orgIDX.ConvertOrDefault <Guid>()) == false))
                {
                    TempData["Error"] = "You cannot edit projects for this agency or no agency supplied.";
                    return(RedirectToAction("AccessDenied", "Home"));
                }

                //if got this far then initialize valid new project
                model.project = new T_OE_PROJECTS
                {
                    PROJECT_IDX = Guid.NewGuid(),
                };

                //populate org for new project
                T_OE_ORGANIZATION o = db_Ref.GetT_OE_ORGANIZATION_ByID(orgIDX.ConvertOrDefault <Guid>());
                model.ProjectOrgs = new List <T_OE_ORGANIZATION>();
                model.ProjectOrgs.Add(o);

                model.NewProjInd    = true;
                model.NewProjOrgIDX = orgIDX;
            }
            else  //edit case********************************************
            {
                model.project = db_EECIP.GetT_OE_PROJECTS_ByIDX(id);
                if (model.project == null)
                {
                    TempData["Error"] = "Project not found.";
                    return(RedirectToAction("AccessDenied", "Home"));
                }
                else
                {
                    //rich text display
                    model.ProjectRichDesc = model.project.PROJ_DESC_HTML;

                    //project orgs
                    model.ProjectOrgs = db_EECIP.GetT_OE_PROJECT_ORGS_ByProject(id.ConvertOrDefault <Guid>());

                    //should be existing case
                    if (User.IsInRole("Admins") == false && db_Accounts.UserCanEditOrgList(UserIDX, model.ProjectOrgs) == false)
                    {
                        TempData["Error"] = "You cannot edit projects for this agency.";
                        return(RedirectToAction("AccessDenied", "Home"));
                    }

                    //existing case, no failure
                    model.SelectedProgramAreas = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeSelected(model.project.PROJECT_IDX, "Program Area");
                    model.SelectedFeatures     = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeSelected(model.project.PROJECT_IDX, "Tags");
                    model.files_existing       = db_EECIP.GetT_OE_DOCUMENTS_ByProjectID(model.project.PROJECT_IDX);
                }
            }


            //if got this far (regardless of new or existing) then add more to the model
            T_OE_ORGANIZATION _org = db_Ref.GetT_OE_ORGANIZATION_ByID(model.ProjectOrgs[0].ORG_IDX.ConvertOrDefault <Guid>());

            if (_org != null && _org.ORG_TYPE == "Governance")
            {
                model.governanceInd = true;
            }

            model.sProjectUrlList = db_EECIP.GetT_OE_PROJECTS_URL_ByProjIDX(model.project.PROJECT_IDX);
            model.ddl_AgencyUsers = ddlHelpers.get_ddl_users_by_organizationList(model.ProjectOrgs);
            model.AllProgramAreas = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeAll(model.project.PROJECT_IDX, "Program Area").Select(x => new SelectListItem {
                Value = x, Text = x
            });
            model.AllFeatures = db_EECIP.GetT_OE_PROJECT_TAGS_ByAttributeAll(model.project.PROJECT_IDX, "Tags").Select(x => new SelectListItem {
                Value = x, Text = x
            });
            //model.ddl_Agencies = ddlHelpers.get_ddl_organizations(true, false);
            model.ReturnURL = returnURL ?? "Projects";
            return(View(model));
        }