public bool InsertOrUpdate(RpcContext[] rpcContexts) { try { foreach (RpcContext item in rpcContexts) { if (item.CalculateType == CalculateType.Aggregate) { Calculate.Calculate calEntity = WindowTaskUtil.GetAggregateCalculate(item.ResultId, item.AggregateCalculateType); TaskManager.AddOrUpdateWindowTask(item.TaskId, item.TaskName, item.IsOpenWindow, item.WindowInterval, item.DelayWindowCount, calEntity); } else if (item.CalculateType == CalculateType.Expression) { Calculate.Calculate calEntity = new ExpressionCalculate(item.ResultId); TaskManager.AddOrUpdateExpressionTask(item.TaskId, item.TaskName, item.ExpressionCalculateType, item.WindowInterval, item.ExpressionScript, calEntity); } } return(true); } catch (Exception ex) { Logger.Log.Error(true, "执行InsertOrUpdate出错", ex); return(false); } }
public bool InsertOrUpdate(RpcContext[] rpcContexts) { try { foreach (RpcContext item in rpcContexts) { if (item.CalculateType == CalculateType.Aggregate) { List <ICalculate> calcs = new List <ICalculate>(); for (int i = 0; i < item.AggregateCalculateTypeList.Length; i++) { string resultId = item.ResultIdList[i]; AggregateCalculateType aggType = item.AggregateCalculateTypeList[i]; Calculate.Calculate calEntity = WindowTaskUtil.GetAggregateCalculate(resultId, aggType); calcs.Add(calEntity); } TaskManager.AddOrUpdateWindowTask(item.TaskId, item.TaskName, item.IsOpenWindow, item.WindowInterval, item.DelayWindowCount, calcs); } else if (item.CalculateType == CalculateType.Expression) { Calculate.Calculate calEntity = new ExpressionCalculate(item.ResultIdList[0]); TaskManager.AddOrUpdateExpressionTask(item.TaskId, item.TaskName, item.ExpressionCalculateType, item.WindowInterval, item.ExpressionScript, new List <ICalculate>() { calEntity }); } } return(true); } catch (Exception ex) { Logger.Log.Error(true, "执行InsertOrUpdate出错", ex); return(false); } }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.calculatemenu = new System.Windows.Forms.Button(); this.cryptomenu = new System.Windows.Forms.Button(); this.networkmenu = new System.Windows.Forms.Button(); this.network1 = new Network.Network(); this.calculate1 = new Calculate.Calculate(); this.crypto1 = new Crypto.Crypto(); this.SuspendLayout(); // // calculatemenu // this.calculatemenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.calculatemenu.Location = new System.Drawing.Point(15, 16); this.calculatemenu.Name = "calculatemenu"; this.calculatemenu.Size = new System.Drawing.Size(87, 38); this.calculatemenu.TabIndex = 0; this.calculatemenu.Text = "Calculate"; this.calculatemenu.UseVisualStyleBackColor = false; this.calculatemenu.Click += new System.EventHandler(this.CalculatemenuClick); // // cryptomenu // this.cryptomenu.BackColor = System.Drawing.Color.MintCream; this.cryptomenu.Location = new System.Drawing.Point(124, 16); this.cryptomenu.Name = "cryptomenu"; this.cryptomenu.Size = new System.Drawing.Size(87, 38); this.cryptomenu.TabIndex = 2; this.cryptomenu.Text = "Crypto"; this.cryptomenu.UseVisualStyleBackColor = false; this.cryptomenu.Click += new System.EventHandler(this.CryptomenuClick); // // networkmenu // this.networkmenu.BackColor = System.Drawing.Color.PaleGoldenrod; this.networkmenu.Location = new System.Drawing.Point(231, 16); this.networkmenu.Name = "networkmenu"; this.networkmenu.Size = new System.Drawing.Size(87, 38); this.networkmenu.TabIndex = 5; this.networkmenu.Text = "Network"; this.networkmenu.UseVisualStyleBackColor = false; this.networkmenu.Click += new System.EventHandler(this.NetworkmenuClick); // // network1 // this.network1.BackColor = System.Drawing.Color.CadetBlue; this.network1.Location = new System.Drawing.Point(26, 90); this.network1.Name = "network1"; this.network1.Size = new System.Drawing.Size(813, 570); this.network1.TabIndex = 7; // // calculate1 // this.calculate1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.calculate1.Location = new System.Drawing.Point(26, 90); this.calculate1.Name = "calculate1"; this.calculate1.Size = new System.Drawing.Size(813, 570); this.calculate1.TabIndex = 8; // // crypto1 // this.crypto1.BackColor = System.Drawing.Color.LightSalmon; this.crypto1.Location = new System.Drawing.Point(26, 90); this.crypto1.Name = "crypto1"; this.crypto1.Size = new System.Drawing.Size(813, 570); this.crypto1.TabIndex = 9; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Bisque; this.ClientSize = new System.Drawing.Size(867, 682); this.Controls.Add(this.crypto1); this.Controls.Add(this.calculate1); this.Controls.Add(this.network1); this.Controls.Add(this.networkmenu); this.Controls.Add(this.cryptomenu); this.Controls.Add(this.calculatemenu); this.Name = "MainForm"; this.Text = "EucliwoodBox"; this.ResumeLayout(false); }