private void btnAdd_Click(object sender, RoutedEventArgs e) { DoTaskRuleDetailEdit edit = new DoTaskRuleDetailEdit(null); edit.SaveDetailClick += (obj, ev) => { BindRuleData(); }; edit.appSystem = appSystem; edit.appModel = appModel; edit.cbModelName.ItemsSource = this.cbModelCode.ItemsSource; edit.cbModelName.SelectedIndex = 0; edit.cbSystemName.ItemsSource = this.cbSystemCode.ItemsSource; edit.cbSystemName.SelectedIndex = 0; edit.Show(); }
private void btnEdit_Click(object sender, RoutedEventArgs e) { if (DoTaskRuleDataGrid.SelectedItems.Count == 1) { PlatformService.T_WF_DOTASKRULE Rule = DoTaskRuleDataGrid.SelectedItem as PlatformService.T_WF_DOTASKRULE; DoTaskRuleDetailEdit edit = new DoTaskRuleDetailEdit(Rule); edit.SaveDetailClick += (obj, ev) => { BindRuleData(); }; edit.appSystem = appSystem; edit.appModel = appModel; edit.cbModelName.ItemsSource = this.cbModelCode.ItemsSource; edit.cbModelName.SelectedIndex = 0; edit.cbSystemName.ItemsSource = this.cbSystemCode.ItemsSource; edit.cbSystemName.SelectedIndex = 0; for (int i = 0; i < edit.cbSystemName.Items.Count(); i++) { if ((edit.cbSystemName.Items[i] as FLOW_MODELDEFINE_T).SYSTEMCODE == Rule.SYSTEMCODE) { edit.cbSystemName.SelectedIndex = i; } } for (int i = 0; i < edit.cbModelName.Items.Count(); i++) { if ((edit.cbModelName.Items[i] as FLOW_MODELDEFINE_T).MODELCODE == Rule.MODELCODE) { edit.cbModelName.SelectedIndex = i; } } edit.Show(); } else if (DoTaskRuleDataGrid.SelectedItems.Count > 1) { ComfirmWindow.ConfirmationBox("提示信息", "只能选择一条需要修改的记录", "确定"); } else { ComfirmWindow.ConfirmationBox("提示信息", "请先选择一条需要修改的记录!", "确定"); } }
private void btnEdit_Click(object sender, RoutedEventArgs e) { if (DoTaskRuleDataGrid.SelectedItems.Count == 1) { PlatformService.T_WF_DOTASKRULE Rule = DoTaskRuleDataGrid.SelectedItem as PlatformService.T_WF_DOTASKRULE; DoTaskRuleDetailEdit edit = new DoTaskRuleDetailEdit(Rule); edit.SaveDetailClick += (obj, ev) => { BindRuleData(); }; edit.appSystem = appSystem; edit.appModel = appModel; edit.cbModelName.ItemsSource = this.cbModelCode.ItemsSource; edit.cbModelName.SelectedIndex = 0; edit.cbSystemName.ItemsSource = this.cbSystemCode.ItemsSource; edit.cbSystemName.SelectedIndex = 0; for (int i = 0; i < edit.cbSystemName.Items.Count(); i++) { if ((edit.cbSystemName.Items[i] as FLOW_MODELDEFINE_T).SYSTEMCODE == Rule.SYSTEMCODE) { edit.cbSystemName.SelectedIndex = i; } } for (int i = 0; i < edit.cbModelName.Items.Count(); i++) { if ((edit.cbModelName.Items[i] as FLOW_MODELDEFINE_T).MODELCODE == Rule.MODELCODE) { edit.cbModelName.SelectedIndex = i; } } edit.Show(); } else if (DoTaskRuleDataGrid.SelectedItems.Count > 1) { ComfirmWindow.ConfirmationBox("提示信息", "只能选择一条需要修改的记录", "确定"); } else { ComfirmWindow.ConfirmationBox("提示信息", "请先选择一条需要修改的记录!", "确定"); } }
private void btnAdd_Click(object sender, RoutedEventArgs e) { DoTaskRuleDetailEdit edit = new DoTaskRuleDetailEdit(null); edit.SaveDetailClick += (obj, ev) => { BindRuleData(); }; edit.appSystem = appSystem; edit.appModel = appModel; edit.cbModelName.ItemsSource = this.cbModelCode.ItemsSource; edit.cbModelName.SelectedIndex = 0; edit.cbSystemName.ItemsSource = this.cbSystemCode.ItemsSource; edit.cbSystemName.SelectedIndex = 0; edit.Show(); }