tijian_jichuang/Code/ShouFei/frmTuanTiDaoJianErTongJi.cs
2025-02-20 11:54:48 +08:00

75 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SOH.Kernel;
using EAS;
using EAS.Services;
using SOH.BLL;
using SOH.Entities.DTO;
using SOH.Data;
using SOH.Entities;
namespace SOH.ShouFei
{
[ModuleAttribute(ModuleID = "FEA4574F-0660-4B5E-A3FF-097C075D751A", ModuleName = "团检单位到检额统计")]
public partial class frmTuanTiDaoJianErTongJi : SOH.Window.baseChildForm
{
Object rq1;
Object rq2;
private DataTable dt;
public FastReport.Report re = new FastReport.Report();
public frmTuanTiDaoJianErTongJi()
{
InitializeComponent();
}
private void frmTuanTiDaoJianErTongJi_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
DateTime date1 = dtptjri1.Value.Date;
DateTime date2 = dateTimePicker1.Value.Date.AddDays(1).AddMilliseconds(-1);
if (DateTime.Compare(date1, date2) > 0)
{
MessageBox.Show("体检日期输入错误!请重新选择!");
return;
}
else
{
rq1 = date1;
rq2 = date2;
}
var vservice = ServiceContainer.GetService<IZongJian>();
DataTable khdt = vservice.GetTkhsByTjrq(rq1, rq2);
if (khdt.Rows.Count != 0)
{
DataTable ttgzbdt = vservice.GetTttgzbsByTjrq(rq1, rq2);
re.Load(System.Windows.Forms.Application.StartupPath + "\\Report\\tjdwdjetjNew1.frx");
re.RegisterData(khdt, "t_khs");
re.RegisterData(ttgzbdt, "t_ttgzbs");
re.Preview = previewControl1;
re.Refresh();
re.Show();
}
else
{
return;
}
}
}
}