private void SetNextEnableOnThird(object sender, EventArgs args) { ListBox lb = sender as ListBox; if (lb.Items.Contains(RightsText.SignRecords)) { Common.SetControlEnable(this.btnNext, true); Common.SetControlEnable(this.btnBack, true); this.btnSave.Enabled = false; this.form.AcceptButton = this.btnNext; } else { Common.SetControlEnable(this.btnNext, false); Common.SetControlEnable(this.btnBack, true); this.btnSave.Enabled = true; this.btnSave.TabIndex = 0; this.form.AcceptButton = this.btnSave; } UserRight r = dic[WizardName.CreateRight] as UserRight; r.SetValue(); }
/// <summary> /// 前进 /// </summary> private void Next() { switch (STEP) { case Step.first: /*显示第二步policy*/ UserEvent(form, new EventArgs()); if (this.SetUserInfo()) { this.pnShow.Controls.Clear(); //先清空显示panel中的各种控件 if (!flag) //如果不是第一次创建 { UserRight r = dic[WizardName.CreateRight] as UserRight; bool isAdmin = (dic[WizardName.CreateUser] as UserCreate).Group == 1 ? true : false; r.InitRight("", isAdmin); if (isAdmin) { RightEvent(form, null); this.pnShow.Controls.Add(dic[WizardName.CreateMean]); STEP = Step.fourth; } else { this.pnShow.Controls.Add(dic[WizardName.CreateRight]); STEP = Step.third; } } else { this.pnShow.Controls.Add(dic[WizardName.CreatePolicy]); STEP = Step.second; } } else { return; } break; case Step.second: PolicyEvent(form, new EventArgs()); if (this.SetUserPolicy()) { UserRight r = dic[WizardName.CreateRight] as UserRight; bool isAdmin = (dic[WizardName.CreateUser] as UserCreate).Group == 1 ? true : false; r.InitRight("", isAdmin); this.pnShow.Controls.Clear(); //先清空显示panel中的各种控件 if (!isAdmin) { this.pnShow.Controls.Add(dic[WizardName.CreateRight]); STEP = Step.third; } else { RightEvent(form, null); this.pnShow.Controls.Add(dic[WizardName.CreateMean]); STEP = Step.fourth; } } else { return; } break; case Step.third: RightEvent(form, null); if ((dic[WizardName.CreateRight] as UserRight).Right.Contains(RightsText.SignRecords)) { this.pnShow.Controls.Clear(); //先清空显示panel中的各种控件 this.pnShow.Controls.Add(dic[WizardName.CreateMean]); STEP = Step.fourth; } break; } this.WizardStateControl(STEP); }