private void initForm(EvaluateQuestionInfo info) { if (info != null) { DBModelBase.Clone<EvaluateQuestionInfo>(info, ref newQInfo); qInfo = info; } this.Text += IsNew ? "-新增" : "-修改"; this.Btn_OK.Click += Btn_OK_Click; cbQType.Properties.Items.AddRange(GlobalCaches.Instance.ConstantInfos.Where(e => e.TypeValue == (int)BasicConstantType.QType).ToArray()); txtQDesc.DataBindings.Add("Text", newQInfo, "QDesc"); //txtQLevel.DataBindings.Add("EditValue", newQInfo, "QLevel"); cbQType.SelectedItem = GlobalCaches.Instance.ConstantInfos.FirstOrDefault(e => e.Id == newQInfo.QType); txtQLevel.EditValue = newQInfo.QLevel ?? 100; }
public FmQuestionInfo(EvaluateQuestionInfo info = null) { InitializeComponent(); initForm(info); }