예제 #1
0
        private void simpleButton1_Click(object sender, System.EventArgs e)
        {
            this.label3.Visible        = true;
            this.simpleButton1.Enabled = false;
            this.Refresh();
            string strmonth = this.comboBox1.Text.Trim();

            if (strmonth == "")
            {
                MessageBox.Show("加裁当前数据月份出错,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            bool flag = ca.AllDataToHis(strmonth, out err);

            if (err != null || !flag)
            {
                MessageBox.Show("转移出错,请重试!\n" + err.ToString(), "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }
            else
            {
                MessageBox.Show("数据转移成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                this.comboBox1.Items.Clear();
                DataTable dtmonth = new DataTable();
                err     = null;
                dtmonth = ca.GetCurrentMonth(out err);
                if (err != null || dtmonth.Rows.Count > 0)
                {
                    this.FillComboBox(this.comboBox1, dtmonth, "curmonth", "");
                }
                else
                {
                    MessageBox.Show("刷新当前数据月份出错,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    this.Close();
                }
                this.label3.Visible        = false;
                this.simpleButton1.Enabled = true;
                this.Refresh();
                return;
            }
        }