private void button3_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; string ret = null; try { GLClassProcess glpro = new GLClassProcess(); ret = glpro.UpdateAllGLList(DateTime.Today); } catch (Exception ce) { this.Cursor = Cursors.Default; MessageBox.Show(ce.Message); return; } this.Cursor = Cursors.Default; if (ret != null) { MessageBox.Show(ret); return; } MessageBox.Show("Save Success!"); return; }
private void button1_Click(object sender, EventArgs e) { GLClassProcess glpro = new GLClassProcess(); DataTable dt = glpro.getRecords(tCode, DateTime.Today); this.dataGridView1.DataSource = dt; this.dataGridView1.Show(); }
private void btn_savemumber_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; string ret = null; try { GLClassProcess glpro = new GLClassProcess(); ret = glpro.UpdateAllGLNumbers(DateTime.Today); List <GLThreadProcess> threadpool = glpro.CheckPin as List <GLThreadProcess>; List <string> msgs = new List <string>(); while (true) { Thread.Sleep(1000); int endcnt = 0; this.textBox3.Clear(); bool NeedCheck = true; foreach (GLThreadProcess thrd in threadpool) { if (NeedCheck && thrd.Trdobj.ThreadState == ThreadState.Running) { NeedCheck = false; } else { ++endcnt; } if (thrd.CheckPin != null) { msgs.Add(thrd.CheckPin.ToString()); } } if (msgs.ToArray().Length > 15) { this.textBox3.Text = string.Join("\r\n", msgs.ToArray(), msgs.Count - 11, 10); } //this.textBox3.Show(); this.textBox3.Refresh(); if (endcnt == threadpool.Count) { break; } } } catch (Exception ce) { this.Cursor = Cursors.Default; MessageBox.Show(ce.StackTrace); return; } this.Cursor = Cursors.Default; if (ret != null) { MessageBox.Show(ret); return; } MessageBox.Show("Save Success!"); return; }