Ejemplo n.º 1
0
        private void btn_transform_Click(object sender, EventArgs e)
        {
            if (rtb.Text == "")
            {
                MessageBox.Show("填写本时段数据");
                return;
            }
            if (rtb1.Text != "")
            {
                project project1 = transport(rtb1.Text, "上一时段");
                tb_wz1.Text   = project1.wz.ToString();
                tb_wt1.Text   = project1.wt.ToString();
                tb_sq1.Text   = project1.sq.ToString();
                tb_jp1.Text   = project1.jp.ToString();
                tb_zd1.Text   = project1.zd.ToString();
                tb_qd1.Text   = project1.qudao.ToString();
                tb_hjzx1.Text = project1.hj.ToString();
                tb_yf1.Text   = project1.yf.ToString();
                tb_dkh1.Text  = project1.dkh.ToString();
                tb_zj1.Text   = project1.zj.ToString();
                tb_qt1.Text   = project1.qt.ToString();
                tb_sum1.Text  = project1.sum.ToString();

                project_backup.Set(project1);//备份数据
            }
            else
            {
                project_backup.wz    = Convert.ToInt32(tb_wz1.Text);
                project_backup.wt    = Convert.ToInt32(tb_wt1.Text);
                project_backup.sq    = Convert.ToInt32(tb_sq1.Text);
                project_backup.jp    = Convert.ToInt32(tb_jp1.Text);
                project_backup.zd    = Convert.ToInt32(tb_zd1.Text);
                project_backup.qudao = Convert.ToInt32(tb_qd1.Text);
                project_backup.hj    = Convert.ToInt32(tb_hjzx1.Text);
                project_backup.yf    = Convert.ToInt32(tb_yf1.Text);
                project_backup.dkh   = Convert.ToInt32(tb_dkh1.Text);
                project_backup.zj    = Convert.ToInt32(tb_zj1.Text);
                project_backup.qt    = Convert.ToInt32(tb_qt1.Text);
                project_backup.sum   = Convert.ToInt32(tb_sum1.Text);
            }

            project_now.Set(transport(rtb.Text, "本时段"));
            project project0 = new project();

            project0.Set(project_now);
            project0.Minus(project_backup);
            tb_wz.Text   = project0.wz.ToString();
            tb_wt.Text   = project0.wt.ToString();
            tb_sq.Text   = project0.sq.ToString();
            tb_jp.Text   = project0.jp.ToString();
            tb_zd.Text   = project0.zd.ToString();
            tb_qd.Text   = project0.qudao.ToString();
            tb_hjzx.Text = project0.hj.ToString();
            tb_yf.Text   = project0.yf.ToString();
            tb_dkh.Text  = project0.dkh.ToString();
            tb_zj.Text   = project0.zj.ToString();
            tb_qt.Text   = project0.qt.ToString();
            tb_sum.Text  = project0.sum.ToString();

            firstcopy = true;
            lbt.Text  = "转换成功";
        }