public async Task Clear() { using (var client = new OperationClient()) { await client.ClearAsync(); } }
public async Task Repare(Vehicle vehicle) { using (var client = new OperationClient()) { await client.RefreshAsync(vehicle); } }
async Task <bool> CargarFoto() { return(await Task.Factory.StartNew(() => { OperationClient WS = null; try{ WS = Utils.InitializeServiceClient(); Request = WS.UploadODTFotoForMovil(ODTDet.Folio, Utils.compress(Convert.ToBase64String(bitmapDetalle, Base64FormattingOptions.InsertLineBreaks))); if (Request.IsComplete && Convert.ToInt32(Request.RecordId) != 0) { idevidencia = Convert.ToInt32(Request.RecordId); return true; } else { return false; } }catch (Exception ex) { return false; } })); }
public async Task Save(Vehicle vehicle) { using (var client = new OperationClient()) { await client.AddAsync(vehicle); } }
public static async Task <int> Posponer(DTOODTPospuesta insert, Context ApplicationContext) { OperationClient WS = null; int regreso = 0; try { int detalle = await Utils.CargarFoto(insert.ODTID.ToString(), insert.Foto.Foto, ApplicationContext, insert.Foto.FechaCreacion.Day.ToString() + "/" + insert.Foto.FechaCreacion.Month.ToString() + "/" + insert.Foto.FechaCreacion.Year.ToString()); if (detalle != 0) { insert.FotoID = detalle; insert.Foto.Foto = null; WS = Utils.InitializeServiceClient(); OperationStatus Request = WS.PostponeODT(insert); if (Request.IsComplete) { regreso = 1; } } } catch (Exception exc) { regreso = 0; } finally { if (WS != null) { WS.Close(); } } return(regreso); }
public static void Start() { if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { CultureInfoClient.Start(); Navigator.RegisterArea(typeof(WordClient)); Navigator.AddSettings(new List <EntitySettings> { new EntitySettings <WordTemplateEntity> { PartialViewName = e => ViewPrefix.FormatWith("WordTemplate") }, new EntitySettings <SystemWordTemplateEntity> { }, new EntitySettings <WordTransformerSymbol> { }, new EntitySettings <WordConverterSymbol> { }, }); OperationClient.AddSetting(new EntityOperationSettings <WordTemplateEntity>(WordTemplateOperation.CreateWordReport) { Group = EntityOperationGroup.None, Click = ctx => Module["createWordReportFromTemplate"](ctx.Options(), JsFunction.Event, new FindOptions(ctx.Entity.Query.ToQueryName()).ToJS(ctx.Prefix, "New"), ctx.Url.Action((WordController mc) => mc.CreateWordReport())) }); } }
///<summary>ASYNC Web Service call: Retrieve all security permissions for the current user</summary> ///<returns>ASYNC task: List of security keys and access levels</returns> public static async Task <System.Collections.Generic.List <System.Tuple <string, FACTS.Framework.Security.SecurityAccess> > > FetchPermissionsAsync() { using (OperationClient client = new OperationClient(servicePath, "FetchPermissions")) { return(await client.ReadAsync <System.Collections.Generic.List <System.Tuple <string, FACTS.Framework.Security.SecurityAccess> > >()); } }
///<summary>ASYNC Web Service call: Retrieve all security definitions in the system</summary> ///<remarks>Used during initialization to populate SecurityUtil with data</remarks> ///<returns>ASYNC task: List of security definitions</returns> public static async Task <System.Collections.Generic.List <string> > FetchDefinitionsAsync() { using (OperationClient client = new OperationClient(servicePath, "FetchDefinitions")) { return(await client.ReadAsync <System.Collections.Generic.List <string> >()); } }
public static void Start(params Type[] types) { if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { if (types == null) { throw new ArgumentNullException("types"); } Navigator.RegisterArea(typeof(NoteClient)); Navigator.AddSettings(new List <EntitySettings> { new EntitySettings <NoteTypeEntity> { PartialViewName = _ => ViewPrefix.FormatWith("NoteType") }, new EntitySettings <NoteEntity> { PartialViewName = _ => ViewPrefix.FormatWith("Note"), IsCreable = EntityWhen.Never }, }); Types = types; WidgetsHelper.GetWidget += WidgetsHelper_GetWidget; OperationClient.AddSettings(new List <OperationSettings> { new EntityOperationSettings <Entity>(NoteOperation.CreateNoteFromEntity) { IsVisible = _ => false } }); } }
public void AddVehicles(IEnumerable <Vehicle> vehicles) { using (var client = new OperationClient()) { client.AddManyAsync(vehicles.ToArray()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Premium.WageDetail.WageSubmission.WageSubmissionViewModel> GetWagePeriodAsync() { using (OperationClient client = new OperationClient(servicePath, "GetWagePeriod")) { return(await client.ReadAsync <PFML.Shared.ViewModels.Premium.WageDetail.WageSubmission.WageSubmissionViewModel>()); } }
public static async Task <int> CargarFoto(string folio, byte[] Foto, Context ApplicationContext, string fecha) { int retorno = 0; return(await Task.Factory.StartNew(() => { OperationClient WS = null; try{ WS = Utils.InitializeServiceClient(); OperationStatus Request = WS.UploadODTFotoForMovil(folio, Utils.compress(Convert.ToBase64String(Foto, Base64FormattingOptions.InsertLineBreaks))); if (Request.IsComplete) { retorno = Convert.ToInt32(Request.RecordId); } }catch (Exception ex) { retorno = 0; } finally { if (WS != null) { WS.Close(); } } return retorno; })); }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Core.Headers.Agency.SearchCriteria> BlankSearchCriteriaAsync() { using (OperationClient client = new OperationClient(servicePath, "BlankSearchCriteria")) { return(await client.ReadAsync <PFML.Shared.ViewModels.Core.Headers.Agency.SearchCriteria>()); } }
async Task <DTOODTCustom[]> LoadODTs() { DTOODTCustom[] Odts = null; return(await Task.Factory.StartNew(() => { OperationClient WS = null; try{ WS = Utils.InitializeServiceClient(); Odts = WS.GetODTByCuadrilleroID(int.Parse(Utils.UsuarioApp.Iduser)); }catch (Exception ex) { throw ex; } finally { if (WS != null) { WS.Close(); } } return Odts; })); }
///<summary>ASYNC Web Service call: Retrieve all lookup names, codes and data in the system</summary> ///<remarks>Used during initialization to populate LookupUtil with data</remarks> ///<returns>ASYNC task: List of lookup names, codes and data</returns> public static async Task <System.Collections.Generic.Dictionary <string, FACTS.Framework.Lookup.LookupName> > FetchLookupsAsync() { using (OperationClient client = new OperationClient(servicePath, "FetchLookups")) { return(await client.ReadAsync <System.Collections.Generic.Dictionary <string, FACTS.Framework.Lookup.LookupName> >()); } }
public async Task SyncTriggersAsync(ITracer tracer = null) { tracer = tracer ?? _traceFactory.GetTracer(); using (tracer.Step("FunctionManager.SyncTriggers")) { if (!IsFunctionEnabled) { tracer.Trace("This is not a function-enabled site!"); return; } var jwt = System.Environment.GetEnvironmentVariable(Constants.SiteRestrictedJWT); if (String.IsNullOrEmpty(jwt)) { // If there is no token, do nothing. This can happen on non-dynamic stamps tracer.Trace("Ignoring operation as we don't have a token"); return; } var inputs = await GetTriggerInputsAsync(tracer); if (Environment.IsAzureEnvironment()) { var client = new OperationClient(tracer); await client.PostAsync("/operations/settriggers", inputs); } } }
public async Task SyncTriggersAsync() { var tracer = _traceFactory.GetTracer(); using (tracer.Step("FunctionManager.SyncTriggers")) { if (!IsFunctionEnabled) { tracer.Trace("This is not a function-enabled site!"); return; } var inputs = await GetTriggerInputsAsync(tracer); if (inputs.Count == 0) { tracer.Trace("No input triggers!"); return; } if (Environment.IsAzureEnvironment()) { var client = new OperationClient(tracer); await client.PostAsync("/operations/settriggers", inputs); } } }
public static void Start() { if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { CultureInfoClient.Start(); Navigator.RegisterArea(typeof(SMSClient)); Navigator.AddSettings(new List <EntitySettings> { new EmbeddedEntitySettings <SMSConfigurationEmbedded> { PartialViewName = e => ViewPrefix.FormatWith("SMSConfiguration") }, new EntitySettings <SMSMessageEntity> { PartialViewName = e => ViewPrefix.FormatWith("SMSMessage") }, new EntitySettings <SMSTemplateEntity> { PartialViewName = e => ViewPrefix.FormatWith("SMSTemplate") }, new EmbeddedEntitySettings <SMSTemplateMessageEmbedded> { PartialViewName = e => ViewPrefix.FormatWith("SMSTemplateMessage") }, new EntitySettings <SMSSendPackageEntity> { PartialViewName = e => ViewPrefix.FormatWith("SMSSendPackage") }, new EntitySettings <SMSUpdatePackageEntity> { PartialViewName = e => ViewPrefix.FormatWith("SMSUpdatePackage") }, new ModelEntitySettings <MultipleSMSModel> { PartialViewName = e => ViewPrefix.FormatWith("MultipleSMS") }, }); OperationClient.AddSettings(new List <OperationSettings> { new EntityOperationSettings <Entity>(SMSMessageOperation.CreateSMSWithTemplateFromEntity) { Click = ctx => Module["createSmsWithTemplateFromEntity"](ctx.Options(), JsFunction.Event, ctx.Url.Action((SMSController sms) => sms.CreateSMSMessageFromTemplate()), SmsTemplateFindOptions(ctx.Entity.GetType()).ToJS(ctx.Prefix, "New")) }, new ContextualOperationSettings <Entity>(SMSMessageOperation.SendSMSMessagesFromTemplate) { Click = ctx => Module["sendMultipleSMSMessagesFromTemplate"](ctx.Options(), JsFunction.Event, ctx.Url.Action((SMSController sms ) => sms.SendMultipleMessagesFromTemplate()), SmsTemplateFindOptions(ctx.SingleType).ToJS(ctx.Prefix, "New")) }, new ContextualOperationSettings <Entity>(SMSMessageOperation.SendSMSMessages) { Click = ctx => Module["sentMultipleSms"](ctx.Options(), JsFunction.Event, ctx.Prefix, ctx.Url.Action((SMSController sms) => sms.SendMultipleSMSMessagesModel()), ctx.Url.Action((SMSController sms) => sms.SendMultipleMessages())) }, }); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto> SetDataAsync() { using (OperationClient client = new OperationClient(servicePath, "SetData")) { return(await client.ReadAsync <PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Core.Headers.Agency.Record> FetchAsync(int id) { using (OperationClient client = new OperationClient(servicePath, "Fetch")) { client.Value = id; return(await client.ReadAsync <PFML.Shared.ViewModels.Core.Headers.Agency.Record>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <System.Collections.Generic.List <PFML.Shared.ViewModels.Core.Headers.Agency.ResultRecord> > SearchAsync(PFML.Shared.ViewModels.Core.Headers.Agency.SearchCriteria criteria) { using (OperationClient client = new OperationClient(servicePath, "Search")) { client.Value = criteria; return(await client.ReadAsync <System.Collections.Generic.List <PFML.Shared.ViewModels.Core.Headers.Agency.ResultRecord> >()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <System.Collections.Generic.List <PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto> > SubmitRequestAsync(PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto VPRequestForm) { using (OperationClient client = new OperationClient(servicePath, "SubmitRequest")) { client.Value = VPRequestForm; return(await client.ReadAsync <System.Collections.Generic.List <PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto> >()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Premium.Payments.MakePayment.MakePaymentViewModel> GetEmployerDueAmountAsync(int EmployerID) { using (OperationClient client = new OperationClient(servicePath, "GetEmployerDueAmount")) { client.Value = EmployerID; return(await client.ReadAsync <PFML.Shared.ViewModels.Premium.Payments.MakePayment.MakePaymentViewModel>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Premium.Registration.EmployerRegistrationViewModel> ValidateAdminInfoAsync(PFML.Shared.ViewModels.Premium.Registration.EmployerRegistrationViewModel employerRegistrationViewModel) { using (OperationClient client = new OperationClient(servicePath, "ValidateAdminInfo")) { client.Value = employerRegistrationViewModel; return(await client.ReadAsync <PFML.Shared.ViewModels.Premium.Registration.EmployerRegistrationViewModel>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <System.Collections.Generic.List <PFML.Shared.Model.DbDtos.SecurityPermissionDto> > SearchAsync(string sourceType, string sourceName, string targetType, string targetName, string accessType) { using (OperationClient client = new OperationClient(servicePath, "Search")) { client.Value = new { sourceType, sourceName, targetType, targetName, accessType }; return(await client.ReadAsync <System.Collections.Generic.List <PFML.Shared.Model.DbDtos.SecurityPermissionDto> >()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Premium.WageDetail.WageSubmission.WageSubmissionViewModel> AddAsync(PFML.Shared.ViewModels.Premium.WageDetail.WageSubmission.WageSubmissionViewModel wageDetail) { using (OperationClient client = new OperationClient(servicePath, "Add")) { client.Value = wageDetail; return(await client.ReadAsync <PFML.Shared.ViewModels.Premium.WageDetail.WageSubmission.WageSubmissionViewModel>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <System.Collections.Generic.List <PFML.Shared.ViewModels.Revenue.Employer> > SearchAsync(string name) { using (OperationClient client = new OperationClient(servicePath, "Search")) { client.Value = name; return(await client.ReadAsync <System.Collections.Generic.List <PFML.Shared.ViewModels.Revenue.Employer> >()); } }
///<summary>ASYNC Web Service call: unknown</summary> public static async Task SaveAsync(PFML.Shared.Model.DbDtos.SecurityPermissionDto securityPermissionDto) { using (OperationClient client = new OperationClient(servicePath, "Save")) { client.Value = securityPermissionDto; await client.SendAsync(); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.ViewModels.Revenue.Employer> GetEmployerAsync(int ID) { using (OperationClient client = new OperationClient(servicePath, "GetEmployer")) { client.Value = ID; return(await client.ReadAsync <PFML.Shared.ViewModels.Revenue.Employer>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.Model.DbDtos.PaymentMainDto> SavePaymentDetailAsync(PFML.Shared.Model.DbDtos.PaymentMainDto PaymentMainDetails) { using (OperationClient client = new OperationClient(servicePath, "SavePaymentDetail")) { client.Value = PaymentMainDetails; return(await client.ReadAsync <PFML.Shared.Model.DbDtos.PaymentMainDto>()); } }
///<summary>ASYNC Web Service call: unknown</summary> ///<returns>ASYNC task: unknown</returns> public static async Task <PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto> GetRequestAsync(PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto VoluntaryPlanWaiverRequestDto) { using (OperationClient client = new OperationClient(servicePath, "GetRequest")) { client.Value = VoluntaryPlanWaiverRequestDto; return(await client.ReadAsync <PFML.Shared.Model.DbDtos.VoluntaryPlanWaiverRequestDto>()); } }
public async Task HandleAutoSwap(string currentDeploymetId, DeploymentContext context) { ITracer tracer = context.Tracer; if (!IsAutoSwapEnabled()) { tracer.Trace("AutoSwap is not enabled"); return; } string jwtToken = System.Environment.GetEnvironmentVariable(Constants.SiteRestrictedJWT); if (string.IsNullOrWhiteSpace(jwtToken)) { tracer.Trace("Jwt token is null"); return; } // active deployment is always a success deployment string lastDeploymentId = _deploymentStatusManager.ActiveDeploymentId; if (string.Equals(currentDeploymetId, lastDeploymentId, StringComparison.OrdinalIgnoreCase)) { tracer.Trace("Deployment haven't changed, no need for auto swap: {0}", lastDeploymentId); return; } try { FileSystemHelpers.WriteAllTextToFile(_autoSwapLockFilePath, String.Empty); } catch (Exception ex) { tracer.TraceError(ex); } string operationId = "AUTOSWAP" + Guid.NewGuid(); var queryStrings = HttpUtility.ParseQueryString(string.Empty); queryStrings["slot"] = _autoSwapSlotName; queryStrings["operationId"] = operationId; var client = new OperationClient(context.Tracer); await client.PostAsync<string>("/operations/autoswap?" + queryStrings.ToString()); context.Logger.Log("Requesting auto swap to slot - '{0}' operation id - '{1}' deployment id - '{2}'".FormatInvariant(_autoSwapSlotName, operationId, currentDeploymetId)); }
public async Task HandleAutoSwap(string currentDeploymetId, ILogger logger, ITracer tracer) { if (!IsAutoSwapEnabled()) { tracer.Trace("AutoSwap is not enabled"); return; } string jwtToken = System.Environment.GetEnvironmentVariable(Constants.SiteRestrictedJWT); if (string.IsNullOrWhiteSpace(jwtToken)) { tracer.Trace("Jwt token is null"); return; } try { FileSystemHelpers.WriteAllTextToFile(_autoSwapLockFilePath, String.Empty); } catch (Exception ex) { tracer.TraceError(ex); } string operationId = "AUTOSWAP" + Guid.NewGuid(); var queryStrings = HttpUtility.ParseQueryString(string.Empty); queryStrings["slot"] = _autoSwapSlotName; queryStrings["operationId"] = operationId; var client = new OperationClient(tracer); await client.PostAsync<string>("/operations/autoswap?" + queryStrings.ToString()); logger.Log("Requesting auto swap to slot - '{0}' operation id - '{1}' deployment id - '{2}'".FormatInvariant(_autoSwapSlotName, operationId, currentDeploymetId)); }