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

77 lines
2.2 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 = "76CB4603-229F-4444-B72C-4C0EC15FF3B9", ModuleName = "前台每日收费统计")]
public partial class frmQianTaiMeiRiShouFeiTongJj : SOH.Window.baseChildForm
{
Object rq1;
Object rq2;
private DataTable dt;
public FastReport.Report re = new FastReport.Report();
public frmQianTaiMeiRiShouFeiTongJj()
{
InitializeComponent();
}
private void frmQianTaiMeiRiShouFeiTongJj_Load(object sender, EventArgs e)
{
this.cbTjlx.SelectedIndex = 0;
}
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;
}
int tjlx = this.cbTjlx.SelectedIndex;
var vservice = ServiceContainer.GetService<IZongJian>();
string sfdt = vservice.SelMeiRiShouFei(rq1, rq2,tjlx);
dt = Newtonsoft.Json.JsonConvert.DeserializeObject(sfdt, typeof(DataTable)) as DataTable;
if (dt.Rows.Count != 0)
{
re.Load(System.Windows.Forms.Application.StartupPath + "\\Report\\qt_mrsftj.frx");
re.SetParameterValue("dtstart", date1.ToShortDateString());
re.SetParameterValue("dtend", date2.ToShortDateString());
re.RegisterData(dt, "T_drxpjl");
re.Preview = previewControl1;
re.Refresh();
re.Show();
}
else
{
return;
}
}
}
}