예제 #1
0
 private void btnSelStore_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog.ShowDialog() == DialogResult.OK)
     {
         this.txtPathStore.Text = this.openFileDialog.FileName;
         if (Path.GetExtension(this.txtPathStore.Text.Trim()) != ".txt")
         {
             MessageBox.Show("文件格式有误,请选择txt格式文件!", "提示");
             this.txtPathStore.Text = "";
         }
         else
         {
             if (store == null)
             {
                 store = InitStore.CrtStore();
             }
             store.GetStoreFromFile(this.txtPathStore.Text);
             LoadDgv();
             this.dataGridView.DataSource = dtStore;
             this.dataGridView.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
             this.dataGridView.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
             this.labnums.Text = dtStore.Rows.Count.ToString() + "组号码";
             store.ConstStore.Clear();
             Parallel.ForEach(store.Store, item => { store.ConstStore.TryAdd(item.Key, item.Value); });
             MessageBox.Show("分步号码库导入成功!", "提示");
         }
     }
 }
예제 #2
0
 public static Step6 CrtStep6(InitStore initstore)
 {
     if (step6 == null)
     {
         step6 = new Step6();
     }
     else
     {
         step6 = null;
         step6 = new Step6();
     }
     store = initstore;
     return(step6);
 }
예제 #3
0
 public static Step5 CrtStep5(InitStore initstore)
 {
     if (step5 == null)
     {
         step5 = new Step5();
     }
     else
     {
         step5 = null;
         step5 = new Step5();
     }
     store = initstore;
     return(step5);
 }
예제 #4
0
 public static Step4 CrtStep4(InitStore initstore)
 {
     if (step4 == null)
     {
         step4 = new Step4();
     }
     else
     {
         step4 = null;
         step4 = new Step4();
     }
     store = initstore;
     return(step4);
 }
예제 #5
0
 public static InitStore CrtStore()
 {
     if (initstore == null)
     {
         initstore = new InitStore();
     }
     else
     {
         initstore = null;
         initstore = new InitStore();
     }
     initstore.Store       = new ConcurrentDictionary <string, int[]>();
     initstore.ConstStore  = new ConcurrentDictionary <string, int[]>();
     initstore.Store_Step3 = new ConcurrentDictionary <string, int[]>();
     initstore.Store_Step4 = new ConcurrentDictionary <string, int[]>();
     return(initstore);
 }
예제 #6
0
 public static Step3 CrtStep3(InitStore initstore)
 {
     if (step3 == null)
     {
         step3 = new Step3();
     }
     else
     {
         step3 = null;
         step3 = new Step3();
     }
     step3.ComStore15_1 = new ConcurrentDictionary <string, int[]>();
     step3.ComStore15_2 = new ConcurrentDictionary <string, int[]>();
     step3.ComStore15_3 = new ConcurrentDictionary <string, int[]>();
     step3.ComStore15_4 = new ConcurrentDictionary <string, int[]>();
     step3.ComStore15_5 = new ConcurrentDictionary <string, int[]>();
     step3.ComStore15_6 = new ConcurrentDictionary <string, int[]>();
     store = initstore;
     return(step3);
 }
예제 #7
0
 private void btnSel14_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog.ShowDialog() == DialogResult.OK)
     {
         this.txtPath14.Text = this.openFileDialog.FileName;
         if (Path.GetExtension(this.txtPath14.Text.Trim()) != ".txt")
         {
             MessageBox.Show("文件格式有误,请选择txt格式文件!", "提示");
             this.txtPath14.Text = "";
         }
         else
         {
             if (store == null)
             {
                 store = CalculateTool.InitStore.CrtStore();
             }
             this.listBox.Items.Clear();
             string[] nums = store.GetNumsFromFile(this.txtPath14.Text);
             string   temp = "";
             foreach (var num in nums)
             {
                 temp = num.TrimStart();
                 temp = num.TrimEnd();
                 string[] strsno    = temp.Split(' ');
                 string   strlistno = "";
                 for (int i = 0; i < strsno.Length; i++)
                 {
                     if (strsno[i].Length == 1)
                     {
                         strsno[i] = strsno[i].PadLeft(2, '0');
                     }
                     strlistno += strsno[i] + " ";
                 }
                 strlistno = strlistno.Substring(0, strlistno.Length - 1);
                 this.listBox.Items.Add(strlistno);
             }
             this.btnGroup.Enabled = true;
         }
     }
 }
예제 #8
0
 public static Step2 CrtStep2(InitStore initstore)
 {
     if (step2 == null)
     {
         step2 = new Step2();
     }
     else
     {
         step2 = null;
         step2 = new Step2();
     }
     step2.ComStore_225 = new ConcurrentDictionary <string, int[]>();
     step2.ComStore_25  = new ConcurrentDictionary <string, int[]>();
     step2.ComStore_275 = new ConcurrentDictionary <string, int[]>();
     step2.Dt_225       = new DataTable();
     step2.Dt_25        = new DataTable();
     step2.Dt_275       = new DataTable();
     step2.Base_Store   = new ConcurrentDictionary <string, int[]>();
     step2.OrderTables  = new ConcurrentDictionary <int, List <DataTable> >();
     store = initstore;
     return(step2);
 }