Esempio n. 1
0
 public ExecuteContext(string executeId, ExecuteData arguments)
 {
     Status    = "NOT READY";
     ExecuteId = executeId;
     Argument  = arguments;
     Environment.SetEnvironmentVariable("DFRAME_MASTER_HOST", arguments.HostAddress, EnvironmentVariableTarget.Process);
 }
Esempio n. 2
0
        public ExecuteResponse execute(ExecuteData exe)
        {
            try
            {
                using (client = new AuthorizeService.AuthorizePortTypeClient(this.AuthorizeBinding, this.AuthorizeEndpoint))
                {
                    HeaderHttpExtension.AddCustomHeaderUserInformation(new OperationContextScope(client.InnerChannel), this.Headers);

                    string statusMessage, authorizationKey;
                    string enc = exe.getEncodingMethod();
                    Object pay = exe.getPayload();

                    var statusCode = client.Execute(
                        exe.getSecurity(),
                        exe.getSession(),
                        exe.getMerchant(),
                        exe.getOperation(),
                        ref enc,
                        ref pay,
                        out statusMessage,
                        out authorizationKey);

                    ExecuteResponse response = new ExecuteResponse(statusCode, statusMessage, authorizationKey, enc, pay);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                ExecuteResponse response = new ExecuteResponse(0, ex.Message, "", "", null);
                return(response);
            }
        }
Esempio n. 3
0
        internal override TRes RunCheckInternal(ExecuteData <TReq> req, RunCondition runCondition)
        {
            if (req.req_data == null)
            {
                return(new TRes().WithResult(SysResultTypes.ApplicationError, "Task must Run with request info!"));
            }

            return(base.RunCheckInternal(req, runCondition));
        }
 public ServiceProcess ExecuteAsync(object arguments)
 {
     ServiceProcess newProcess = new ServiceProcess();
     ServiceProcessHelper storedProcess = new ServiceProcessHelper(newProcess);
     OperationContext.Current.InstanceContext.Extensions.Add(storedProcess);
     ExecuteData executeData = new ExecuteData { Process = storedProcess.Process, Arguments = arguments };
     ThreadPool.QueueUserWorkItem(WorkerThread, executeData);
     return newProcess;
 }
Esempio n. 5
0
        public ExecuteContext CreateContext(ExecuteData executeData)
        {
            var contextId = Guid.NewGuid().ToString();
            var context   = new ExecuteContext(contextId, executeData);

            _executeContext = context;

            // register context
            OnRegisterContext?.Invoke(context);

            return(context);
        }
Esempio n. 6
0
        public ServiceProcess ExecuteAsync(object arguments)
        {
            ServiceProcess       newProcess    = new ServiceProcess();
            ServiceProcessHelper storedProcess = new ServiceProcessHelper(newProcess);

            OperationContext.Current.InstanceContext.Extensions.Add(storedProcess);
            ExecuteData executeData = new ExecuteData {
                Process = storedProcess.Process, Arguments = arguments
            };

            ThreadPool.QueueUserWorkItem(WorkerThread, executeData);
            return(newProcess);
        }
Esempio n. 7
0
        public Json_mysql_asp()
        {
            string query = System.IO.File.ReadAllText(@"d:\bricquette\dole.txt");

            cnn.Open();
            cmd = new MySqlCommand(query, cnn);
            cmd.ExecuteNonQuery();
            cnn.Close();


            Executedata += (ClearData);
            Executedata += (SetDataColumn);
            Executedata += (FetchDataTable);
            Executedata += (PageRender);
        }
Esempio n. 8
0
        async void loaddb()
        {
            var map = new Map(MapSpan.FromCenterAndRadius(
                                  new Position(10.787639, 106.705060),
                                  Distance.FromMiles(0.5)))
            {
                IsShowingUser   = true,
                VerticalOptions = LayoutOptions.FillAndExpand
            };


            ExecuteData executeData = new ExecuteData();
            //get List<Pin> form BFO
            List <Pin> list_pin_p = await executeData.getPin();

            foreach (var pin_t in list_pin_p)
            {
                map.Pins.Add(pin_t);
            }
            Content = map;
        }
Esempio n. 9
0
 /// <summary>
 ///  执行任务
 /// </summary>
 /// <param name="req"></param>
 /// <returns></returns>
 public Task <TaskResponse <TRes> > Run(ExecuteData <TDomain, TReq> req)
 {
     return(Run(req, new RunCondition()));
 }
Esempio n. 10
0
 public ExecuteResponse execute(ExecuteData ex)
 {
     return(auth.execute(ex));
 }
Esempio n. 11
0
        public void WorkerThread(object state)
        {
            ExecuteData executeData = (ExecuteData)state;

            Process(executeData.Process, executeData.Arguments);
        }