コード例 #1
0
        public void getFavoriteAgents()
        {
            string       statement = "SELECT agents.Fname AS Name,agents.IDKey, '0' AS g FROM agents INNER JOIN chatfavorite ON agents.IDKey=chatfavorite.TargetID WHERE chatfavorite.AgentID='" + ClientData.AgentIDK + "';";
            TaskCallback call      = new TaskCallback(this.populatePicker);

            DatabaseFunctions.SendToPhp(false, statement, call);
        }
コード例 #2
0
        public void assessStage()
        {
            string       sql  = "SELECT Stage FROM jobindex WHERE IDKey='" + customer + "'";
            TaskCallback call = populateAssessment;

            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #3
0
        public void searchCustomerData()
        {
            string       sql  = "SELECT cusfields.Index,cusfields.Value,cusindex.Name,cusfields.IDKey AS FID FROM crm2.cusfields INNER JOIN crm2.cusindex ON cusfields.CusID=cusindex.IDKey WHERE cusfields.CusID='" + customer + "';";
            TaskCallback call = populatePage;

            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #4
0
        public static void LoadAgentDictionary()
        {
            string       sql  = "SELECT IDKey, FName FROM agents WHERE Active='1'";
            TaskCallback call = populateDictionary;

            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #5
0
ファイル: ClientData.cs プロジェクト: CH-Aric/CRMDesktop
        public async Task <bool> attemptNewLogin(string u, string p, bool s)
        {
            this.Responded = false;
            TaskCallback call      = new TaskCallback(response);
            string       statement = "SELECT IDKey,AgentNum FROM agents WHERE Username='******'AND Password='******';";

            DatabaseFunctions.SendToPhp(false, statement, call);
            while (!Responded)
            {
                await Task.Delay(5);
            }
            bool result;

            if (dict.Count > 1)
            {
                if (s)
                {
                    writeUserDataToFile(u, p);
                }
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
コード例 #6
0
        public async Task <ResponseMessage> ExaminePass(UserInfo user, [FromRoute] string recordId, [FromBody] string desc)
        {
            Logger.Trace($"用户{user?.UserName ?? ""}({user?.Id ?? ""})发起通过审核请求(ExaminePass),请求体为:\r\n(recordId){recordId ?? ""},(desc){desc ?? ""}");
            ResponseMessage response = new ResponseMessage();

            if (string.IsNullOrEmpty(recordId))
            {
                response.Code = ResponseCodeDefines.ArgumentNullError;
                return(response);
            }
            try
            {
                var record = await _examineFlowManager.FindExamineRecordById(recordId, HttpContext.RequestAborted);

                if (record?.ExamineFlow == null)
                {
                    response.Code = ResponseCodeDefines.NotFound;
                    Logger.Info($"用户{user?.UserName ?? ""}({user?.Id ?? ""})发起通过审核请求(ExaminePass)失败:未找到相应的审核记录:\r\n{response.Message},\r\n请求参数为:\r\n(recordId){recordId ?? ""},(desc){desc ?? ""}");
                    return(response);
                }
                NameValueCollection nameValueCollection = new NameValueCollection();
                nameValueCollection.Add("appToken", "app:nwf");
                var taskCallback = new TaskCallback
                {
                    Message          = "",
                    TaskGuid         = record.ExamineFlow.TaskGuid,
                    StepID           = record.ExamineFlow.CurrentStepId,
                    CallbackProtocol = new FlowProtocol {
                        ProtocolType = "", Protocol = "true"
                    },
                    Status = TaskStatusEnum.Finished
                };
                Logger.Info($"用户{user?.UserName ?? ""}({user?.Id ?? ""})向NWF发起通过审核请求协议:\r\n{0}", JsonHelper.ToJson(taskCallback));
                string response2 = await _restClient.Post(ApplicationContext.Current.NWFExamineCallbackUrl, taskCallback, "POST", nameValueCollection);

                Logger.Info($"用户{user?.UserName ?? ""}({user?.Id ?? ""})向NWF发起通过审核请求返回:\r\n{0}", response2);

                var nwfresponse = JsonHelper.ToObject <ResponseMessage>(response2);
                if (nwfresponse.Code != "0")
                {
                    Logger.Error($"用户{user?.UserName ?? ""}({user?.Id ?? ""})像NWF发起通过审核请求(ExaminePass)失败:NWF返回失败:\r\n{nwfresponse.Message},\r\n请求参数为:\r\n(recordId){recordId ?? ""},(desc){desc ?? ""}");
                    return(nwfresponse);
                }
                var response1 = await _examineFlowManager.ExaminePass(user.Id, recordId, desc);

                if (response1.Code != "0")
                {
                    Logger.Error($"用户{user?.UserName ?? ""}({user?.Id ?? ""})发起通过审核请求(ExaminePass)失败:通过记录保存失败:\r\n{response1.Message},\r\n请求参数为:\r\n(recordId){recordId ?? ""},(desc){desc ?? ""}");
                    return(response1);
                }
            }
            catch (Exception e)
            {
                response.Code    = ResponseCodeDefines.ServiceError;
                response.Message = e.ToString();
                Logger.Error($"用户{user?.UserName ?? ""}({user?.Id ?? ""})发起通过审核请求(ExaminePass)报错:\r\n{e.ToString()},\r\n请求参数为:\r\n(recordId){recordId ?? ""},(desc){desc ?? ""}");
            }
            return(response);
        }
コード例 #7
0
        public async void populateTemplateDesc(string result)
        {
            this.descAs = result;
            await PopupNavigation.Instance.PopAllAsync(true);

            TaskCallback c = new TaskCallback(this.populateLastIDK);
            await PopupNavigation.Instance.PushAsync(new Notification_Popup("Your template has been saved", "OK", c), true);
        }
コード例 #8
0
        public async void populateTemplateName(string result)
        {
            this.saveAs = result;
            TaskCallback callD = new TaskCallback(this.populateTemplateDesc);
            await PopupNavigation.Instance.PopAllAsync(true);

            await PopupNavigation.Instance.PushAsync(new GetString_Popup("Description for Template:", "Save", "Back", callD), true);
        }
コード例 #9
0
        public void onClickedSaveTemplate(object sender, RoutedEventArgs e)
        {
            DatabaseFunctions.SendToPhp("INSERT INTO tasktemplates (Name,Description,IDKey) VALUES ('" + templateName.Text + "','" + descField.Text + "','" + highestTID + 1 + "');");
            string       statement = "SELECT IDKey FROM tasktemplates ORDER BY IDKey DESC LIMIT 1;";
            TaskCallback call      = saveTemplateFields;

            DatabaseFunctions.SendToPhp(false, statement, call);
        }
コード例 #10
0
        public TaskEdit_Page(int i)
        {
            this.task = i;
            InitializeComponent();
            TaskCallback call = new TaskCallback(this.populateFields);

            DatabaseFunctions.SendToPhp(false, "SELECT * FROM taskfields WHERE TaskID='" + i + "';", call);
        }
コード例 #11
0
 public void RunTask(TaskCallback <TResult> callback)
 {
     this._start    = DateTime.Now;
     this._callback = callback;
     this.State     = TaskState.Starting;
     this._delegate.BeginInvoke(new AsyncCallback(this.CompleteTask), null);
     this.State = TaskState.Running;
 }
コード例 #12
0
ファイル: JSProxyMgr.cs プロジェクト: sgf/Unity5.3Decompiled
 private void AddTask(TaskCallback task)
 {
     if (this.m_TaskList == null)
     {
         this.m_TaskList = new Queue <TaskCallback>();
     }
     this.m_TaskList.Enqueue(task);
 }
コード例 #13
0
        public void loadFromDatabase()
        {
            TaskCallback call = populateList;
            string       sql  = "SELECT cusindex.Name,cusindex.IDKey,cusfields.Value,cusfields.Index,jobindex.Stage FROM cusindex INNER JOIN cusfields ON cusindex.IDKey=cusfields.CusID INNER JOIN jobindex ON cusindex.IDKey=jobindex.CusID WHERE (cusfields.Index LIKE '%Phone%')";

            sql += appendPickerResult();
            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #14
0
        public void onClickCheck(object sender, EventArgs e)
        {
            string       today = "" + DateTime.Today;
            string       sql   = "SELECT * FROM coupons WHERE Code='" + CouponEntry.Text + "' AND ((StartDate<'" + today + "'AND EndDate>'" + today + "') OR EndDate IS NULL);";
            TaskCallback call  = populate;

            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #15
0
        public CustomerDetail_Page(int i)
        {
            customer = i;
            InitializeComponent();
            TaskCallback call = new TaskCallback(this.populatePage);

            DatabaseFunctions.SendToPhp(false, "SELECT cusindex.Name,cusfields.IDKey AS FID,cusindex.IDKey,cusfields.value,cusfields.Index FROM cusfields INNER JOIN cusindex ON cusfields.cusID=cusindex.IDKey WHERE cusfields.CusID='" + i + "';", call);
        }
コード例 #16
0
        public UserSettings_Page()
        {
            InitializeComponent();
            string       statement = "SELECT * FROM agents WHERE IDKey='" + ClientData.AgentIDK + "';";
            TaskCallback call      = new TaskCallback(this.populateEntries);

            DatabaseFunctions.SendToPhp(false, statement, call);
        }
コード例 #17
0
        public void onClickedLoadTemplate(object sender, RoutedEventArgs e)
        {
            int          num       = int.Parse(DatabaseFunctions.lookupInDictionary((string)this.templatePicker.SelectedItem, "Name", "IDKey", this.templates));
            string       statement = "SELECT taskfields.Value,taskfields.Index,IDKey FROM taskfields WHERE TemplateID='" + num + "';";
            TaskCallback call      = new TaskCallback(this.populateFields);

            DatabaseFunctions.SendToPhp(false, statement, call);
        }
コード例 #18
0
 public void LiveSearch()
 {
     foreach (string s in agents)
     {
         string       sql3  = "SELECT agents.FName,punchclock.State,punchclock.Coordinates,punchclock.TimeStamp,punchclock.Note FROM agents INNER JOIN punchclock ON agents.IDKey = punchclock.AgentID WHERE punchclock.AgentID='" + s + "' ORDER BY punchclock.IDKey DESC";
         TaskCallback call2 = populateLiveFeed;
         DatabaseFunctions.SendToPhp(false, sql3, call2);
     }
 }
コード例 #19
0
ファイル: Price_Page.xaml.cs プロジェクト: CH-Aric/CRMDesktop
        public Price_Page()
        {
            InitializeComponent();
            string       sql  = "SELECT DISTINCT(Brand) FROM pricesheet";
            TaskCallback call = populateBrands;

            DatabaseFunctions.SendToPhp(false, sql, call);
            scroll.Height = ClientData.FrameHeight - 102;
        }
コード例 #20
0
        public FileList(int cusID) : base()
        {
            customer = cusID;
            string       sql  = "SELECT cusfields.Value,cusindex.Name FROM cusfields INNER JOIN cusindex ON cusfields.CusID=cusindex.IDKey WHERE cusindex.IDKey='" + cusID + "' AND cusfields.Index LIKE '%dress%'";
            TaskCallback call = populateGrid;

            DatabaseFunctions.SendToPhp(false, sql, call);
            GridFiller.rapidFill(new string[] { "Associated Files" }, this);
        }
コード例 #21
0
        public Tombstone_Page(int cusID)
        {
            InitializeComponent();
            CusID = cusID;
            string       sql  = "SELECT cusindex.Name,cusfields.IDKey AS FID,cusindex.IDKey,cusfields.Value,cusfields.Index FROM cusfields INNER JOIN cusindex ON cusfields.cusID=cusindex.IDKey WHERE cusfields.CusID='" + CusID + "';";
            TaskCallback call = TombstonePrinter;

            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #22
0
        public PunchAdmin()
        {
            InitializeComponent();
            string       sql  = "SELECT agents.FName,agents.IDKey FROM agents WHERE Active='1'";
            TaskCallback call = populateSalesCombo;

            DatabaseFunctions.SendToPhp(false, sql, call);
            Hours.BackgroundColor = Color.Red;
        }
コード例 #23
0
        public void ApproveSearch()
        {
            TaskCallback call = populatePend;
            DateTime     d    = DayPicker.Date;
            string       sql  = "SELECT * FROM punchclock WHERE AgentID='" + agents[Agent.SelectedIndex] + "' AND (" + FormatFunctions.getRelevantDates(d, "TimeStamp") + ")";

            sql += " ORDER BY IDKey DESC";
            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #24
0
        public Job_Page(int jobID)
        {
            InitializeComponent();
            JobID = jobID;
            string       sql2  = "SELECT Stage FROM jobindex WHERE IDKey='" + JobID + "'";
            TaskCallback call2 = getStage;

            DatabaseFunctions.SendToPhp(false, sql2, call2);
        }
コード例 #25
0
 public Notification_Popup(string labelText, string confirmText, TaskCallback c)
 {
     InitializeComponent();
     this.label.Text      = labelText;
     this.button.Text     = confirmText;
     base.Animation       = new ScaleAnimation();
     this.BackgroundColor = Color.WhiteSmoke;
     this.call            = c;
 }
コード例 #26
0
ファイル: Job_Page.xaml.cs プロジェクト: CH-Aric/CRMDesktop
        public Job_Page(int jobID)
        {
            InitializeComponent();
            JobID = jobID;
            string       sql  = "SELECT * FROM jobfields WHERE JobID='" + JobID + "'";
            TaskCallback call = populateGrid;

            DatabaseFunctions.SendToPhp(false, sql, call);
        }
コード例 #27
0
        public void searchCustomers()
        {
            TaskCallback call2 = populatePage;

            DatabaseFunctions.SendToPhp(false, "SELECT cusindex.Name,cusfields.IDKey AS FID,cusindex.IDKey,cusfields.Value,cusfields.Index FROM cusfields INNER JOIN cusindex ON cusfields.cusID=cusindex.IDKey WHERE cusfields.CusID='" + customer + "' AND cusfields.Index <> 'QUOTEFIELD';", call2);
            TaskCallback call3 = populateQuoteList;

            DatabaseFunctions.SendToPhp(false, "SELECT cusfields.IDKey,cusfields.Value,cusfields.AdvValue FROM cusfields WHERE cusfields.CusID='" + customer + "' AND cusfields.Index='INVOICEFIELD';", call3);
        }
コード例 #28
0
 public static void SendToPhp(bool PBX, string statement, TaskCallback call)
 {
     try
     {
         data d = new data();
         d.df_text1 = statement;
         string requestUriString;
         if (inOffice())
         {
             if (PBX)
             {
                 requestUriString = "http://192.168.0.69/accessPBX.php";
             }
             else
             {
                 requestUriString = "http://192.168.0.69/access.php";
             }
         }
         else
         {
             if (PBX)
             {
                 requestUriString = "http://174.114.166.80/accessPBX.php";
             }
             else
             {
                 requestUriString = "http://174.114.166.80/access.php";
             }
         }
         string         text           = JsonClass.JSONSerialize <DatabaseFunctions.data>(d);
         byte[]         bytes          = Encoding.UTF8.GetBytes(text);
         HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(requestUriString);
         httpWebRequest.Method           = "POST";
         httpWebRequest.ContentType      = "application/x-www-form-urlencoded";
         httpWebRequest.ContentLength    = (long)bytes.Length;
         httpWebRequest.Timeout          = 50000;
         httpWebRequest.ReadWriteTimeout = 50000;
         httpWebRequest.GetRequestStream().Write(bytes, 0, bytes.Length);
         httpWebRequest.KeepAlive = false;
         using (Stream responseStream = ((HttpWebResponse)httpWebRequest.GetResponse()).GetResponseStream())
         {
             StreamReader streamReader = new StreamReader(responseStream);
             String       textOut      = streamReader.ReadToEnd();
             bool         status       = httpWebRequest.HaveResponse;
             call(textOut);
             httpWebRequest.Abort();
             streamReader.Dispose();
             responseStream.Dispose();
         }
     }
     catch (WebException ex)
     {
         string str = ex.ToString();
         Console.WriteLine("--->" + str);
     }
 }
コード例 #29
0
        //任务完成回调
        private void taskFinishCallback()
        {
            this.state = TaskConst.STATE_FINISH;
            TaskCallback callback = TaskExecute.instance.callback;

            if (callback != null)
            {
                callback(this);
            }
        }
コード例 #30
0
        public void onClickedSearch(object sender, EventArgs e)
        {
            string text      = "%" + SearchEntry.Text + "%";
            string statement = "SELECT DISTINCT cusindex.IDKey FROM cusindex INNER JOIN cusfields ON cusindex.IDKey=cusfields.CusID INNER JOIN jobindex ON cusindex.IDKey=jobindex.CusID WHERE (cusfields.Value LIKE '" + text + "' OR cusindex.Name LIKE '" + text + "' OR jobindex.Name LIKE '" + text + "')";

            statement += appendPickerResult();
            TaskCallback call = new TaskCallback(this.PerformSearch);

            DatabaseFunctions.SendToPhp(false, statement, call);
        }
コード例 #31
0
ファイル: Tasks.cs プロジェクト: asiekierka/afCraft
 public static void Add( TaskCallback callback, object param, bool isPriority )
 {
     if( keepGoing ) {
         KeyValuePair<TaskCallback, object> newTask = new KeyValuePair<TaskCallback, object>( callback, param );
         if( isPriority ) {
             lock( priorityQueueLock ) {
                 priorityTasks.Enqueue( newTask );
             }
         } else {
             lock( queueLock ) {
                 tasks.Enqueue( newTask );
             }
         }
     }
 }
コード例 #32
0
ファイル: HttpClientManager.cs プロジェクト: NickBolles/Emby
        private Task<WebResponse> GetResponseAsync(WebRequest request, TimeSpan timeout)
        {
            var taskCompletion = new TaskCompletionSource<WebResponse>();

            Task<WebResponse> asyncTask = Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null);

            ThreadPool.RegisterWaitForSingleObject((asyncTask as IAsyncResult).AsyncWaitHandle, TimeoutCallback, request, timeout, true);
            var callback = new TaskCallback { taskCompletion = taskCompletion };
            asyncTask.ContinueWith(callback.OnSuccess, TaskContinuationOptions.NotOnFaulted);

            // Handle errors
            asyncTask.ContinueWith(callback.OnError, TaskContinuationOptions.OnlyOnFaulted);

            return taskCompletion.Task;
        }
コード例 #33
0
ファイル: SystemCalls.cs プロジェクト: sidecut/xaeios
 public static extern TaskHandle CreateTask(object self, TaskFunction fn, TaskCallback Callback, TaskPriority priority, string name);
コード例 #34
0
ファイル: Server.cs プロジェクト: asiekierka/afCraft
 internal static int AddTask( TaskCallback task, int interval, object param, int delay )
 {
     ScheduledTask newTask = new ScheduledTask();
     newTask.nextTime = DateTime.UtcNow.AddMilliseconds( delay );
     newTask.callback = task;
     newTask.interval = interval;
     newTask.param = param;
     tasks.Add( ++taskIdCounter, newTask );
     UpdateTaskListCache();
     return taskIdCounter;
 }
コード例 #35
0
ファイル: Server.cs プロジェクト: asiekierka/afCraft
 internal static int AddTask( TaskCallback task, int interval, object param )
 {
     return AddTask( task, interval, param, 0 );
 }
コード例 #36
0
ファイル: Server.cs プロジェクト: asiekierka/afCraft
 internal static int AddTask( TaskCallback task, int interval )
 {
     return AddTask( task, interval, null, 0 );
 }
コード例 #37
0
ファイル: SystemCalls.cs プロジェクト: sidecut/xaeios
 public static TaskHandle CreateTask(object self, TaskFunction fn, TaskCallback Callback, TaskPriority priority, string name)
 {
     Task t = new Task(self, fn, Callback, priority, name);
     return var.Cast<int, TaskHandle>(t.Id);
 }