private void te_FlowList_SelectedIndexChanged(object sender, EventArgs e) { if (te_FlowList.SelectedItem == null) { return; } CurrentFlow = te_FlowList.SelectedItem as Biz_FlowProperties; if (CurrentFlow.Status == null) { CurrentFlow.LoadStatus(); } this.gridControl1.BeginUpdate(); this.te_ActionName.EditValue = ""; this.te_ActionTitle.EditValue = ""; this.te_StateName.EditValue = ""; this.te_EndState.EditValue = null; CurrentState = null; CurrentAction = null; this.te_EndState.Properties.Items.Clear(); foreach (Biz_FlowState _st in CurrentFlow.Status) { this.te_EndState.Properties.Items.Add(_st); } this.gridControl2.BeginUpdate(); this.gridControl2.DataSource = null; this.gridControl2.EndUpdate(); this.gridControl1.DataSource = CurrentFlow.Status; this.gridControl1.EndUpdate(); }
private void simpleButton2_Click(object sender, EventArgs e) { //添加动作 if (CurrentState != null) { this.gridControl2.BeginUpdate(); Biz_StateAction _newAction = new Biz_StateAction(Guid.NewGuid().ToString(), CurrentState); this.CurrentState.Actions.Add(_newAction); this.gridControl2.EndUpdate(); } }
private void simpleButton3_Click(object sender, EventArgs e) { //删除动作 int _index = this.gridView2.FocusedRowHandle; if (_index >= 0) { CurrentAction = this.gridView2.GetRow(_index) as Biz_StateAction; this.gridControl2.BeginUpdate(); CurrentAction.DeleteMe(); this.CurrentState.Actions.Remove(CurrentAction); this.gridControl2.DataSource = null; this.gridControl2.DataSource = this.CurrentState.Actions; this.gridControl2.EndUpdate(); } }
private void ShowActionInfo() { //显示动作信息 int _index = this.gridView2.FocusedRowHandle; if (_index >= 0) { CurrentAction = this.gridView2.GetRow(_index) as Biz_StateAction; } else { CurrentAction = null; } if (CurrentAction != null) { this.te_StateName.EditValue = CurrentAction.BeginStateName; this.te_ActionName.EditValue = CurrentAction.ActionName; this.te_ActionTitle.EditValue = CurrentAction.ActionTitle; this.te_EndState.SelectedItem = CurrentFlow.GetStateDefine(CurrentAction.EndState); this.te_Aorder.EditValue = CurrentAction.DisplayOrder; this.te_ActionParam.EditValue = CurrentAction.ParamDefine; for (int i = 0; i < this.te_ATYPE.Properties.Items.Count; i++) { string _s = this.te_ATYPE.Properties.Items[i].ToString(); if (_s == CurrentAction.ActionType) { this.te_ATYPE.SelectedIndex = i; break; } } this.te_UTYPE.SelectedIndex = CurrentAction.UserType; } else { this.te_StateName.EditValue = ""; this.te_ActionName.EditValue = ""; this.te_ActionTitle.EditValue = ""; this.te_EndState.SelectedItem = null; } }