void InitTiming() { this.txtTriggerName.Text = Entity.TRIGGERNAME; this.myTime.Value = Entity.TRIGGERTIME; this.myDate.Text = Entity.TRIGGERTIME.ToShortDateString(); if (Entity.TRIGGERTYPE == "User") { rbUser.IsChecked = true; rbSystem.IsChecked = false; } else { rbUser.IsChecked = false; rbSystem.IsChecked = true; } if (Entity.TRIGGERACTIVITYTYPE == 1) { rbSMS.IsChecked = true; rbService.IsChecked = false; } else { rbSMS.IsChecked = false; rbService.IsChecked = true; } for (int i = 0; i < ListCycle.Count; i++) { if (CycleOperate.CycleExchangeTo(ListCycle[i].CycleType) == Entity.TRIGGERROUND) { this.cmbCycle.SelectedIndex = i; } } if (!string.IsNullOrEmpty(Entity.FUNCTIONPARAMTER)) { listpatrm.Clear(); ObservableCollection <Param> Params = ParamOperate.FieldToCollection(Entity.FUNCTIONPARAMTER); if (Params.Count > 0) { foreach (Param p in Params) { listpatrm.Add(p); } } this.txtValue.Text = Params[0].FieldName; RowList.ItemsSource = listpatrm; } }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (txtTriggerName.Text.Trim() == "") { ComfirmWindow.ConfirmationBox("提示信息", "定时触发名称不能为空!", "确定"); return; } FLOW_MODELDEFINE_T system = cmbSystemCode.SelectedItem as FLOW_MODELDEFINE_T; FLOW_MODELDEFINE_T model = cmbModelCode.SelectedItem as FLOW_MODELDEFINE_T; if (system.SYSTEMCODE == "0" || model.MODELCODE == "0") { ComfirmWindow.ConfirmationBox("提示信息", "请正确选择 [系统名称]和[模块名称]!", "确定"); return; } if (myDate.Text == "") { ComfirmWindow.ConfirmationBox("提示信息", "开始时间不能为空!", "确定"); return; } if (ActionType == "0") { #region 新增 Entity = new PlatformService.T_WF_TIMINGTRIGGERACTIVITY(); Entity.TRIGGERID = Guid.NewGuid().ToString(); Entity.TRIGGERNAME = txtTriggerName.Text; Entity.CREATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; Entity.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; Entity.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; Entity.SYSTEMCODE = (this.cmbSystemCode.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMCODE; Entity.SYSTEMNAME = (this.cmbSystemCode.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMNAME; Entity.MODELCODE = (this.cmbModelCode.SelectedItem as FLOW_MODELDEFINE_T).MODELCODE; Entity.MODELNAME = (this.cmbModelCode.SelectedItem as FLOW_MODELDEFINE_T).DESCRIPTION; Entity.TRIGGERROUND = CycleOperate.CycleExchangeTo((this.cmbCycle.SelectedItem as Cycle).CycleType); Entity.CONTRACTTYPE = "Engine"; Entity.TRIGGERTYPE = rbUser.IsChecked == true ? "User" : "System"; Entity.TRIGGERTIME = DateTime.Parse(myDate.Text + " " + myTime.Value.Value.TimeOfDay.ToString()); Entity.TRIGGERACTIVITYTYPE = rbSMS.IsChecked == true ? 1 : 2; Entity.MESSAGEURL = MsgOpen; if (this.txtValue.Text.Trim() != "" && cmbFunc.SelectedIndex > 0) { AppFunc func = cmbFunc.SelectedItem as AppFunc; Entity.FUNCTIONNAME = func.FuncName; Entity.FUNCTIONPARAMTER = ParamOperate.CollectionToString(listpatrm); Entity.WCFURL = func.Address; Entity.WCFBINDINGCONTRACT = func.Binding; Entity.PAMETERSPLITCHAR = func.SplitChar; } else { Entity.FUNCTIONNAME = string.Empty; Entity.FUNCTIONPARAMTER = string.Empty; Entity.WCFURL = string.Empty; Entity.WCFBINDINGCONTRACT = string.Empty; Entity.PAMETERSPLITCHAR = string.Empty; } triggerClient.AddTimingActivityAsync(Entity); #endregion } else { #region 修改 Entity.TRIGGERNAME = txtTriggerName.Text; Entity.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; Entity.SYSTEMCODE = (this.cmbSystemCode.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMCODE; Entity.SYSTEMNAME = (this.cmbSystemCode.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMNAME; Entity.MODELCODE = (this.cmbModelCode.SelectedItem as FLOW_MODELDEFINE_T).MODELCODE; Entity.MODELNAME = (this.cmbModelCode.SelectedItem as FLOW_MODELDEFINE_T).DESCRIPTION; Entity.TRIGGERROUND = CycleOperate.CycleExchangeTo((this.cmbCycle.SelectedItem as Cycle).CycleType); Entity.CONTRACTTYPE = "Engine"; Entity.TRIGGERTYPE = rbUser.IsChecked == true ? "User" : "System"; Entity.TRIGGERTIME = DateTime.Parse(myDate.Text + " " + myTime.Value.Value.TimeOfDay.ToString()); Entity.TRIGGERACTIVITYTYPE = rbSMS.IsChecked == true ? 1 : 2; Entity.MESSAGEURL = MsgOpen; if (this.txtValue.Text.Trim() != "" && cmbFunc.SelectedIndex > 0) { AppFunc func = cmbFunc.SelectedItem as AppFunc; Entity.FUNCTIONNAME = func.FuncName; Entity.FUNCTIONPARAMTER = ParamOperate.CollectionToString(listpatrm); Entity.WCFURL = func.Address; Entity.WCFBINDINGCONTRACT = func.Binding; Entity.PAMETERSPLITCHAR = func.SplitChar; } else { Entity.FUNCTIONNAME = string.Empty; Entity.FUNCTIONPARAMTER = string.Empty; Entity.WCFURL = string.Empty; Entity.WCFBINDINGCONTRACT = string.Empty; Entity.PAMETERSPLITCHAR = string.Empty; } #endregion triggerClient.EditTimingActivityAsync(Entity); } }