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 ShowState() { if (this.gridView1.FocusedRowHandle >= 0) { CurrentState = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as Biz_FlowState; } else { CurrentState = null; } //显示状态 this.gridControl2.BeginUpdate(); this.gridControl2.DataSource = null; if (CurrentState != null) { if (CurrentState.Actions == null) { CurrentState.LoadActions(); } this.gridControl2.DataSource = CurrentState.Actions; ShowStateData(); ShowActionInfo(); } else { } this.gridControl2.EndUpdate(); }
private void simpleButton1_Click(object sender, EventArgs e) { //保存动作 this.gridControl2.BeginUpdate(); if (CurrentAction == null) { return; } CurrentAction.ActionName = this.te_ActionName.EditValue.ToString(); CurrentAction.ActionTitle = this.te_ActionTitle.EditValue.ToString(); CurrentAction.ActionType = this.te_ATYPE.SelectedItem.ToString(); CurrentAction.UserType = this.te_UTYPE.SelectedIndex; CurrentAction.DisplayOrder = int.Parse(this.te_Aorder.EditValue.ToString()); CurrentAction.ParamDefine = this.te_ActionParam.EditValue.ToString(); if (this.te_EndState.SelectedItem == null) { XtraMessageBox.Show("请输入目标状态!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; //CurrentAction.EndState = null; } else { Biz_FlowState _selectedEndState = this.te_EndState.SelectedItem as Biz_FlowState; CurrentAction.EndState = _selectedEndState.StateDefine; } CurrentAction.Save(); this.gridControl2.EndUpdate(); }
private void gridView1_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) { if (e.FocusedRowHandle >= 0) { CurrentState = this.gridView1.GetRow(e.FocusedRowHandle) as Biz_FlowState; ShowStateData(); } }
private void simpleButton5_Click(object sender, EventArgs e) { //添加状态 this.gridControl1.BeginUpdate(); Biz_FlowState _newState = new Biz_FlowState(Guid.NewGuid().ToString(), CurrentFlow); this.CurrentFlow.Status.Add(_newState); this.gridControl1.DataSource = null; this.gridControl1.DataSource = this.CurrentFlow.Status; this.gridControl1.EndUpdate(); ShowState(); }
private void simpleButton2_Click(object sender, EventArgs e) { if (this.CurrentFlow == null) { XtraMessageBox.Show("请选择一个业务流程!", "系统提示"); } else { this.gridControl1.BeginUpdate(); Biz_FlowState _newState = new Biz_FlowState(Guid.NewGuid().ToString(), CurrentFlow); this.CurrentFlow.Status.Add(_newState); this.gridControl1.EndUpdate(); XtraMessageBox.Show("新状态已创建!", "系统提示"); } }
private void simpleButton3_Click(object sender, EventArgs e) { int _index = this.gridView1.FocusedRowHandle; if (_index >= 0) { CurrentState = this.gridView1.GetRow(_index) as Biz_FlowState; this.gridControl1.BeginUpdate(); CurrentState.DeleteMe(); this.CurrentFlow.Status.Remove(CurrentState); this.gridControl1.DataSource = null; this.gridControl1.DataSource = this.CurrentFlow.Status; this.gridControl1.EndUpdate(); } }