public async Task FindAsync_WithPortals_ShouldHaveData() { // arrange var mockHttp = new MockHttpMessageHandler(); var layout = "the-layout"; mockHttp.When(HttpMethod.Post, $"{FindTestsHelpers.server}/fmi/data/v1/databases/{FindTestsHelpers.file}/sessions") .Respond("application/json", DataApiResponses.SuccessfulAuthentication()); mockHttp.When(HttpMethod.Post, $"{FindTestsHelpers.server}/fmi/data/v1/databases/{FindTestsHelpers.file}/layouts/{layout}/_find") .Respond(HttpStatusCode.OK, "application/json", DataApiResponses.SuccessfulFindWithPortal()); var fdc = new FileMakerRestClient(mockHttp.ToHttpClient(), FindTestsHelpers.server, FindTestsHelpers.file, FindTestsHelpers.user, FindTestsHelpers.pass); var toFind = new PortalModel() { ES_ONE = "" }; // act var response = await fdc.FindAsync(toFind); // assert Assert.NotEmpty(response); Assert.NotEmpty(response.SelectMany(p => p.Actions)); // hard coded from sample data, if changed update here Assert.Equal(16, response.First().Actions.First().ID); }
public ActionResult ProcesarContacto(Consulta consulta) { var modelo = new PortalModel(); modelo.GuardarConsulta(consulta); return(RedirectToAction("Confirmacion")); }
private void btnSave_Click(object sender, EventArgs e) { if (Model == null) { Model = new PortalModel(); } Model.RemoteHost = txtRemoteHost.Text.Trim(); Model.RemotePort = Convert.ToInt32(nudRemotePort.Value); Model.LocalIpAddress = txtLocalIpAddress.Text.Trim(); Model.LocalPort = Convert.ToInt32(nudLocalPort.Value); Model.SendInterval = Convert.ToInt32(nudSendInterval.Value); this.DialogResult = DialogResult.OK; this.Close(); }
private static List <MethodDescription> CollectMethodDescriptions(PortalModel portalModel) { AppDomain reflectionDomain = AppDomain.CreateDomain("OpenSlx.AutoWire.Inspector Domain", null, null); Inspector inspectorProxy = (Inspector)reflectionDomain.CreateInstanceAndUnwrap("OpenSlx.AutoWire", "OpenSlx.AutoWire.Inspector"); inspectorProxy.InitializeDomain(portalModel.Project.Drive.RootDirectory + "\\deployment\\common\\bin"); List <MethodDescription> result = new List <MethodDescription>(); foreach (PortalApplication app in portalModel.PortalApplications) { List <MethodDescription> appMethods = inspectorProxy.CollectMethodDescriptionsForApp(app.SupportFilesDefinition.ResolvedProjectPath); foreach (MethodDescription method in appMethods) { if (result.Count(m => m.Equals(method)) == 0) { result.Add(method); } } } AppDomain.Unload(reflectionDomain); return(result); }
private static List<MethodDescription> CollectMethodDescriptions(PortalModel portalModel) { AppDomain reflectionDomain = AppDomain.CreateDomain("OpenSlx.AutoWire.Inspector Domain", null, null); Inspector inspectorProxy = (Inspector)reflectionDomain.CreateInstanceAndUnwrap("OpenSlx.AutoWire", "OpenSlx.AutoWire.Inspector"); inspectorProxy.InitializeDomain(portalModel.Project.Drive.RootDirectory + "\\deployment\\common\\bin"); List<MethodDescription> result = new List<MethodDescription>(); foreach (PortalApplication app in portalModel.PortalApplications) { List<MethodDescription> appMethods = inspectorProxy.CollectMethodDescriptionsForApp(app.SupportFilesDefinition.ResolvedProjectPath); foreach (MethodDescription method in appMethods) { if (result.Count(m => m.Equals(method)) == 0) result.Add(method); } } AppDomain.Unload(reflectionDomain); return result; }
public PortalGun(ServerModel serverModel, PortalModel portalModel) { this.serverModel = serverModel; this.portalModel = portalModel; }
private Portal ModelToView(PortalModel model) { return(Portals.First(vm => vm.Model == model)); }
public SubmittersController(PortalModel context) { _context = context; AutoMapper.Mapper.CreateMap<Submitter, SubmitterViewModel>(); }
private LinkModel L(PortalModel p1, PortalModel p2) { return(new LinkModel(p1, p2)); }
//==================================================================================================== /// <summary> /// Addon interface. Run addon from doc property PortalGuid or PortalId (form, querystring, doc.setProperty()) /// </summary> /// <param name="cp"></param> /// <returns></returns> public override object Execute(CPBaseClass cp) { try { // // get portal to display string instanceId = cp.Doc.GetText("instanceid"); string visitPropertyName = "portalForInstance" + instanceId; PortalModel portal = null; int portalId = cp.Doc.GetInteger(Constants.rnSetPortalId); if (!portalId.Equals(0)) { portal = DbBaseModel.create <PortalModel>(cp, portalId); } if (portal == null) { // // -- no setPortalId, try guid string portalGuid = cp.Doc.GetText(Constants.rnSetPortalGuid); if (!string.IsNullOrEmpty(portalGuid)) { portal = DbBaseModel.create <PortalModel>(cp, portalGuid); } if (portal == null) { // // -- no setPortalGuid, try visit property portalId = cp.Visit.GetInteger(visitPropertyName); if (!portalId.Equals(0)) { portal = DbBaseModel.create <PortalModel>(cp, portalId); } if (portal == null) { // // no visit property, try portal guid argument portalGuid = cp.Doc.GetText("PortalGuid"); if (!string.IsNullOrEmpty(portalGuid)) { portal = DbBaseModel.create <PortalModel>(cp, portalGuid); } if (portal == null) { // // try value from addon argument portalId = cp.Doc.GetInteger("Portal"); if (!portalId.Equals(0)) { portal = DbBaseModel.create <PortalModel>(cp, portalId); } } } } } cp.Doc.AddRefreshQueryString(Constants.rnSetPortalId, portal.id); cp.Visit.SetProperty(visitPropertyName, portal.id); return(getPortalAddonHtml(cp, portal.id)); } catch (Exception ex) { cp.Site.ErrorReport(ex, "portalClass exception"); return(""); } }
public ShowPortalOnMapMessage(object sender, PortalModel portal) : base(sender) { Portal = portal; }
public Portal Init(PortalModel model) { Model = model; return(this); }