Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;//等待
     if (textBox1.Text != string.Empty)
     {
         //loadingPanel1.Visible = true;
         //loadingPanel1.LoadingText = "正在抓取...";
         if (label2.Text == "单号:")
         {
             if (m_dst.MesIntoDD(textBox1.Text))
             {
                 MessageBox.Show("导入成功");
                 //loadingPanel1.Visible = false;
                 this.Cursor = Cursors.Default;
             }
         }
         else if (label2.Text == "日期:")
         {
             if (ValidateDataTime(textBox1.Text))
             {
                 if (m_dst.MesIntoTTM(Convert.ToDateTime(textBox1.Text)))
                 {
                     MessageBox.Show("导入成功");
                     // loadingPanel1.Visible = false;
                     this.Cursor = Cursors.Default;
                 }
             }
             else
             {
                 MessageBox.Show("请输入如期格式 yyyy-mm-dd");
                 textBox1.Text = "";
                 textBox1.Focus();
                 this.Cursor = Cursors.Default;
             }
         }
     }
     else
     {
         MessageBox.Show("请输入单号或日期");
         this.Cursor = Cursors.Default;
     }
 }