예제 #1
0
파일: Formmain.cs 프로젝트: git-newer/DB
 private void btn_monthsale_Click(object sender, EventArgs e)
 {
     if (tb_type.Text.ToString() == "")
     {
         MessageBox.Show("商品种类不能为空!");
     }
     else
     {
         String          GoodsType = tb_type.Text.ToString();
         int             year      = int.Parse(dtp_monthsale.Value.Year.ToString());
         GoodsInfoStatis GoodsInfo = new GoodsInfoStatis();
         GoodsInfo.SalesForEachMonth(year, GoodsType, 1);
         //
         Form_MonthSaleResult FormResult = new Form_MonthSaleResult();
         //if (查询数据库比较存在该日期)
         //    则执行以下部分在结果框显示结果
         //    把查询主窗体的日期信息传给查询的显示结果窗体
         FormResult.GoodsType = GoodsType;
         FormResult.year      = dtp_monthsale.Value.Year.ToString();
         FormResult.GoodsInfo.goods_month_sales = GoodsInfo.goods_month_sales;
         FormResult.ShowDialog(this);
     }//用formmain唤醒formresult
      //else //否则就在提示显示查询日期不存在
      //MessageBox.Show("The date you type in isn't existed!");
 }
예제 #2
0
        private void btn_monthsale_Click(object sender, EventArgs e)
        {
            //
            Form_MonthSaleResult FormResult = new Form_MonthSaleResult();

            //if (查询数据库比较存在该日期)
            //    则执行以下部分在结果框显示结果
            //    把查询主窗体的日期信息传给查询的显示结果窗体
            FormResult.year = dtp_monthsale.Value.Year.ToString();
            FormResult.ShowDialog(this);//用formmain唤醒formresult
            //else //否则就在提示显示查询日期不存在
            //MessageBox.Show("The date you type in isn't existed!");
        }