private void btn_salemoney_Click(object sender, EventArgs e) { // Form_SaleMoneyResult FormResult = new Form_SaleMoneyResult(); //if (查询数据库比较存在该日期) // 则执行以下部分在结果框显示结果 // 把查询主窗体的日期信息传给查询的显示结果窗体 FormResult.year = dtp_salemoney.Value.Year.ToString(); FormResult.month = dtp_salemoney.Value.Month.ToString(); FormResult.day = dtp_salemoney.Value.Day.ToString(); FormResult.ShowDialog(this);//用formmain唤醒formresult //else //否则就在提示显示查询日期不存在 //MessageBox.Show("The date you type in isn't existed!"); }
private void btn_salemoney_Click(object sender, EventArgs e) { int year = int.Parse(dtp_salemoney.Value.Year.ToString()); int month = int.Parse(dtp_salemoney.Value.Month.ToString()); int day = int.Parse(dtp_salemoney.Value.Day.ToString()); GoodsInfoStatis GoodsInfo = new GoodsInfoStatis(); GoodsInfo.SalesSpecifyDate(year, month, day, 2); // Form_SaleMoneyResult FormResult = new Form_SaleMoneyResult(); //if (查询数据库比较存在该日期) // 则执行以下部分在结果框显示结果 // 把查询主窗体的日期信息传给查询的显示结果窗体 FormResult.year = dtp_salemoney.Value.Year.ToString(); FormResult.month = dtp_salemoney.Value.Month.ToString(); FormResult.day = dtp_salemoney.Value.Day.ToString(); FormResult.GoodsInfo.GoodsStatInfo = GoodsInfo.GoodsStatInfo; FormResult.ShowDialog(this);//用formmain唤醒formresult //else //否则就在提示显示查询日期不存在 //MessageBox.Show("The date you type in isn't existed!"); }