Exemple #1
0
        public ActionResult SearchAdminPopulateIndex()
        {
            try
            {
                //***********PROJECTS **************************
                //first reset all projects to unsynced
                db_EECIP.ResetT_OE_PROJECTS_Unsynced();

                //then send all unsynced projects to Azure
                AzureSearch.PopulateSearchIndexProject(null);


                //***********AGENCIES  **************************
                //reset all agencies to unsynced
                db_Ref.ResetT_OE_ORGANIZATION_Unsynced();

                //then send all unsynced agencies to Azure
                AzureSearch.PopulateSearchIndexOrganization(null);


                //***********ENT SERVICES  **************************
                db_EECIP.ResetT_OE_ORGANIZATION_ENT_SVCS_Unsynced();

                //then send all unsynced agencies to Azure
                AzureSearch.PopulateSearchIndexEntServices(null);


                //***********PEOPLE  **************************
                db_Accounts.ResetT_OE_USERS_Unsynced();

                //then send all unsynced agencies to Azure
                AzureSearch.PopulateSearchIndexUsers(null);


                //***********FORUM TOPICS  **************************
                db_Forum.UpdateTopic_SetAllUnsynced();

                //then send all unsynced agencies to Azure
                AzureSearch.PopulateSearchIndexForumTopic(null);


                TempData["Success"] = "Search index populated.";
            }
            catch (Exception ex)
            {
                TempData["Error"] = ex.ToString().SubStringPlus(0, 100);
            }

            return(RedirectToAction("SearchAdmin", "Admin"));
        }
        public ActionResult AgencyEntServiceEdit(vmDashboardAgency model)
        {
            if (ModelState.IsValid)
            {
                var z      = model.edit_ent_services;
                int SuccID = db_EECIP.InsertUpdatetT_OE_ORGANIZATION_ENT_SVCS(z.ENT_PLATFORM_IDX, model.agency.ORG_IDX, z.ENT_PLATFORM_IDX, z.PROJECT_NAME, z.VENDOR, z.IMPLEMENT_STATUS,
                                                                              z.COMMENTS, z.PROJECT_CONTACT, z.ACTIVE_INTEREST_IND, false, db_Accounts.GetUserIDX(), true);
                if (SuccID > 0)
                {
                    //sync to search service
                    AzureSearch.PopulateSearchIndexEntServices(SuccID);
                    TempData["Success"] = "Data Saved.";
                }
                else
                {
                    TempData["Error"] = "Data Not Saved.";
                }
            }

            return(RedirectToAction("Agency", "Dashboard", new { selAgency = model.agency.ORG_IDX }));
        }