0
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3 using System.ComponentModel;
|
|
4 using System.Data;
|
|
5 using System.Drawing;
|
|
6 using System.Text;
|
|
7 using System.Text.RegularExpressions;
|
|
8 using System.Windows.Forms;
|
|
9 using IBBoard.Lang;
|
|
10 using IBBoard.Windows.Forms;
|
|
11 using IBBoard.Windows.Forms.I18N;
|
|
12
|
|
13 namespace IBBoard.WarFoundry.Forge.WinForms
|
|
14 {
|
|
15 public partial class FrmSystem : IBBoard.Windows.Forms.IBBForm
|
|
16 {
|
|
17 public FrmSystem()
|
|
18 {
|
|
19 InitializeComponent();
|
|
20 }
|
|
21
|
|
22 private void btnSystemClose_Click(object sender, EventArgs e)
|
|
23 {
|
|
24 this.Close();
|
|
25 }
|
|
26
|
|
27 private void btnGenerateSysId_Click(object sender, EventArgs e)
|
|
28 {
|
|
29 string newId = String.Empty;
|
|
30
|
|
31 MatchCollection id_parts = Regex.Matches(this.txtSystemName.Text, @"[A-Z\d]");
|
|
32 foreach(Match part in id_parts)
|
|
33 {
|
|
34 newId += part.ToString();
|
|
35 }
|
|
36
|
|
37 if(newId.Length < 3)
|
|
38 {
|
|
39 newId = this.txtSystemName.Text.ToLower().Replace(" ", "");
|
|
40 }
|
|
41
|
|
42 this.txtSystemId.Text = newId.ToLower();
|
|
43 }
|
|
44 }
|
|
45 }
|