using Neo.Afx.Common; using Neo.Afx.ComponentModel; using Neo.Afx.Mvc; using Neo.Afx.Services.Integration; using Neo.Afx.ViewModels; using Neo.LegitimateLicences.ApplicationRequest.Models.Database; using Neo.LegitimateLicences.Common; using Neo.LegitimateLicences.Data.Models; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Neo.LegitimateLicences.ApplicationRequest { public partial class ApplicationRequestController { #region NewAuthority public ActionResult NewAuthority() { var m = new NewApplicationRequestModel(); var db = new LegitimateDatabase(); var office = db.GetOfficeLocation(Profile.OfficeLocationID.Value); m.Lookups = GetLookupsForNewApplicationView(); m.ProvinceID = office.ProvinceID; return View("New.NewAuthority", m); } #endregion #region AssociationRoutesSearch [HttpPost] public JsonNetResult AssociationRoutesSearch(long associationID) { try { var database = new LegitimateDatabase(); var applicationDatabase = new ApplicationDatabase(); var routes = applicationDatabase.ApplicationCreateGetAssociationRoutes(associationID, Profile.UserID); return new JsonNetResult() { Data = new JsonBaseResult() { Success = true, Result = new { Routes = routes } } }; } catch (Exception ex) { return new JsonNetResult() { Data = new JsonBaseResult() { Success = false, ErrorCode = "ApplicantSearch", Error = ErrorHelper.GetInnerMostError(ex).Message } }; } } #endregion } }