private void btnOK_Click(object sender, EventArgs e) { this.id = this.txtId.Text.Trim(); if (this.id.Length == 0) { if (this.itemType == BusinessItemType.Folder) { MessageBoxPLM.Show("请输入文件夹名称。"); } else { MessageBoxPLM.Show("请输入对象的新代号。"); } this.txtId.SelectAll(); } else if (this.id.Length > 0x40) { MessageBoxPLM.Show("代号的长度不能超过64。"); this.txtId.SelectAll(); } else { if (this.itemType != BusinessItemType.Folder) { if (this.cobSecurityLevel.SelectedIndex > -1) { this.securityLevel = Convert.ToInt32(this.cobSecurityLevel.SelectedItem); } else { DEMetaClass class2 = ModelContext.MetaModel.GetClass(this.className); if (class2 != null) { this.securityLevel = class2.SecurityLevel; } else { this.securityLevel = 1; } } if ((this.cobGroup.SelectedItem != null) && (this.cobGroup.SelectedItem is DEOrganization)) { this.groupOid = ((DEOrganization)this.cobGroup.SelectedItem).Oid; } else { this.groupOid = Guid.Empty; } } this.revLabel = this.txtRevLabel.Text.Trim(); this.effway = (this.cobFolderEffWay.SelectedIndex == 0) ? RevisionEffectivityWay.LastRev : RevisionEffectivityWay.PreciseIter; base.DialogResult = DialogResult.OK; } }
public static string GetNewId(string oldId, BusinessItemType itemType, string className, RevisionEffectivityWay oldEff, out string codeId, out RevisionEffectivityWay newEff) { FrmNewID wid = new FrmNewID(oldId, itemType, className) { newId = false }; if (ServiceSwitches.IsTiIntegratorTopMost) { wid.TopMost = true; } wid.effway = oldEff; wid.ShowDialog(); codeId = wid.txtId.Tag as string; newEff = wid.effway; return(wid.id); }