2655 lines
143 KiB
C#
2655 lines
143 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.Services;
|
|||
|
|
using SOH.BLL;
|
|||
|
|
using SOH.Entities;
|
|||
|
|
using SOH.Data;
|
|||
|
|
using SOH.Common;
|
|||
|
|
using System.Text.RegularExpressions;
|
|||
|
|
using System.Net;
|
|||
|
|
using System.IO;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.Drawing.Imaging;
|
|||
|
|
using System.Web.Services.Description;
|
|||
|
|
using WinForm_Test;
|
|||
|
|
using CYQ.Data;
|
|||
|
|
|
|||
|
|
namespace SOH.KeFu
|
|||
|
|
{
|
|||
|
|
[ModuleAttribute(ModuleID = "918CD8BA-CBDA-47C2-A029-92E294B12A97", ModuleName = "体检状态查询")]
|
|||
|
|
public partial class frmTiJianZhuangTai : SOH.Window.baseChildForm
|
|||
|
|
{
|
|||
|
|
private DataTable dt;
|
|||
|
|
//主检医生
|
|||
|
|
private DataTable dtChiefExaminer;
|
|||
|
|
//检查结果
|
|||
|
|
private DataTable dtExamResult;
|
|||
|
|
//科室结果
|
|||
|
|
private DataTable dtDepResult;
|
|||
|
|
|
|||
|
|
public frmTiJianZhuangTai()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void frmTiJianZhuangTai_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
dgvtjzt.AutoGenerateColumns = false;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btn查询_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (!cbdyri.Checked && !cbhyh.Checked && !cbtjrq.Checked && !cbtjzt.Checked
|
|||
|
|
&& !cbtmh.Checked && !cbttht.Checked && !cbxm.Checked && !cbzjm.Checked && !cbsjh.Checked && !cbsfz.Checked && !cbttvip.Checked)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请选择查询项目!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
String xm = null;
|
|||
|
|
String zjm = null;
|
|||
|
|
String hyh = null;
|
|||
|
|
String tmh = null;
|
|||
|
|
int tjzt = -3;
|
|||
|
|
Object rq1 = null;
|
|||
|
|
Object rq2 = null;
|
|||
|
|
Object dy1 = null;
|
|||
|
|
Object dy2 = null;
|
|||
|
|
String sjh = null;
|
|||
|
|
String sfz = null;
|
|||
|
|
String vip = null;
|
|||
|
|
int ttht = 0;
|
|||
|
|
if (cbxm.Checked)
|
|||
|
|
{
|
|||
|
|
if (tbxxm.Text.Equals(""))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请输入姓名!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
xm = tbxxm.Text;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbzjm.Checked)
|
|||
|
|
{
|
|||
|
|
if (tbxzjm.Text.Equals(""))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请输入助记码!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
zjm = tbxxm.Text;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbsjh.Checked)
|
|||
|
|
{
|
|||
|
|
if (tbxsjh.Text.Equals(""))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请输入手机号!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sjh = tbxsjh.Text;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbhyh.Checked)
|
|||
|
|
{
|
|||
|
|
if (tbxhyh.Text.Equals(""))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请输入会员号!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
hyh = tbxhyh.Text;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbtmh.Checked)
|
|||
|
|
{
|
|||
|
|
if (tbxtmh.Text.Equals(""))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请输入条码号!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
tmh = tbxtmh.Text;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbsfz.Checked)
|
|||
|
|
{
|
|||
|
|
if (tbxsfz.Text.Equals(""))
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请输入身份证!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sfz = tbxsfz.Text;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbtjzt.Checked)
|
|||
|
|
{
|
|||
|
|
string ztz = cbxtjzt.SelectedItem.ToString();
|
|||
|
|
if (ztz == "待查体检")
|
|||
|
|
{
|
|||
|
|
tjzt = -2;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "预约未登记")
|
|||
|
|
{
|
|||
|
|
tjzt = -1;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "未登记")
|
|||
|
|
{
|
|||
|
|
tjzt = 0;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "登记未交费")
|
|||
|
|
{
|
|||
|
|
tjzt = 1;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "正在体检")
|
|||
|
|
{
|
|||
|
|
tjzt = 2;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "加项未交费")
|
|||
|
|
{
|
|||
|
|
tjzt = 3;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "体检结束")
|
|||
|
|
{
|
|||
|
|
tjzt = 4;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "待分析")
|
|||
|
|
{
|
|||
|
|
tjzt = 5;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "待审核")
|
|||
|
|
{
|
|||
|
|
tjzt = 10;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "待打印")
|
|||
|
|
{
|
|||
|
|
tjzt = 6;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "打印完成")
|
|||
|
|
{
|
|||
|
|
tjzt = 7;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "客服交接")
|
|||
|
|
{
|
|||
|
|
tjzt = 8;
|
|||
|
|
}
|
|||
|
|
else if (ztz == "送达客户")
|
|||
|
|
{
|
|||
|
|
tjzt = 9;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
if (cbtjrq.Checked)
|
|||
|
|
{
|
|||
|
|
DateTime date1 = dtptjri1.Value.Date;
|
|||
|
|
DateTime date2 = dtptjrq2.Value.Date.AddDays(1).AddMilliseconds(-1);
|
|||
|
|
if (DateTime.Compare(date1, date2) > 0)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("体检日期输入错误!请重新选择!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
rq1 = date1;
|
|||
|
|
rq2 = date2;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbdyri.Checked)
|
|||
|
|
{
|
|||
|
|
DateTime date1 = dtpdyrq1.Value.Date;
|
|||
|
|
DateTime date2 = dtpdyrq2.Value.Date.AddDays(1).AddMilliseconds(-1);
|
|||
|
|
if (DateTime.Compare(date1, date2) > 0)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("打印日期输入错误!请重新选择!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
dy1 = date1;
|
|||
|
|
dy2 = date2;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbttht.Checked)
|
|||
|
|
{
|
|||
|
|
if (dgvttht.SelectedRows.Count <= 0)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请选择团体合同!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
ttht = Convert.ToInt32(dgvttht.SelectedRows[0].Cells["htbm"].Value.ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (cbttvip.Checked)
|
|||
|
|
{
|
|||
|
|
vip = "是";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
vip = "";
|
|||
|
|
}
|
|||
|
|
var vservice = ServiceContainer.GetService<It_ttgzb>();
|
|||
|
|
String data = vservice.selectTjzt(xm, zjm, Convert.ToInt32(hyh), Convert.ToInt32(tmh), rq1, rq2, dy1, dy2, ttht, tjzt, short.Parse(LoginUser.yydm), sjh, sfz, vip);
|
|||
|
|
dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|||
|
|
Dictionary<string, int> dtcount = new Dictionary<String, int>();
|
|||
|
|
dtcount.Add("0", 0);
|
|||
|
|
dtcount.Add("1", 0);
|
|||
|
|
dtcount.Add("2", 0);
|
|||
|
|
dtcount.Add("3", 0);
|
|||
|
|
dtcount.Add("4", 0);
|
|||
|
|
dtcount.Add("5", 0);
|
|||
|
|
dtcount.Add("6", 0);
|
|||
|
|
dtcount.Add("7", 0);
|
|||
|
|
dtcount.Add("8", 0);
|
|||
|
|
dtcount.Add("9", 0);
|
|||
|
|
dtcount.Add("-1", 0);
|
|||
|
|
dtcount.Add("-2", 0);
|
|||
|
|
dtcount.Add("10", 0);
|
|||
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|||
|
|
{
|
|||
|
|
dtcount[dt.Rows[i]["tmztz"].ToString()] = dtcount[dt.Rows[i]["tmztz"].ToString()] + 1;
|
|||
|
|
}
|
|||
|
|
DataTable countDt = new DataTable();
|
|||
|
|
countDt.Columns.Add("type", typeof(string));
|
|||
|
|
countDt.Columns.Add("count", typeof(string));
|
|||
|
|
countDt.Columns.Add("typeid", typeof(int));
|
|||
|
|
foreach (KeyValuePair<string, int> kv in dtcount)
|
|||
|
|
{
|
|||
|
|
if (kv.Value != 0)
|
|||
|
|
{
|
|||
|
|
DataRow row = countDt.NewRow();
|
|||
|
|
row["type"] = (tjryzt)Convert.ToInt32(kv.Key);
|
|||
|
|
row["count"] = kv.Value;
|
|||
|
|
row["typeid"] = Convert.ToInt32(kv.Key);
|
|||
|
|
countDt.Rows.Add(row);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
dgvtj.DataSource = countDt;
|
|||
|
|
dgvtj.Refresh();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnmhcx_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
var vservice = ServiceContainer.GetService<It_ttgzb>();
|
|||
|
|
String data = vservice.getTthts(tbxttht.Text);
|
|||
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|||
|
|
dgvttht.DataSource = dt;
|
|||
|
|
dgvttht.Refresh();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnxsqb_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
var vservice = ServiceContainer.GetService<It_ttgzb>();
|
|||
|
|
String data = vservice.getTthts("");
|
|||
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|||
|
|
dgvttht.DataSource = dt;
|
|||
|
|
dgvttht.Refresh();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void dgvtj_CellClick(object sender, DataGridViewCellEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.RowIndex > -1)
|
|||
|
|
{
|
|||
|
|
int typeid = Convert.ToInt32(dgvtj.Rows[e.RowIndex].Cells["typeid"].Value.ToString());
|
|||
|
|
DataRow[] rows = dt.Select("tmztz = " + typeid);
|
|||
|
|
DataTable dtNew = dt.Clone();
|
|||
|
|
for (int i = 0; i < rows.Length; i++)
|
|||
|
|
{
|
|||
|
|
dtNew.ImportRow(rows[i]);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
dgvtjzt.DataSource = dtNew;
|
|||
|
|
dgvtjzt.Refresh();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btntjxm_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (dgvtjzt.SelectedRows.Count <= 0)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("请选择要查看的信息!");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
String tm = dgvtjzt.SelectedRows[0].Cells["tmh"].Value.ToString();
|
|||
|
|
var vservice = ServiceContainer.GetService<It_ttgzb>();
|
|||
|
|
String data = vservice.getTjxm(tm);
|
|||
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|||
|
|
frmtijianxiangmu tjxm = new frmtijianxiangmu(dt);
|
|||
|
|
tjxm.Show();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btntjjg_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (dgvtjzt.SelectedRows.Count <= 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
frmtjjg frmtjjg = new frmtjjg(Convert.ToInt32(dgvtjzt.SelectedRows[0].Cells["tmh"].Value));
|
|||
|
|
frmtjjg.ShowDialog();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btndc_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (dgvtjzt.Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
ExcelDC ec = new ExcelDC();
|
|||
|
|
ec.ExportExcel("体检状态", dgvtjzt);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnjjlc_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnpldy_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
private void btnckbg_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (dgvtjzt.SelectedRows.Count <= 0)
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
frmShowBaoGao baogao = new frmShowBaoGao(dgvtjzt.SelectedRows[0].Cells["tmh"].Value.ToString());
|
|||
|
|
baogao.ShowDialog();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnpldc_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
new ExcelDC().ExportExcel("体检客户列表", this.dgvtjzt);
|
|||
|
|
//if (dgvtj.SelectedRows.Count > 0)
|
|||
|
|
//{
|
|||
|
|
// int typeid = Convert.ToInt32(dgvtj.SelectedRows[0].Cells["typeid"].Value.ToString());
|
|||
|
|
// DataRow[] rows = dt.Select("tmztz = " + typeid);
|
|||
|
|
// DataTable dtNew = dt.Clone();
|
|||
|
|
// for (int i = 0; i < rows.Length; i++)
|
|||
|
|
// {
|
|||
|
|
// dtNew.ImportRow(rows[i]);
|
|||
|
|
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// //DataRowView o = dgvRight.Rows[dgvRight.CurrentRow.Index].DataBoundItem as DataRowView;
|
|||
|
|
// frmPiLiangDaoChu fsb = new frmPiLiangDaoChu(dtNew);
|
|||
|
|
// fsb.init();
|
|||
|
|
// fsb.re.Show();
|
|||
|
|
// fsb.ShowDialog();
|
|||
|
|
//}
|
|||
|
|
//else
|
|||
|
|
//{
|
|||
|
|
// frmPiLiangDaoChu fsb = new frmPiLiangDaoChu(dt);
|
|||
|
|
// fsb.init();
|
|||
|
|
// fsb.re.Show();
|
|||
|
|
// fsb.ShowDialog();
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void button1_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (LoginUser.yydm == "1" && LoginUser.username != "admin")
|
|||
|
|
{
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (dgvtj.SelectedRows.Count > 0)
|
|||
|
|
{
|
|||
|
|
int typeid = Convert.ToInt32(dgvtj.SelectedRows[0].Cells["typeid"].Value.ToString());
|
|||
|
|
if (typeid > 4)
|
|||
|
|
{
|
|||
|
|
if (dgvtjzt.SelectedRows.Count > 0)
|
|||
|
|
{
|
|||
|
|
this.labTishi.Visible = true;
|
|||
|
|
foreach (DataGridViewRow dr in dgvtjzt.Rows)
|
|||
|
|
{
|
|||
|
|
frmShowBaoGao fsb = new frmShowBaoGao();
|
|||
|
|
fsb.init(((DataRowView)dr.DataBoundItem).Row[1].ToString(), 0);
|
|||
|
|
fsb.daochu(((DataRowView)dr.DataBoundItem).Row[10].ToString() + " " + ((DataRowView)dr.DataBoundItem).Row[2].ToString());
|
|||
|
|
//fsb.daochuImagePdf(((DataRowView)dr.DataBoundItem).Row[10].ToString() + " " + ((DataRowView)dr.DataBoundItem).Row[2].ToString());
|
|||
|
|
}
|
|||
|
|
this.labTishi.Visible = false;
|
|||
|
|
MessageBox.Show(@"报告导出完成,请到:D:\pdf 下查看。");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnckbg_Click_1(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
DataRowView o = dgvtjzt.Rows[dgvtjzt.CurrentRow.Index].DataBoundItem as DataRowView;
|
|||
|
|
|
|||
|
|
string tm = dgvtjzt.SelectedRows[0].Cells["tmh"].Value.ToString();
|
|||
|
|
|
|||
|
|
frmShowBaoGao fsb = new frmShowBaoGao();
|
|||
|
|
fsb.init(tm, 0);
|
|||
|
|
fsb.re.Show();
|
|||
|
|
fsb.ShowDialog();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void button2_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
/* try
|
|||
|
|
{
|
|||
|
|
var httpUpload = new HttpUpload();
|
|||
|
|
|
|||
|
|
httpUpload.SetFieldValue("pajkKey", "aaa");
|
|||
|
|
httpUpload.SetFieldValue("sign", "aaa");
|
|||
|
|
httpUpload.SetFieldValue("timestamp", "aaa");
|
|||
|
|
|
|||
|
|
string path = @"D:\log.zip";
|
|||
|
|
FileStream fspdf = new FileStream(path, FileMode.Open);
|
|||
|
|
byte[] fileBytepdf = new byte[fspdf.Length];
|
|||
|
|
fspdf.Read(fileBytepdf, 0, fileBytepdf.Length);
|
|||
|
|
fspdf.Close();
|
|||
|
|
var pdfName = path.Substring(path.LastIndexOf("\\") + 1);
|
|||
|
|
httpUpload.SetFieldValue("file", pdfName, "application /octet-stream", fileBytepdf);
|
|||
|
|
string responStr = "";
|
|||
|
|
//string _apiUrl = @"http://localhost:51013/api/AddInfo";
|
|||
|
|
//string _apiUrl = @"https://tj.test.pajk.cn/tj/api/getZip";
|
|||
|
|
string _apiUrl = @"https://tj.jk.cn/tj/api/getZip";
|
|||
|
|
bool suc = httpUpload.Upload(_apiUrl, out responStr);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
throw ex;
|
|||
|
|
}*/
|
|||
|
|
|
|||
|
|
if (dgvtj.SelectedRows.Count > 0)
|
|||
|
|
{
|
|||
|
|
int typeid = Convert.ToInt32(dgvtj.SelectedRows[0].Cells["typeid"].Value.ToString());
|
|||
|
|
if (typeid > 4)
|
|||
|
|
{
|
|||
|
|
if (dgvtjzt.SelectedRows.Count > 0)
|
|||
|
|
{
|
|||
|
|
this.labTishi.Visible = true;
|
|||
|
|
foreach (DataGridViewRow drrr in dgvtjzt.Rows)
|
|||
|
|
{
|
|||
|
|
string tjtmh = ((DataRowView)drrr.DataBoundItem).Row[1].ToString();
|
|||
|
|
|
|||
|
|
Application.DoEvents();
|
|||
|
|
EAS.Loggers.ILogger log = new EAS.Loggers.TextLogger();
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var vkssver = ServiceContainer.GetService<It_ks>();
|
|||
|
|
List<keshi> ccks = vkssver.getccks();
|
|||
|
|
//程序代码
|
|||
|
|
DataTable ccdt = new DataTable();
|
|||
|
|
ccdt.Columns.Add("bt", typeof(string));
|
|||
|
|
ccdt.Columns.Add("sj", typeof(string));
|
|||
|
|
ccdt.Columns.Add("jg", typeof(string));
|
|||
|
|
ccdt.Columns.Add("img", typeof(byte[]));
|
|||
|
|
ccdt.Columns.Add("ksbm", typeof(string));
|
|||
|
|
FastReport.Report re = new FastReport.Report();
|
|||
|
|
re.Load(AppDomain.CurrentDomain.BaseDirectory + "Report\\tjbg.frx");
|
|||
|
|
var itm = 0;
|
|||
|
|
int.TryParse(tjtmh, out itm);
|
|||
|
|
|
|||
|
|
int fddm = 0;
|
|||
|
|
string xm = "";
|
|||
|
|
int xb = 0;
|
|||
|
|
DateTime tjrq;
|
|||
|
|
string sjh = "";
|
|||
|
|
string sfz = "";
|
|||
|
|
string bj = "";
|
|||
|
|
string title = "";
|
|||
|
|
string tcmc = "";
|
|||
|
|
DataTable dt = new DataTable();
|
|||
|
|
var zjbll = ServiceContainer.GetService<IZongJian>();
|
|||
|
|
var grbll = ServiceContainer.GetService<It_grgzb>();
|
|||
|
|
var ttbll = ServiceContainer.GetService<It_ttgzb>();
|
|||
|
|
var tjbll = ServiceContainer.GetService<It_tjjd>();
|
|||
|
|
string grgzbString = grbll.GetGrgzbListByTm(itm);
|
|||
|
|
string ttgzbString = ttbll.GetTtgzbListByTm(itm);
|
|||
|
|
|
|||
|
|
int hyh = 0;
|
|||
|
|
//创建个人report或者团体report
|
|||
|
|
if (grgzbString.Length > 2)
|
|||
|
|
{
|
|||
|
|
bj = "个人体检";
|
|||
|
|
title = "个检";
|
|||
|
|
DataTable grgzbDt = Newtonsoft.Json.JsonConvert.DeserializeObject(grgzbString, typeof(DataTable)) as DataTable;
|
|||
|
|
re.RegisterData(grgzbDt, "xxTable");
|
|||
|
|
hyh = Convert.ToInt32(grgzbDt.Rows[0]["hyh"]);
|
|||
|
|
fddm = Convert.ToInt32(grgzbDt.Rows[0]["fddm"].ToString());
|
|||
|
|
xm = grgzbDt.Rows[0]["xm"].ToString();
|
|||
|
|
sjh = grgzbDt.Rows[0]["dh"].ToString();
|
|||
|
|
sfz = grgzbDt.Rows[0]["sfzh"].ToString();
|
|||
|
|
xb = Convert.ToInt32(grgzbDt.Rows[0]["xb"].ToString());
|
|||
|
|
tjrq = Convert.ToDateTime(grgzbDt.Rows[0]["tjrq"].ToString());
|
|||
|
|
tcmc = zjbll.GetTcByTcbm(1, grgzbDt.Rows[0]["tcbm"].ToString());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
DataTable ttgzbDt = Newtonsoft.Json.JsonConvert.DeserializeObject(ttgzbString, typeof(DataTable)) as DataTable;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
title = zjbll.GetKhmcByHtbm(Convert.ToInt32(ttgzbDt.Rows[0]["htbm"]));
|
|||
|
|
bj = zjbll.GetHtbjByHtbm(Convert.ToInt32(ttgzbDt.Rows[0]["htbm"]));
|
|||
|
|
re.RegisterData(ttgzbDt, "xxTable");
|
|||
|
|
hyh = Convert.ToInt32(ttgzbDt.Rows[0]["hyh"]);
|
|||
|
|
fddm = Convert.ToInt32(ttgzbDt.Rows[0]["fddm"].ToString());
|
|||
|
|
xm = ttgzbDt.Rows[0]["xm"].ToString();
|
|||
|
|
sjh = ttgzbDt.Rows[0]["tel"].ToString();
|
|||
|
|
sfz = ttgzbDt.Rows[0]["sfzh"].ToString();
|
|||
|
|
xb = Convert.ToInt32(ttgzbDt.Rows[0]["xb"].ToString());
|
|||
|
|
tjrq = Convert.ToDateTime(ttgzbDt.Rows[0]["tjrq"].ToString());
|
|||
|
|
tcmc = zjbll.GetTcByTcbm(2, ttgzbDt.Rows[0]["htfzbm"].ToString());
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
re.SetParameterValue("bj", bj);
|
|||
|
|
re.SetParameterValue("title", title);
|
|||
|
|
re.SetParameterValue("sjh", sjh);
|
|||
|
|
|
|||
|
|
#region 创建报告
|
|||
|
|
|
|||
|
|
//创建第一页体检套餐 参数
|
|||
|
|
string getTcStr = ttbll.GetTtTcByTm(itm);
|
|||
|
|
DataTable tcDt = Newtonsoft.Json.JsonConvert.DeserializeObject(getTcStr, typeof(DataTable)) as DataTable;
|
|||
|
|
if (tcDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("tcmc", tcDt.Rows[0]["tcmc"].ToString().Trim());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("tcmc", "");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (fddm == 2)
|
|||
|
|
{
|
|||
|
|
//创建心电图报告
|
|||
|
|
DataTable tjjdImageDt = tjbll.getTjjdImage(itm, 21);
|
|||
|
|
if (tjjdImageDt.Rows.Count != 0 && tjjdImageDt.Rows[0]["image"].ToString().Length > 10)
|
|||
|
|
{
|
|||
|
|
re.RegisterData(tjjdImageDt, "xdtbgDt");
|
|||
|
|
re.SetParameterValue("xdtImageOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("xdtImageOn", "no");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
string hzfxString = zjbll.GetHzfxByTm(itm);
|
|||
|
|
|
|||
|
|
DataTable hzfxDt = Newtonsoft.Json.JsonConvert.DeserializeObject(hzfxString, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
var vserver = ServiceContainer.GetService<IZongJian>();
|
|||
|
|
|
|||
|
|
if (hzfxDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
string lsdt = vserver.GetZjysXm(hzfxDt.Rows[0][4].ToString());
|
|||
|
|
dt = Newtonsoft.Json.JsonConvert.DeserializeObject(lsdt, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
if (dt.Rows.Count == 0)
|
|||
|
|
{
|
|||
|
|
DataTable hzfxImage = new DataTable();
|
|||
|
|
hzfxImage.Columns.Add("xm");
|
|||
|
|
hzfxImage.Columns.Add("czym");
|
|||
|
|
hzfxImage.Columns.Add("image");
|
|||
|
|
re.RegisterData(hzfxImage, "hzfxImage");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
dt.Columns.Add(new DataColumn("image", typeof(byte[])));
|
|||
|
|
foreach (DataRow dr in dt.Rows)
|
|||
|
|
{
|
|||
|
|
if (dr["image1"].ToString() == "")
|
|||
|
|
{
|
|||
|
|
string zdys = dr["xm"].ToString();
|
|||
|
|
Bitmap b = new Bitmap(80, 20);
|
|||
|
|
Graphics g = Graphics.FromImage(b);
|
|||
|
|
g.Clear(Color.White);
|
|||
|
|
|
|||
|
|
g.DrawString(zdys, new Font("宋体", 12), new SolidBrush(Color.Black), new Point(2, 2));
|
|||
|
|
|
|||
|
|
MemoryStream stream = new MemoryStream();
|
|||
|
|
b.Save(stream, ImageFormat.Jpeg);
|
|||
|
|
//输出图片流
|
|||
|
|
//return File(stream.ToArray(), "image/jpeg");
|
|||
|
|
dr["image"] = stream.ToArray();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
byte[] bs = Convert.FromBase64String(dr["image1"].ToString());
|
|||
|
|
dr["image"] = bs;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//byte[] bs = Convert.FromBase64String(tjdr["image1"].ToString());
|
|||
|
|
re.RegisterData(dt, "hzfxImage");
|
|||
|
|
re.RegisterData(hzfxDt, "hzfxTable");
|
|||
|
|
re.SetParameterValue("hzfxOn", "yes");
|
|||
|
|
//查询总检医生中文名称,插入到参数里
|
|||
|
|
|
|||
|
|
|
|||
|
|
re.SetParameterValue("zjys", dt.Rows[0][0].ToString());
|
|||
|
|
re.SetParameterValue("zjysImage", dt.Rows[0][2].ToString());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
/*re.RegisterData("", "hzfxImage");
|
|||
|
|
re.RegisterData("", "hzfxTable");*/
|
|||
|
|
DataTable hzfxImage = new DataTable();
|
|||
|
|
hzfxImage.Columns.Add("xm");
|
|||
|
|
hzfxImage.Columns.Add("czym");
|
|||
|
|
hzfxImage.Columns.Add("image");
|
|||
|
|
re.RegisterData(hzfxImage, "hzfxImage");
|
|||
|
|
re.SetParameterValue("hzfxOn", "no");
|
|||
|
|
re.SetParameterValue("zjys", "");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建体检汇总datatable
|
|||
|
|
string tjhzString = zjbll.GetTjhzByTm(itm, fddm);
|
|||
|
|
DataTable tjhzDt = Newtonsoft.Json.JsonConvert.DeserializeObject(tjhzString, typeof(DataTable)) as DataTable;
|
|||
|
|
int a = 1;
|
|||
|
|
if (tjhzDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
for (int i = 0; i < tjhzDt.Rows.Count; i++)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
tjhzDt.Rows[i]["ksmc"] = a.ToString() + "、" + tjhzDt.Rows[i]["ksmc"].ToString() + ":";
|
|||
|
|
a++;
|
|||
|
|
}
|
|||
|
|
re.RegisterData(tjhzDt, "tjhzTable");
|
|||
|
|
re.SetParameterValue("tjhzOn", "yes");
|
|||
|
|
|
|||
|
|
string explainStr = zjbll.GetExplain(itm, fddm);
|
|||
|
|
if (explainStr.Length > 0)
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("explain", explainStr);
|
|||
|
|
re.SetParameterValue("explainOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("explainOn", "no");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
DataTable tjhzDt2 = new DataTable();
|
|||
|
|
tjhzDt2.Columns.Add("ksmc");
|
|||
|
|
tjhzDt2.Columns.Add("zdjg");
|
|||
|
|
re.RegisterData(tjhzDt2, "tjhzTable");
|
|||
|
|
re.SetParameterValue("tjhzOn", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//查询健康指导
|
|||
|
|
List<int> jbtjlist = zjbll.GetJbtjListByTm(itm);
|
|||
|
|
if (jbtjlist.Count != 0)
|
|||
|
|
{
|
|||
|
|
DataTable jbkDt = new DataTable();
|
|||
|
|
string jbks = zjbll.GetJbkByJbbmToStr(jbtjlist.ToArray());
|
|||
|
|
|
|||
|
|
jbkDt = Newtonsoft.Json.JsonConvert.DeserializeObject(jbks, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
if (jbkDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
re.RegisterData(jbkDt, "jbkDt");
|
|||
|
|
|
|||
|
|
re.SetParameterValue("notjbk", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("notjbk", "no");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("notjbk", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建非化验项目的体检诊断datatable
|
|||
|
|
string tjjdString = zjbll.GetTjjdStringByTm(itm);
|
|||
|
|
|
|||
|
|
DataTable tjjdDt = Newtonsoft.Json.JsonConvert.DeserializeObject(tjjdString, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
tjjdDt.Columns.Add(new DataColumn("image", typeof(byte[])));
|
|||
|
|
|
|||
|
|
foreach (DataRow tjdr in tjjdDt.Rows)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
#region 淄博CT二次审核,报告电子签名
|
|||
|
|
if ("王元玺".Equals(tjdr["czy"].ToString()))
|
|||
|
|
{
|
|||
|
|
if (tjdr["image2"].ToString() == "")
|
|||
|
|
{
|
|||
|
|
string zdys = "王德成/王元玺";
|
|||
|
|
Bitmap b = new Bitmap(80, 20);
|
|||
|
|
Graphics g = Graphics.FromImage(b);
|
|||
|
|
g.Clear(Color.White);
|
|||
|
|
|
|||
|
|
g.DrawString(zdys, new Font("宋体", 12), new SolidBrush(Color.Black), new Point(2, 2));
|
|||
|
|
|
|||
|
|
MemoryStream stream = new MemoryStream();
|
|||
|
|
b.Save(stream, ImageFormat.Jpeg);
|
|||
|
|
//输出图片流
|
|||
|
|
//return File(stream.ToArray(), "image/jpeg");
|
|||
|
|
tjdr["image"] = stream.ToArray();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
byte[] bs = Convert.FromBase64String(tjdr["image2"].ToString());
|
|||
|
|
tjdr["image"] = bs;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
if (tjdr["image1"].ToString() == "")
|
|||
|
|
{
|
|||
|
|
string zdys = tjdr["zdys"].ToString();
|
|||
|
|
Bitmap b = new Bitmap(80, 20);
|
|||
|
|
Graphics g = Graphics.FromImage(b);
|
|||
|
|
g.Clear(Color.White);
|
|||
|
|
|
|||
|
|
g.DrawString(zdys, new Font("宋体", 12), new SolidBrush(Color.Black), new Point(2, 2));
|
|||
|
|
|
|||
|
|
MemoryStream stream = new MemoryStream();
|
|||
|
|
b.Save(stream, ImageFormat.Jpeg);
|
|||
|
|
//输出图片流
|
|||
|
|
//return File(stream.ToArray(), "image/jpeg");
|
|||
|
|
tjdr["image"] = stream.ToArray();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
byte[] bs = Convert.FromBase64String(tjdr["image1"].ToString());
|
|||
|
|
tjdr["image"] = bs;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var ccbg = ServiceContainer.GetService<It_tempdjxm>();
|
|||
|
|
List<t_ccbg> ccbgs = ccbg.getCCBG(0, itm.ToString());
|
|||
|
|
|
|||
|
|
if (tjjdDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
DataView dv = tjjdDt.DefaultView;
|
|||
|
|
dv.Sort = "fxsx Asc";
|
|||
|
|
DataTable tjjdDts = dv.ToTable();
|
|||
|
|
|
|||
|
|
#region
|
|||
|
|
foreach (DataRow dr in tjjdDts.Rows)
|
|||
|
|
{
|
|||
|
|
int ks = int.Parse(dr["ksbm"].ToString());
|
|||
|
|
if (ccbgs.Where(t => t.ksbm == ks).Any())
|
|||
|
|
{
|
|||
|
|
DataRow ccdr = ccdt.NewRow();
|
|||
|
|
ccdr["jg"] = dr["zdjg"];
|
|||
|
|
ccdr["ksbm"] = ks.ToString();
|
|||
|
|
var k = ccks.Where(t => t.ksbm == ks).FirstOrDefault();
|
|||
|
|
if (k != null)
|
|||
|
|
{
|
|||
|
|
ccdr["bt"] = k.bgbt;
|
|||
|
|
}
|
|||
|
|
Bitmap bm = new Bitmap(718, 425);
|
|||
|
|
Graphics g = Graphics.FromImage(bm);
|
|||
|
|
int w = 718;
|
|||
|
|
int h = 425;
|
|||
|
|
g.FillRectangle(Brushes.White, 0, 0, w, h);
|
|||
|
|
var ccksbg = ccbgs.Where(t => t.ksbm == ks).ToList();
|
|||
|
|
if (ccksbg.Count == 1)
|
|||
|
|
{
|
|||
|
|
MemoryStream ms = new MemoryStream(ccksbg[0].image);
|
|||
|
|
Image img = Image.FromStream(ms);
|
|||
|
|
float wb = 1.0f * img.Width / w;
|
|||
|
|
float hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(0, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (ccksbg.Count == 2)
|
|||
|
|
{
|
|||
|
|
MemoryStream ms = new MemoryStream(ccksbg[0].image);
|
|||
|
|
Image img = Image.FromStream(ms);
|
|||
|
|
w = w / 2 - 10;
|
|||
|
|
float wb = 1.0f * img.Width / w;
|
|||
|
|
float hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
ms = new MemoryStream(ccksbg[1].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5 + w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5 + w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (ccksbg.Count == 3)
|
|||
|
|
{
|
|||
|
|
MemoryStream ms = new MemoryStream(ccksbg[0].image);
|
|||
|
|
Image img = Image.FromStream(ms);
|
|||
|
|
w = w / 2 - 10;
|
|||
|
|
h = h / 2 - 10;
|
|||
|
|
float wb = 1.0f * img.Width / w;
|
|||
|
|
float hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
ms = new MemoryStream(ccksbg[1].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5 + w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5 + w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[2].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5 + w / 2, (h - vh) / 2 + h, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w / 2, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5 + w / 2, 0 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w / 2, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (ccksbg.Count == 4)
|
|||
|
|
{
|
|||
|
|
MemoryStream ms = new MemoryStream(ccksbg[0].image);
|
|||
|
|
Image img = Image.FromStream(ms);
|
|||
|
|
w = w / 2 - 10;
|
|||
|
|
h = h / 2 - 10;
|
|||
|
|
float wb = 1.0f * img.Width / w;
|
|||
|
|
float hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
ms = new MemoryStream(ccksbg[1].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(10 + w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 10 + w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[2].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2 + h + 5, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2 + h + 5);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 0 + h + 5, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2 + h + 5);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[3].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2 + h, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 10 + w, 0 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (ccksbg.Count == 5)
|
|||
|
|
{
|
|||
|
|
MemoryStream ms = new MemoryStream(ccksbg[0].image);
|
|||
|
|
Image img = Image.FromStream(ms);
|
|||
|
|
w = w / 3 - 10;
|
|||
|
|
h = h / 2 - 10;
|
|||
|
|
float wb = 1.0f * img.Width / w;
|
|||
|
|
float hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
ms = new MemoryStream(ccksbg[1].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(10 + w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 10 + w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[2].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(15 + 2 * w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 15 + 2 * w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 15 + 2 * w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 15 + 2 * w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[3].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5 + w / 2, (h - vh) / 2 + 5 + h, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w / 2, (h - img.Height) / 2 + 5 + h, w, h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5 + w / 2, 5 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5 + w / 2, (h - img.Height) / 2, w, h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[4].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(10 + w + w / 2, (h - vh) / 2 + h + 5, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w + w / 2, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 10 + w + w / 2, 5 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w + w / 2, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (ccksbg.Count == 6)
|
|||
|
|
{
|
|||
|
|
MemoryStream ms = new MemoryStream(ccksbg[0].image);
|
|||
|
|
Image img = Image.FromStream(ms);
|
|||
|
|
w = w / 3 - 10;
|
|||
|
|
h = h / 2 - 10;
|
|||
|
|
float wb = 1.0f * img.Width / w;
|
|||
|
|
float hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
ms = new MemoryStream(ccksbg[1].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(10 + w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 10 + w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[2].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(15 + 2 * w, (h - vh) / 2, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 15 + 2 * w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 15 + 2 * w, 0, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 15 + 2 * w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[3].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(5, (h - vh) / 2 + 5 + h, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2 + 5 + h, w, h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 5, 5 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 5, (h - img.Height) / 2, w, h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[4].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(10 + w, (h - vh) / 2 + h + 5, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 10 + w, 5 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 10 + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ms = new MemoryStream(ccksbg[5].image);
|
|||
|
|
img = Image.FromStream(ms);
|
|||
|
|
//w = w / 2 - 10;
|
|||
|
|
wb = 1.0f * img.Width / w;
|
|||
|
|
hb = 1.0f * img.Height / h;
|
|||
|
|
if (wb > hb)
|
|||
|
|
{
|
|||
|
|
if (wb > 1)
|
|||
|
|
{
|
|||
|
|
float vh = img.Height / wb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF(15 + w + w, (h - vh) / 2 + h + 5, w, vh));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 15 + w + w, (h - img.Height) / 2 + h);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (hb > 1)
|
|||
|
|
{
|
|||
|
|
float vw = img.Width / hb;
|
|||
|
|
|
|||
|
|
g.DrawImage(img, new RectangleF((w - vw) / 2 + 15 + w + w, 5 + h, vw, h));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
g.DrawImage(img, (w - img.Width) / 2 + 15 + w + w, (h - img.Height) / 2);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
MemoryStream mso = new MemoryStream();
|
|||
|
|
bm.Save(mso, System.Drawing.Imaging.ImageFormat.Jpeg);
|
|||
|
|
ccdr["img"] = mso.ToArray();
|
|||
|
|
ccdt.Rows.Add(ccdr);
|
|||
|
|
}
|
|||
|
|
if (dr["djsj"].ToString().Length > 10)
|
|||
|
|
{
|
|||
|
|
dr["djsj"] = dr["djsj"].ToString().Substring(0, 10);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
re.RegisterData(tjjdDts, "tjjg");
|
|||
|
|
re.SetParameterValue("nothyxmOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//select '' as tm,'' as ksbm,'' as zdjg,'' as zdys,'' as czy,'' as czys,'' as ksmc,'' as bglk,'' as zdmc,'' as shsj,'' as djsj
|
|||
|
|
DataTable tjjdDt2 = new DataTable();
|
|||
|
|
tjjdDt2.Columns.Add("tm");
|
|||
|
|
tjjdDt2.Columns.Add("ksbm");
|
|||
|
|
tjjdDt2.Columns.Add("zdjg");
|
|||
|
|
tjjdDt2.Columns.Add("zdys");
|
|||
|
|
tjjdDt2.Columns.Add("czy");
|
|||
|
|
tjjdDt2.Columns.Add("czys");
|
|||
|
|
tjjdDt2.Columns.Add("ksmc");
|
|||
|
|
tjjdDt2.Columns.Add("bglk");
|
|||
|
|
tjjdDt2.Columns.Add("zdmc");
|
|||
|
|
tjjdDt2.Columns.Add("shsj");
|
|||
|
|
tjjdDt2.Columns.Add("djsj");
|
|||
|
|
tjjdDt2.Columns.Add("fxsx");
|
|||
|
|
re.RegisterData(tjjdDt2, "tjjg");
|
|||
|
|
re.SetParameterValue("nothyxmOn", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建化验项目的体检诊断datatable
|
|||
|
|
string HytjjdString = zjbll.GetHyTjjdStringByTm(itm, fddm);
|
|||
|
|
|
|||
|
|
DataTable HytjjdDt = Newtonsoft.Json.JsonConvert.DeserializeObject(HytjjdString, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
HytjjdDt.Columns.Add(new DataColumn("image", typeof(byte[])));
|
|||
|
|
HytjjdDt.Columns.Add(new DataColumn("imageZdys", typeof(byte[])));
|
|||
|
|
foreach (DataRow hytjdr in HytjjdDt.Rows)
|
|||
|
|
{
|
|||
|
|
string imagezdys = zjbll.GetTjjdZdysStringByXm(hytjdr["zdys"].ToString()).ToString();
|
|||
|
|
|
|||
|
|
DataTable HytjjdZdysDt = Newtonsoft.Json.JsonConvert.DeserializeObject(imagezdys, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
if (hytjdr["image1"].ToString() == "")
|
|||
|
|
{
|
|||
|
|
string zdys = hytjdr["zdys"].ToString();
|
|||
|
|
Bitmap b = new Bitmap(80, 20);
|
|||
|
|
Graphics g = Graphics.FromImage(b);
|
|||
|
|
g.Clear(Color.White);
|
|||
|
|
|
|||
|
|
g.DrawString(zdys, new Font("宋体", 12), new SolidBrush(Color.Black), new Point(2, 2));
|
|||
|
|
|
|||
|
|
MemoryStream stream = new MemoryStream();
|
|||
|
|
b.Save(stream, ImageFormat.Jpeg);
|
|||
|
|
//输出图片流
|
|||
|
|
//return File(stream.ToArray(), "image/jpeg");
|
|||
|
|
hytjdr["image"] = stream.ToArray();
|
|||
|
|
//byte[] bs2 = Convert.FromBase64String(ServiceContainer.GetService<IZongJian>().GetTjjdZdysStringByXm(hytjdr["zdys"].ToString()).ToString());
|
|||
|
|
//hytjdr["image"] = bs2;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
byte[] bs = Convert.FromBase64String(hytjdr["image1"].ToString());
|
|||
|
|
hytjdr["image"] = bs;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (HytjjdZdysDt.Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
if (!string.IsNullOrEmpty(HytjjdZdysDt.Rows[0]["imageZdys"].ToString()))
|
|||
|
|
{
|
|||
|
|
byte[] bs1 = Convert.FromBase64String(HytjjdZdysDt.Rows[0]["imageZdys"].ToString());
|
|||
|
|
hytjdr["imageZdys"] = bs1;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
string zdys = hytjdr["zdys"].ToString();
|
|||
|
|
Bitmap b = new Bitmap(80, 20);
|
|||
|
|
Graphics g = Graphics.FromImage(b);
|
|||
|
|
g.Clear(Color.White);
|
|||
|
|
|
|||
|
|
g.DrawString(zdys, new Font("宋体", 12), new SolidBrush(Color.Black), new Point(2, 2));
|
|||
|
|
|
|||
|
|
MemoryStream stream = new MemoryStream();
|
|||
|
|
b.Save(stream, ImageFormat.Jpeg);
|
|||
|
|
//输出图片流
|
|||
|
|
//return File(stream.ToArray(), "image/jpeg");
|
|||
|
|
hytjdr["imageZdys"] = stream.ToArray();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
string zdys = hytjdr["zdys"].ToString();
|
|||
|
|
Bitmap b = new Bitmap(80, 20);
|
|||
|
|
Graphics g = Graphics.FromImage(b);
|
|||
|
|
g.Clear(Color.White);
|
|||
|
|
|
|||
|
|
g.DrawString(zdys, new Font("宋体", 12), new SolidBrush(Color.Black), new Point(2, 2));
|
|||
|
|
|
|||
|
|
MemoryStream stream = new MemoryStream();
|
|||
|
|
b.Save(stream, ImageFormat.Jpeg);
|
|||
|
|
//输出图片流
|
|||
|
|
//return File(stream.ToArray(), "image/jpeg");
|
|||
|
|
hytjdr["imageZdys"] = stream.ToArray();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (HytjjdDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
DataView dv1 = HytjjdDt.DefaultView;
|
|||
|
|
dv1.Sort = "fxsx Asc";
|
|||
|
|
DataTable HytjjdDts = dv1.ToTable();
|
|||
|
|
|
|||
|
|
foreach (DataRow dr in HytjjdDts.Rows)
|
|||
|
|
{
|
|||
|
|
if (dr["djsj"].ToString().Length > 10)
|
|||
|
|
{
|
|||
|
|
dr["djsj"] = dr["djsj"].ToString().Substring(0, 10);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
re.RegisterData(HytjjdDts, "hytjjg");
|
|||
|
|
re.SetParameterValue("hyxmOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//select '' as tm,'' as ksbm,'' as zdjg,'' as zdys,'' as czy,'' as czys,'' as ksmc,'' as bglk,'' as zdmc,'' as djsj
|
|||
|
|
DataTable HytjjdDt2 = new DataTable();
|
|||
|
|
HytjjdDt2.Columns.Add("tm");
|
|||
|
|
HytjjdDt2.Columns.Add("ksbm");
|
|||
|
|
HytjjdDt2.Columns.Add("zdjg");
|
|||
|
|
HytjjdDt2.Columns.Add("zdys");
|
|||
|
|
HytjjdDt2.Columns.Add("czy");
|
|||
|
|
HytjjdDt2.Columns.Add("czys");
|
|||
|
|
HytjjdDt2.Columns.Add("ksmc");
|
|||
|
|
HytjjdDt2.Columns.Add("bglk");
|
|||
|
|
HytjjdDt2.Columns.Add("zdmc");
|
|||
|
|
HytjjdDt2.Columns.Add("djsj");
|
|||
|
|
HytjjdDt2.Columns.Add("fxsx");
|
|||
|
|
HytjjdDt2.Columns.Add("image");
|
|||
|
|
HytjjdDt2.Columns.Add("imageZdys");
|
|||
|
|
re.RegisterData(HytjjdDt2, "hytjjg");
|
|||
|
|
re.SetParameterValue("hyxmOn", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建非化验项目的体检结果datatable
|
|||
|
|
string tjjgString = zjbll.GetTjjgStringByTm(itm, xb);
|
|||
|
|
|
|||
|
|
DataTable tjjgDt = Newtonsoft.Json.JsonConvert.DeserializeObject(tjjgString, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (tjjgDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
DataView dv2 = tjjgDt.DefaultView;
|
|||
|
|
dv2.Sort = "fxsx,xssx Asc";
|
|||
|
|
DataTable tjjgDts = dv2.ToTable();
|
|||
|
|
foreach (DataRow dr in tjjgDts.Rows)
|
|||
|
|
{
|
|||
|
|
#region 异常指标颜色修改逻辑
|
|||
|
|
if (!string.IsNullOrEmpty(dr["jg"].ToString()))
|
|||
|
|
{
|
|||
|
|
if (!dr["cksx"].ToString().Trim().Equals("-1") && !dr["cksx"].ToString().Trim().Equals("-2"))
|
|||
|
|
{
|
|||
|
|
if (double.TryParse(dr["jg"].ToString().Trim(), out double result))
|
|||
|
|
{
|
|||
|
|
if (double.Parse(dr["ckxx"].ToString().Trim()) < double.Parse(dr["jg"].ToString().Trim()) &&
|
|||
|
|
double.Parse(dr["cksx"].ToString().Trim()) > double.Parse(dr["jg"].ToString().Trim()))
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
dr["jg"] = dr["jg"].ToString() + "@";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (!dr["zcjg"].ToString().Trim().Equals(dr["jg"].ToString().Trim()))
|
|||
|
|
{
|
|||
|
|
dr["jg"] = dr["jg"].ToString() + "@";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (!dr["cksx"].ToString().Trim().Equals("-2"))
|
|||
|
|
{
|
|||
|
|
if (!dr["zcjg"].ToString().Trim().Equals(dr["jg"].ToString().Trim()))
|
|||
|
|
{
|
|||
|
|
dr["jg"] = dr["jg"].ToString() + "@";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
DataRow[] drs = ccdt.Select("ksbm='" + dr["ksbm"].ToString() + "'");
|
|||
|
|
if (drs.Count() > 0)
|
|||
|
|
{
|
|||
|
|
drs[0]["sj"] = drs[0]["sj"] + "\r\n" + dr["jg"].ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
re.RegisterData(tjjgDts, "tjjgmx");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//select '' as jcxmmc,'' as ksbm,'' as cksx,'' as ckxx,'' as dw,'' as jc,'' as dyckfw,'' as jg
|
|||
|
|
DataTable tjjgDt2 = new DataTable();
|
|||
|
|
tjjgDt2.Columns.Add("jcxmmc");
|
|||
|
|
tjjgDt2.Columns.Add("ksbm");
|
|||
|
|
tjjgDt2.Columns.Add("cksx");
|
|||
|
|
tjjgDt2.Columns.Add("ckxx");
|
|||
|
|
tjjgDt2.Columns.Add("dw");
|
|||
|
|
tjjgDt2.Columns.Add("jc");
|
|||
|
|
tjjgDt2.Columns.Add("dyckfw");
|
|||
|
|
tjjgDt2.Columns.Add("jg");
|
|||
|
|
tjjgDt2.Columns.Add("fxsx");
|
|||
|
|
tjjgDt2.Columns.Add("xssx");
|
|||
|
|
re.RegisterData(tjjgDt2, "tjjgmx");
|
|||
|
|
re.SetParameterValue("nothyxmOn", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建外送金域的体检结果datatable
|
|||
|
|
string tjjgWSString = ServiceContainer.GetService<IZongJian>().GetTjjgWSStringByTm(itm, xb);
|
|||
|
|
|
|||
|
|
DataTable tjjgWSDt = Newtonsoft.Json.JsonConvert.DeserializeObject(tjjgWSString, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (tjjgWSDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
DataView dvWS = tjjgWSDt.DefaultView;
|
|||
|
|
|
|||
|
|
dvWS.Sort = "fxsx,xssx Asc";
|
|||
|
|
DataTable tjjgWSDts = dvWS.ToTable();
|
|||
|
|
//foreach (DataRow dr in tjjgWSDts.Rows)
|
|||
|
|
//{
|
|||
|
|
// DataRow[] drs = ccdt.Select("ksbm='" + dr["ksbm"].ToString() + "'");
|
|||
|
|
// if (drs.Count() > 0)
|
|||
|
|
// {
|
|||
|
|
// drs[0]["sj"] = drs[0]["sj"] + "\r\n" + dr["jg"].ToString();
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
re.RegisterData(tjjgWSDts, "tjjgWSmx");
|
|||
|
|
re.SetParameterValue("notwsxmOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//select '' as jcxmmc,'' as ksbm,'' as cksx,'' as ckxx,'' as dw,'' as jc,'' as dyckfw,'' as jg
|
|||
|
|
DataTable tjjgWSDt2 = new DataTable();
|
|||
|
|
tjjgWSDt2.Columns.Add("jcxmmc");
|
|||
|
|
tjjgWSDt2.Columns.Add("ksbm");
|
|||
|
|
tjjgWSDt2.Columns.Add("cksx");
|
|||
|
|
tjjgWSDt2.Columns.Add("ckxx");
|
|||
|
|
tjjgWSDt2.Columns.Add("dw");
|
|||
|
|
tjjgWSDt2.Columns.Add("jc");
|
|||
|
|
tjjgWSDt2.Columns.Add("dyckfw");
|
|||
|
|
tjjgWSDt2.Columns.Add("jg");
|
|||
|
|
tjjgWSDt2.Columns.Add("fxsx");
|
|||
|
|
tjjgWSDt2.Columns.Add("xssx");
|
|||
|
|
re.RegisterData(tjjgWSDt2, "tjjgWSmx");
|
|||
|
|
re.SetParameterValue("notwsxmOn", "no");
|
|||
|
|
}
|
|||
|
|
re.RegisterData(ccdt, "ccbg");
|
|||
|
|
|
|||
|
|
//创建化验项目的体检结果datatable
|
|||
|
|
string HytjjgString = zjbll.GetHyTjjgStringByTm(itm, fddm, xb);
|
|||
|
|
|
|||
|
|
DataTable HytjjgDt = Newtonsoft.Json.JsonConvert.DeserializeObject(HytjjgString, typeof(DataTable)) as DataTable;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (HytjjgDt.Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
DataView dv3 = HytjjgDt.DefaultView;
|
|||
|
|
dv3.Sort = "fxsx,xssx Asc";
|
|||
|
|
DataTable HytjjgDts = dv3.ToTable();
|
|||
|
|
|
|||
|
|
foreach (DataRow dr in HytjjgDts.Rows)
|
|||
|
|
{
|
|||
|
|
double jg = 0;
|
|||
|
|
double cksx = 0;
|
|||
|
|
double ckxx = 0;
|
|||
|
|
if (double.TryParse(dr["jg"].ToString(), out jg) && double.TryParse(dr["cksx"].ToString(), out cksx) && double.TryParse(dr["ckxx"].ToString(), out ckxx))
|
|||
|
|
{
|
|||
|
|
if (jg < ckxx)
|
|||
|
|
dr["bz"] = "↓";
|
|||
|
|
else if (jg > cksx)
|
|||
|
|
dr["bz"] = "↑";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
re.RegisterData(HytjjgDts, "hytjjgmx");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
HytjjgDt = new DataTable();
|
|||
|
|
//select '' as jcxmmc,'' as ksbm,'' as cksx,'' as ckxx,'' as dw,'' as jc,'' as dyckfw,'' as jg
|
|||
|
|
HytjjgDt.Columns.Add("jcxmmc");
|
|||
|
|
HytjjgDt.Columns.Add("ksbm");
|
|||
|
|
HytjjgDt.Columns.Add("cksx");
|
|||
|
|
HytjjgDt.Columns.Add("ckxx");
|
|||
|
|
HytjjgDt.Columns.Add("dw");
|
|||
|
|
HytjjgDt.Columns.Add("jc");
|
|||
|
|
HytjjgDt.Columns.Add("dyckfw");
|
|||
|
|
HytjjgDt.Columns.Add("jg");
|
|||
|
|
HytjjgDt.Columns.Add("bz");
|
|||
|
|
HytjjgDt.Columns.Add("fxsx");
|
|||
|
|
HytjjgDt.Columns.Add("xssx");
|
|||
|
|
re.RegisterData(HytjjgDt, "hytjjgmx");
|
|||
|
|
re.SetParameterValue("hyxmOn", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建放弃表的datatable
|
|||
|
|
string fqString = zjbll.GetFqStringByTm(itm);
|
|||
|
|
|
|||
|
|
if (fqString.Length > 2)
|
|||
|
|
{
|
|||
|
|
DataTable fqDt = Newtonsoft.Json.JsonConvert.DeserializeObject(fqString, typeof(DataTable)) as DataTable;
|
|||
|
|
re.RegisterData(fqDt, "fqTable");
|
|||
|
|
re.SetParameterValue("fqOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//re.RegisterData(fqDt, "fqTable");
|
|||
|
|
re.SetParameterValue("fqOn", "no");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//创建历史结果对比
|
|||
|
|
DataTable hisDt;
|
|||
|
|
int[] array = (int[])zjbll.GetHisTmList(hyh);
|
|||
|
|
if (array.Length > 1)
|
|||
|
|
{
|
|||
|
|
hisDt = Newtonsoft.Json.JsonConvert.DeserializeObject(ServiceContainer.GetService<IZongJian>().GetHisTable(array), typeof(DataTable)) as DataTable;
|
|||
|
|
if (hisDt.Rows.Count == 0)
|
|||
|
|
{
|
|||
|
|
hisDt = new DataTable();
|
|||
|
|
hisDt.Columns.Add("ksmc");
|
|||
|
|
hisDt.Columns.Add("kszd");
|
|||
|
|
hisDt.Columns.Add("tjrq");
|
|||
|
|
}
|
|||
|
|
re.RegisterData(hisDt, "t_lndb");
|
|||
|
|
if (fddm == 1)
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("hisfxOn", "no");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("hisfxOn", "yes");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (sfz != "")
|
|||
|
|
{
|
|||
|
|
int[] array1 = (int[])ServiceContainer.GetService<IZongJian>().GetHisTmListBySfz(sfz, xm);
|
|||
|
|
if (array1.Length > 1)
|
|||
|
|
{
|
|||
|
|
hisDt = Newtonsoft.Json.JsonConvert.DeserializeObject(ServiceContainer.GetService<IZongJian>().GetHisTable(array1), typeof(DataTable)) as DataTable;
|
|||
|
|
re.RegisterData(hisDt, "t_lndb");
|
|||
|
|
if (fddm == 1)
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("hisfxOn", "no");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("hisfxOn", "yes");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
hisDt = new DataTable();
|
|||
|
|
hisDt.Columns.Add("ksmc");
|
|||
|
|
hisDt.Columns.Add("kszd");
|
|||
|
|
hisDt.Columns.Add("tjrq");
|
|||
|
|
re.RegisterData(hisDt, "t_lndb");
|
|||
|
|
re.SetParameterValue("hisfxOn", "no");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
hisDt = new DataTable();
|
|||
|
|
hisDt.Columns.Add("ksmc");
|
|||
|
|
hisDt.Columns.Add("kszd");
|
|||
|
|
hisDt.Columns.Add("tjrq");
|
|||
|
|
re.RegisterData(hisDt, "t_lndb");
|
|||
|
|
re.SetParameterValue("hisfxOn", "no");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (ccdt.Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("ccImageOn", "yes");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
re.SetParameterValue("ccImageOn", "no");
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
re.RegisterData(ccdt, "ccbg");
|
|||
|
|
//txt_log.Text = "获取报告数据成功!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
//re.Preview = previewControl1;
|
|||
|
|
//re.Show();
|
|||
|
|
TianRui.FuWuSoapClient fw = new TianRui.FuWuSoapClient();
|
|||
|
|
if (string.IsNullOrEmpty(sjh) || sjh.Length != 11)
|
|||
|
|
{
|
|||
|
|
//return;
|
|||
|
|
string xxx = "客户报告上传失败(手机号为空):条码号:" + tjtmh;
|
|||
|
|
log.Info(xxx);
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.IsNullOrEmpty(sfz) || sfz.Trim().Length != 18)
|
|||
|
|
{
|
|||
|
|
//return;
|
|||
|
|
string xxxxx = "客户报告上传失败(身份证号不正确):条码号:" + tjtmh;
|
|||
|
|
log.Info(xxxxx);
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
//txt_log.Text = "连接服务成功!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
var hyjg = fw.CreateHuiYuan(xm, sjh.Trim(), sfz.Trim(), xb);
|
|||
|
|
if (hyjg.State == 0)
|
|||
|
|
{
|
|||
|
|
string xxxx = "客户报告上传失败(会员创建失败):条码号:" + tjtmh + ",姓名:" + xm + "手机号:" + sjh + ",身份证:" + sfz;
|
|||
|
|
log.Info(xxxx);
|
|||
|
|
//return;
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//txt_log.Text = "创建会员成功!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
string newhy = hyjg.Message;
|
|||
|
|
log.Info(hyjg.Tag);
|
|||
|
|
var hy = Newtonsoft.Json.JsonConvert.DeserializeObject<SOH.TJX.Model.HuiYuan>(hyjg.Tag);
|
|||
|
|
var bg = fw.CreateBaoGao(hy.id, tcmc, tjrq, fddm, tjtmh);
|
|||
|
|
FastReport.Export.Image.ImageExport imgreport = new FastReport.Export.Image.ImageExport();
|
|||
|
|
//FastReport.Export.Pdf.PDFExport pdfe = new FastReport.Export.Pdf.PDFExport();
|
|||
|
|
//pdfe.PageRange = FastReport.PageRange.All;
|
|||
|
|
|
|||
|
|
imgreport.PageRange = FastReport.PageRange.All;
|
|||
|
|
imgreport.ImageFormat = FastReport.Export.Image.ImageExportFormat.Jpeg;
|
|||
|
|
imgreport.MultiFrameTiff = true;
|
|||
|
|
imgreport.Resolution = 96;
|
|||
|
|
imgreport.JpegQuality = 100;
|
|||
|
|
string path = System.IO.Path.GetTempPath();
|
|||
|
|
path += bg.Message + "\\";
|
|||
|
|
|
|||
|
|
if (!Directory.Exists(path))
|
|||
|
|
{
|
|||
|
|
Directory.CreateDirectory(path);
|
|||
|
|
}
|
|||
|
|
string dir = path;
|
|||
|
|
re.Prepare();
|
|||
|
|
re.Export(imgreport, path + "lsb.jpg");
|
|||
|
|
|
|||
|
|
//re.Export(pdfe, "");
|
|||
|
|
//txt_log.Text = "导出报告成功!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
int z = 0;
|
|||
|
|
Console.WriteLine(path);
|
|||
|
|
while (true)
|
|||
|
|
{
|
|||
|
|
++z;
|
|||
|
|
//string path = "";
|
|||
|
|
if (z == 1)
|
|||
|
|
{
|
|||
|
|
path = dir + "lsb.jpg";
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
path = string.Format(dir + "lsb.{0}.jpg", z);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (System.IO.File.Exists(path))
|
|||
|
|
{
|
|||
|
|
//txt_log.Text = "开始上传报告" + path + "!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
int h = 0;
|
|||
|
|
while (true)
|
|||
|
|
{
|
|||
|
|
if (h > 10)
|
|||
|
|
break;
|
|||
|
|
h++;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
FileStream fs = new FileInfo(path).OpenRead();
|
|||
|
|
byte[] bts = new byte[fs.Length];
|
|||
|
|
fs.Read(bts, 0, (int)fs.Length);
|
|||
|
|
fs.Close();
|
|||
|
|
fw.TianJiaBaoGaoMingXi(int.Parse(bg.Message), z, bts);
|
|||
|
|
File.Delete(path);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Console.WriteLine(ex.Message);
|
|||
|
|
Console.WriteLine(ex.StackTrace);
|
|||
|
|
EAS.Loggers.ILogger log1 = new EAS.Loggers.TextLogger();
|
|||
|
|
log1.Info(ex.Message);
|
|||
|
|
log1.Info(ex.StackTrace);
|
|||
|
|
//txt_log.Text = ex.Message + "!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
path = string.Format(dir + "lsb.{0}.jpg", z.ToString("00"));
|
|||
|
|
if (System.IO.File.Exists(path))
|
|||
|
|
{
|
|||
|
|
//txt_log.Text = "开始上传报告" + path + "!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
int h = 0;
|
|||
|
|
while (true)
|
|||
|
|
{
|
|||
|
|
if (h > 10)
|
|||
|
|
break;
|
|||
|
|
h++;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
FileStream fs = new FileInfo(path).OpenRead();
|
|||
|
|
byte[] bts = new byte[fs.Length];
|
|||
|
|
fs.Read(bts, 0, (int)fs.Length);
|
|||
|
|
fs.Close();
|
|||
|
|
fw.TianJiaBaoGaoMingXi(int.Parse(bg.Message), z, bts);
|
|||
|
|
File.Delete(path);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Console.WriteLine(ex.Message);
|
|||
|
|
Console.WriteLine(ex.StackTrace);
|
|||
|
|
EAS.Loggers.ILogger log2 = new EAS.Loggers.TextLogger();
|
|||
|
|
log2.Info(ex.Message);
|
|||
|
|
log2.Info(ex.StackTrace);
|
|||
|
|
//txt_log.Text = ex.Message + "!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Console.WriteLine(path);
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
Directory.Delete(dir);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
Console.WriteLine(dir);
|
|||
|
|
|
|||
|
|
Console.WriteLine(ex.Message);
|
|||
|
|
//txt_log.Text = ex.Message + "!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
}
|
|||
|
|
//txt_log.Text = "上传报告完成!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
/* string xx = "尊敬的会员" + hy.XingMing + "您好,您" + tjrq.ToString("yyyy-MM-dd") + "体检报告已生成,个检请在3个工作日后到店领取,团检请等待单位统一派发,也可登录网站或天瑞体检微信小程序查看。http://t.cn/RtJhnGK";
|
|||
|
|
if (newhy == "1")
|
|||
|
|
{
|
|||
|
|
xx += "你的登录名:" + hy.ShouJiHao + ",密码为手机号的后8位。";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}*/
|
|||
|
|
string xx = "客户报告重新上传成功:" + hy.XingMing + ",条码号:" + tjtmh;
|
|||
|
|
log.Info(hy.ShouJiHao);
|
|||
|
|
log.Info(xx);
|
|||
|
|
//xx += "【天瑞体检】";
|
|||
|
|
//fw.SendMsg(hy.ShouJiHao, xx, fddm);
|
|||
|
|
//fw.Close();
|
|||
|
|
//txt_log.Text = "发送短信成功!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
|
|||
|
|
//gvHYXX.Rows.RemoveAt(uu);
|
|||
|
|
//uu--;
|
|||
|
|
}
|
|||
|
|
catch (Exception sbex)
|
|||
|
|
{
|
|||
|
|
Console.WriteLine(sbex.Message);
|
|||
|
|
Console.WriteLine(sbex.StackTrace);
|
|||
|
|
|
|||
|
|
log.Info(sbex.Message);
|
|||
|
|
log.Info(sbex.StackTrace);
|
|||
|
|
//txt_log.Text = sbex.Message + "!\r\n" + txt_log.Text;
|
|||
|
|
Application.DoEvents();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/*frmShowBaoGao fsb = new frmShowBaoGao();
|
|||
|
|
fsb.init(((DataRowView)dr.DataBoundItem).Row[1].ToString(), 0);
|
|||
|
|
fsb.daochu(((DataRowView)dr.DataBoundItem).Row[10].ToString() + " " + ((DataRowView)dr.DataBoundItem).Row[2].ToString());*/
|
|||
|
|
//fsb.daochuImagePdf(((DataRowView)dr.DataBoundItem).Row[10].ToString() + " " + ((DataRowView)dr.DataBoundItem).Row[2].ToString());
|
|||
|
|
}
|
|||
|
|
this.labTishi.Visible = false;
|
|||
|
|
MessageBox.Show(@"报告上传完成。");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 导出体检结果,excel形式,需上传到冠新系统
|
|||
|
|
/// 2023-09-25 xulu 添加方法
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void button3_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
DataTable dtResult = new DataTable();
|
|||
|
|
frmWaitingBox f = new frmWaitingBox((obj, args) =>
|
|||
|
|
{
|
|||
|
|
dtResult.Columns.Add("姓名", typeof(string));
|
|||
|
|
dtResult.Columns.Add("身份证号", typeof(string));
|
|||
|
|
dtResult.Columns.Add("体检时间", typeof(string));
|
|||
|
|
dtResult.Columns.Add("体检年龄", typeof(string));
|
|||
|
|
dtResult.Columns.Add("性别", typeof(string));
|
|||
|
|
dtResult.Columns.Add("出生日期", typeof(string));
|
|||
|
|
dtResult.Columns.Add("联系电话", typeof(string));
|
|||
|
|
dtResult.Columns.Add("户籍住址", typeof(string));
|
|||
|
|
dtResult.Columns.Add("所属卫生室", typeof(string));
|
|||
|
|
dtResult.Columns.Add("责任医生", typeof(string));
|
|||
|
|
dtResult.Columns.Add("主要症状", typeof(string));
|
|||
|
|
dtResult.Columns.Add("症状其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("体温", typeof(string));
|
|||
|
|
dtResult.Columns.Add("脉率", typeof(string));
|
|||
|
|
dtResult.Columns.Add("呼吸频率", typeof(string));
|
|||
|
|
dtResult.Columns.Add("左侧舒张压", typeof(string));
|
|||
|
|
dtResult.Columns.Add("左侧收缩压", typeof(string));
|
|||
|
|
dtResult.Columns.Add("右侧舒张压", typeof(string));
|
|||
|
|
dtResult.Columns.Add("右侧收缩压", typeof(string));
|
|||
|
|
dtResult.Columns.Add("身高", typeof(string));
|
|||
|
|
dtResult.Columns.Add("体重", typeof(string));
|
|||
|
|
dtResult.Columns.Add("腰围", typeof(string));
|
|||
|
|
dtResult.Columns.Add("体质指数", typeof(string));
|
|||
|
|
dtResult.Columns.Add("老年人健康评估", typeof(string));
|
|||
|
|
dtResult.Columns.Add("老年人自理评估", typeof(string));
|
|||
|
|
dtResult.Columns.Add("老年人认知", typeof(string));
|
|||
|
|
dtResult.Columns.Add("老年人情感", typeof(string));
|
|||
|
|
dtResult.Columns.Add("老年人认知分数", typeof(string));
|
|||
|
|
dtResult.Columns.Add("老年人情感分数", typeof(string));
|
|||
|
|
dtResult.Columns.Add("锻炼频率", typeof(string));
|
|||
|
|
dtResult.Columns.Add("每次锻炼时间", typeof(string));
|
|||
|
|
dtResult.Columns.Add("坚持锻炼时间", typeof(string));
|
|||
|
|
dtResult.Columns.Add("锻炼方式", typeof(string));
|
|||
|
|
dtResult.Columns.Add("饮食习惯", typeof(string));
|
|||
|
|
dtResult.Columns.Add("吸烟状况", typeof(string));
|
|||
|
|
dtResult.Columns.Add("日吸烟量", typeof(string));
|
|||
|
|
dtResult.Columns.Add("开始吸烟年龄", typeof(string));
|
|||
|
|
dtResult.Columns.Add("戒烟年龄", typeof(string));
|
|||
|
|
dtResult.Columns.Add("饮酒频率", typeof(string));
|
|||
|
|
dtResult.Columns.Add("日饮酒量", typeof(string));
|
|||
|
|
dtResult.Columns.Add("是否戒酒", typeof(string));
|
|||
|
|
dtResult.Columns.Add("戒酒年龄", typeof(string));
|
|||
|
|
dtResult.Columns.Add("开始饮酒年龄", typeof(string));
|
|||
|
|
dtResult.Columns.Add("近一年是否醉酒", typeof(string));
|
|||
|
|
dtResult.Columns.Add("饮酒种类", typeof(string));
|
|||
|
|
dtResult.Columns.Add("饮酒种类其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("有无职业病史", typeof(string));
|
|||
|
|
dtResult.Columns.Add("具体职业", typeof(string));
|
|||
|
|
dtResult.Columns.Add("从业时间", typeof(string));
|
|||
|
|
dtResult.Columns.Add("粉尘", typeof(string));
|
|||
|
|
dtResult.Columns.Add("粉尘防护措施有无", typeof(string));
|
|||
|
|
dtResult.Columns.Add("粉尘防护措施", typeof(string));
|
|||
|
|
dtResult.Columns.Add("放射物质", typeof(string));
|
|||
|
|
dtResult.Columns.Add("放射防护措施有无", typeof(string));
|
|||
|
|
dtResult.Columns.Add("放射防护措施", typeof(string));
|
|||
|
|
dtResult.Columns.Add("物理因素", typeof(string));
|
|||
|
|
dtResult.Columns.Add("物理防护措施有无", typeof(string));
|
|||
|
|
dtResult.Columns.Add("物理防护措施", typeof(string));
|
|||
|
|
dtResult.Columns.Add("化学物质", typeof(string));
|
|||
|
|
dtResult.Columns.Add("化学防护措施有无", typeof(string));
|
|||
|
|
dtResult.Columns.Add("化学防护措施", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他因素", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他防护措施有无", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他防护措施", typeof(string));
|
|||
|
|
dtResult.Columns.Add("口唇", typeof(string));
|
|||
|
|
dtResult.Columns.Add("齿列", typeof(string));
|
|||
|
|
dtResult.Columns.Add("缺齿", typeof(string));
|
|||
|
|
dtResult.Columns.Add("龋齿", typeof(string));
|
|||
|
|
dtResult.Columns.Add("义齿", typeof(string));
|
|||
|
|
dtResult.Columns.Add("咽部", typeof(string));
|
|||
|
|
dtResult.Columns.Add("左眼视力", typeof(string));
|
|||
|
|
dtResult.Columns.Add("右眼视力", typeof(string));
|
|||
|
|
dtResult.Columns.Add("左眼矫正视力", typeof(string));
|
|||
|
|
dtResult.Columns.Add("右眼矫正视力", typeof(string));
|
|||
|
|
dtResult.Columns.Add("听力", typeof(string));
|
|||
|
|
dtResult.Columns.Add("运动功能", typeof(string));
|
|||
|
|
dtResult.Columns.Add("眼底", typeof(string));
|
|||
|
|
dtResult.Columns.Add("眼底异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("皮肤", typeof(string));
|
|||
|
|
dtResult.Columns.Add("皮肤其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("巩膜", typeof(string));
|
|||
|
|
dtResult.Columns.Add("巩膜其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("淋巴结", typeof(string));
|
|||
|
|
dtResult.Columns.Add("淋巴结其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("桶状胸", typeof(string));
|
|||
|
|
dtResult.Columns.Add("呼吸音", typeof(string));
|
|||
|
|
dtResult.Columns.Add("呼吸音异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("罗音", typeof(string));
|
|||
|
|
dtResult.Columns.Add("罗音异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("心率", typeof(string));
|
|||
|
|
dtResult.Columns.Add("心律", typeof(string));
|
|||
|
|
dtResult.Columns.Add("杂音", typeof(string));
|
|||
|
|
dtResult.Columns.Add("杂音其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("压痛", typeof(string));
|
|||
|
|
dtResult.Columns.Add("压痛其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("包块", typeof(string));
|
|||
|
|
dtResult.Columns.Add("包块其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("肝大", typeof(string));
|
|||
|
|
dtResult.Columns.Add("肝大其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("脾大", typeof(string));
|
|||
|
|
dtResult.Columns.Add("脾大其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("移动性浊音", typeof(string));
|
|||
|
|
dtResult.Columns.Add("移动性浊音其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("下肢水肿", typeof(string));
|
|||
|
|
dtResult.Columns.Add("足背动脉搏动", typeof(string));
|
|||
|
|
dtResult.Columns.Add("肛门指诊", typeof(string));
|
|||
|
|
dtResult.Columns.Add("肛门指诊其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("乳腺", typeof(string));
|
|||
|
|
dtResult.Columns.Add("乳腺其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("外阴", typeof(string));
|
|||
|
|
dtResult.Columns.Add("外阴异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("阴道", typeof(string));
|
|||
|
|
dtResult.Columns.Add("阴道异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("宫颈", typeof(string));
|
|||
|
|
dtResult.Columns.Add("宫颈异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("宫体", typeof(string));
|
|||
|
|
dtResult.Columns.Add("宫体异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("附件", typeof(string));
|
|||
|
|
dtResult.Columns.Add("附件异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("查体其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血型ABO", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血型RH", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血红蛋白", typeof(string));
|
|||
|
|
dtResult.Columns.Add("白细胞", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血小板", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血常规其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("尿蛋白", typeof(string));
|
|||
|
|
dtResult.Columns.Add("尿糖", typeof(string));
|
|||
|
|
dtResult.Columns.Add("尿酮体", typeof(string));
|
|||
|
|
dtResult.Columns.Add("尿潜血", typeof(string));
|
|||
|
|
dtResult.Columns.Add("尿常规其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("空腹血糖", typeof(string));
|
|||
|
|
dtResult.Columns.Add("同型半胱氨酸", typeof(string));
|
|||
|
|
dtResult.Columns.Add("尿微量白蛋白", typeof(string));
|
|||
|
|
dtResult.Columns.Add("大便潜血", typeof(string));
|
|||
|
|
dtResult.Columns.Add("糖化血红蛋白", typeof(string));
|
|||
|
|
dtResult.Columns.Add("乙肝表面抗原", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血清谷丙转氨酶", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血清谷草转氨酶", typeof(string));
|
|||
|
|
dtResult.Columns.Add("白蛋白", typeof(string));
|
|||
|
|
dtResult.Columns.Add("总胆红素", typeof(string));
|
|||
|
|
dtResult.Columns.Add("结合胆红素", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血清肌酐", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血尿素氮", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血钾浓度", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血钠浓度", typeof(string));
|
|||
|
|
dtResult.Columns.Add("总胆固醇", typeof(string));
|
|||
|
|
dtResult.Columns.Add("甘油三酯", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血清低密度脂蛋白胆固醇", typeof(string));
|
|||
|
|
dtResult.Columns.Add("血清高密度脂蛋白胆固醇", typeof(string));
|
|||
|
|
dtResult.Columns.Add("心电图", typeof(string));
|
|||
|
|
dtResult.Columns.Add("心电图异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("腹部B超", typeof(string));
|
|||
|
|
dtResult.Columns.Add("腹部B超异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他B超", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他B超异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("胸部X线片", typeof(string));
|
|||
|
|
dtResult.Columns.Add("胸部X线片异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("宫颈涂片", typeof(string));
|
|||
|
|
dtResult.Columns.Add("宫颈涂片异常", typeof(string));
|
|||
|
|
dtResult.Columns.Add("辅助检查其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("脑血管疾病", typeof(string));
|
|||
|
|
dtResult.Columns.Add("脑血管疾病其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("肾脏疾病", typeof(string));
|
|||
|
|
dtResult.Columns.Add("肾脏疾病其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("心血管疾病", typeof(string));
|
|||
|
|
dtResult.Columns.Add("心血管疾病其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("眼部疾病", typeof(string));
|
|||
|
|
dtResult.Columns.Add("眼部疾病其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("神经系统疾病", typeof(string));
|
|||
|
|
dtResult.Columns.Add("神经系统疾病其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他系统疾病", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他系统疾病其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("健康评价", typeof(string));
|
|||
|
|
dtResult.Columns.Add("异常1", typeof(string));
|
|||
|
|
dtResult.Columns.Add("异常2", typeof(string));
|
|||
|
|
dtResult.Columns.Add("异常3", typeof(string));
|
|||
|
|
dtResult.Columns.Add("异常4", typeof(string));
|
|||
|
|
dtResult.Columns.Add("健康指导", typeof(string));
|
|||
|
|
dtResult.Columns.Add("危险因素控制", typeof(string));
|
|||
|
|
dtResult.Columns.Add("减体重", typeof(string));
|
|||
|
|
dtResult.Columns.Add("建议接种疫苗", typeof(string));
|
|||
|
|
dtResult.Columns.Add("其他", typeof(string));
|
|||
|
|
dtResult.Columns.Add("结核病筛查", typeof(string));
|
|||
|
|
|
|||
|
|
string strTm = "";
|
|||
|
|
for (int i = 0; i < dgvtjzt.Rows.Count; i++)
|
|||
|
|
{
|
|||
|
|
strTm += dgvtjzt.Rows[i].Cells["tmh"].Value + ",";
|
|||
|
|
}
|
|||
|
|
strTm = strTm.Substring(0, strTm.Length - 1);
|
|||
|
|
//获取主检医生姓名
|
|||
|
|
var zjbll = ServiceContainer.GetService<IZongJian>();
|
|||
|
|
dtChiefExaminer = zjbll.GetChiefExaminerByTm(strTm);
|
|||
|
|
|
|||
|
|
//CYQ.Data.Log.WriteLogToTxt("开始获取体检人员信息及检查结果");
|
|||
|
|
//获取体检人员信息及检查结果
|
|||
|
|
//dtExamResult = zjbll.GetPersonInfoAndResultByTm(strTm);
|
|||
|
|
string sql = "select t_ttgzb.tm,xm,sfzh,tjrq,nl,t_ttgzb.xb,csrq,tel,jcxmmc,jg from t_ttgzb,t_tjjg,t_jcxm "
|
|||
|
|
+ "where t_tjjg.tm in (" + strTm + ") and t_jcxm.jcxmbm = t_tjjg.xmbm and t_ttgzb.tm = t_tjjg.tm order by xm";
|
|||
|
|
//DataTable dt = db.DataAccessor.QueryDataTable(sql);
|
|||
|
|
//Log.WriteLogToTxt(sql);
|
|||
|
|
MProc proc = new MProc(sql);
|
|||
|
|
dtExamResult = proc.ExeMDataTable().ToDataTable();
|
|||
|
|
//CYQ.Data.Log.WriteLogToTxt("完成获取体检人员信息及检查结果");
|
|||
|
|
|
|||
|
|
//获取体检人员的科室检查结果--血常规、尿常规、腹部彩超等需要此项结果
|
|||
|
|
dtDepResult = zjbll.GetDepResultByTm(strTm);
|
|||
|
|
|
|||
|
|
for (int i = 0; i < dgvtjzt.Rows.Count; i++)
|
|||
|
|
{
|
|||
|
|
string strTmh = dgvtjzt.Rows[i].Cells["tmh"].Value.ToString();
|
|||
|
|
DataRow dr = dtResult.NewRow();
|
|||
|
|
|
|||
|
|
dr["姓名"] = dgvtjzt.Rows[i].Cells["xm"].Value.ToString();
|
|||
|
|
dr["身份证号"] = dgvtjzt.Rows[i].Cells["sfzh"].Value.ToString() + "\t";
|
|||
|
|
dr["体检时间"] = dgvtjzt.Rows[i].Cells["jcrqdyri"].Value.ToString();
|
|||
|
|
dr["体检年龄"] = dgvtjzt.Rows[i].Cells["nl"].Value.ToString();
|
|||
|
|
dr["性别"] = dgvtjzt.Rows[i].Cells["xb"].Value.ToString();
|
|||
|
|
string birthday = "";
|
|||
|
|
string strIDCard = dgvtjzt.Rows[i].Cells["sfzh"].Value.ToString();
|
|||
|
|
//处理18位的身份证号码从号码中得到生日和性别代码
|
|||
|
|
if (strIDCard.Length == 18)
|
|||
|
|
{
|
|||
|
|
birthday = strIDCard.Substring(6, 4) + "-" + strIDCard.Substring(10, 2) + "-" + strIDCard.Substring(12, 2);
|
|||
|
|
}
|
|||
|
|
//处理15位的身份证号码从号码中得到生日和性别代码
|
|||
|
|
if (strIDCard.Length == 15)
|
|||
|
|
{
|
|||
|
|
birthday = "19" + strIDCard.Substring(6, 2) + "-" + strIDCard.Substring(8, 2) + "-" + strIDCard.Substring(10, 2);
|
|||
|
|
}
|
|||
|
|
dr["出生日期"] = birthday;
|
|||
|
|
dr["联系电话"] = dgvtjzt.Rows[i].Cells["lxdh"].Value.ToString();
|
|||
|
|
dr["户籍住址"] = dgvtjzt.Rows[i].Cells["zz"].Value.ToString();
|
|||
|
|
dr["所属卫生室"] = "二机床职工医院";
|
|||
|
|
DataRow drDoctor = dtChiefExaminer.Select("tm=" + strTmh).FirstOrDefault();
|
|||
|
|
if (drDoctor != null)
|
|||
|
|
{
|
|||
|
|
dr["责任医生"] = drDoctor["xm"];
|
|||
|
|
}
|
|||
|
|
dr["脉率"] = GetResult(strTmh, "心率");
|
|||
|
|
dr["左侧舒张压"] = GetResult(strTmh, "血压(舒张压)");
|
|||
|
|
dr["左侧收缩压"] = GetResult(strTmh, "血压(收缩压)");
|
|||
|
|
dr["右侧舒张压"] = GetResult(strTmh, "血压(舒张压)");
|
|||
|
|
dr["右侧收缩压"] = GetResult(strTmh, "血压(收缩压)");
|
|||
|
|
dr["身高"] = GetResult(strTmh, "身高");
|
|||
|
|
dr["体重"] = GetResult(strTmh, "体重");
|
|||
|
|
dr["腰围"] = GetResult(strTmh, "腹围");
|
|||
|
|
dr["体质指数"] = GetResult(strTmh, "体重指数");
|
|||
|
|
dr["锻炼频率"] = GetResult(strTmh, "锻炼情况");
|
|||
|
|
dr["饮食习惯"] = GetResult(strTmh, "饮食情况");
|
|||
|
|
dr["吸烟状况"] = GetResult(strTmh, "吸烟史", 1);
|
|||
|
|
dr["饮酒频率"] = GetResult(strTmh, "饮酒史");
|
|||
|
|
dr["左眼视力"] = GetResult(strTmh, "视力(裸)左");
|
|||
|
|
dr["右眼视力"] = GetResult(strTmh, "视力(裸)右");
|
|||
|
|
dr["左眼矫正视力"] = GetResult(strTmh, "矫正视力(左)");
|
|||
|
|
dr["右眼矫正视力"] = GetResult(strTmh, "矫正视力(右)");
|
|||
|
|
dr["听力"] = GetResult(strTmh, "听力");
|
|||
|
|
dr["眼底"] = GetResult(strTmh, "眼底");
|
|||
|
|
dr["皮肤"] = GetResult(strTmh, "皮肤");
|
|||
|
|
dr["巩膜"] = GetResult(strTmh, "巩膜");
|
|||
|
|
dr["淋巴结"] = GetResult(strTmh, "浅表淋巴结");
|
|||
|
|
dr["心率"] = GetResult(strTmh, "心率");
|
|||
|
|
dr["心律"] = GetResult(strTmh, "心律");
|
|||
|
|
dr["包块"] = GetResult(strTmh, "颈部包块彩超");
|
|||
|
|
dr["肝大"] = GetResult(strTmh, "肝");
|
|||
|
|
dr["脾大"] = GetResult(strTmh, "脾");
|
|||
|
|
dr["足背动脉搏动"] = GetResult(strTmh, "左足背动脉血流速度");
|
|||
|
|
dr["肛门指诊"] = GetResult(strTmh, "肛门、直肠指诊");
|
|||
|
|
dr["乳腺"] = GetResult(strTmh, "乳腺");
|
|||
|
|
dr["外阴"] = GetResult(strTmh, "外阴");
|
|||
|
|
dr["阴道"] = GetResult(strTmh, "阴道");
|
|||
|
|
dr["宫颈"] = GetResult(strTmh, "子宫颈");
|
|||
|
|
dr["宫体"] = GetResult(strTmh, "子宫体");
|
|||
|
|
dr["附件"] = GetResult(strTmh, "附件");
|
|||
|
|
dr["血型ABO"] = GetResult(strTmh, "血型(ABO正反型)");
|
|||
|
|
dr["血型RH"] = GetResult(strTmh, "RH血型");
|
|||
|
|
dr["血红蛋白"] = GetResult(strTmh, "血红蛋白");
|
|||
|
|
dr["白细胞"] = GetResult(strTmh, "白细胞");
|
|||
|
|
dr["血小板"] = GetResult(strTmh, "血小板");
|
|||
|
|
dr["尿蛋白"] = GetResult(strTmh, "蛋白质(PRO)");
|
|||
|
|
dr["尿糖"] = GetResult(strTmh, "葡萄糖(GLU)");
|
|||
|
|
dr["尿酮体"] = GetResult(strTmh, "尿酮体");
|
|||
|
|
dr["空腹血糖"] = GetResult(strTmh, "空腹血葡萄糖");
|
|||
|
|
dr["同型半胱氨酸"] = GetResult(strTmh, "同型半胱氨酸");
|
|||
|
|
dr["尿微量白蛋白"] = GetResult(strTmh, "尿微量白蛋白");
|
|||
|
|
dr["大便潜血"] = GetResult(strTmh, "大便潜血");
|
|||
|
|
dr["糖化血红蛋白"] = GetResult(strTmh, "改进糖化血红蛋白A1c(NGSP)");
|
|||
|
|
dr["乙肝表面抗原"] = GetResult(strTmh, "乙肝表面抗原", 1);
|
|||
|
|
dr["血清谷丙转氨酶"] = GetResult(strTmh, "丙氨酸氨基转移酶");
|
|||
|
|
dr["血清谷草转氨酶"] = GetResult(strTmh, "天门冬氨酸氨基转移酶");
|
|||
|
|
dr["白蛋白"] = GetResult(strTmh, "白蛋白");
|
|||
|
|
dr["总胆红素"] = GetResult(strTmh, "总胆红素");
|
|||
|
|
dr["血清肌酐"] = GetResult(strTmh, "肌酐");
|
|||
|
|
dr["血钾浓度"] = GetResult(strTmh, "钾", 1);
|
|||
|
|
dr["血钠浓度"] = GetResult(strTmh, "钠", 1);
|
|||
|
|
dr["总胆固醇"] = GetResult(strTmh, "总胆固醇");
|
|||
|
|
dr["甘油三酯"] = GetResult(strTmh, "甘油三酯");
|
|||
|
|
dr["血清低密度脂蛋白胆固醇"] = GetResult(strTmh, "低密度脂蛋白胆固醇");
|
|||
|
|
dr["血清高密度脂蛋白胆固醇"] = GetResult(strTmh, "高密度脂蛋白胆固醇");
|
|||
|
|
dr["心电图"] = GetResult(strTmh, "心电图");
|
|||
|
|
dr["胸部X线片"] = GetResult(strTmh, "胸部正、侧位片");
|
|||
|
|
dr["宫颈涂片"] = GetResult(strTmh, "宫颈刮片检测");
|
|||
|
|
dr["尿潜血"] = GetResult(strTmh, "尿隐血");
|
|||
|
|
dr["血尿素氮"] = GetResult(strTmh, "尿素");
|
|||
|
|
DataRow dr1 = dtDepResult.Select("tm = " + strTmh + " and ksmc='腹部彩超'").FirstOrDefault();
|
|||
|
|
if (dr1 != null)
|
|||
|
|
{
|
|||
|
|
dr["腹部B超"] = dr1["zdjg"];
|
|||
|
|
}
|
|||
|
|
DataRow dr2 = dtDepResult.Select("tm = " + strTmh + " and ksmc='尿常规'").FirstOrDefault();
|
|||
|
|
if (dr2 != null)
|
|||
|
|
{
|
|||
|
|
dr["尿常规其他"] = dr2["zdjg"];
|
|||
|
|
}
|
|||
|
|
DataRow dr3 = dtDepResult.Select("tm = " + strTmh + " and ksmc='血常规'").FirstOrDefault();
|
|||
|
|
if (dr3 != null)
|
|||
|
|
{
|
|||
|
|
dr["血常规其他"] = dr3["zdjg"];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
dtResult.Rows.Add(dr);
|
|||
|
|
}
|
|||
|
|
}, 100000, "正在分析...", false, false);
|
|||
|
|
f.ShowDialog();
|
|||
|
|
|
|||
|
|
new ExcelDC().ExportExcel("体检结果", dtResult);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show(ex.Message + "\n" + ex.Source + "\n" + ex.StackTrace + "\n" + ex.TargetSite);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 根据条码号及检查项目从数据集里获取结果
|
|||
|
|
/// 2023-09-26 xulu 添加方法
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="strTmh"></param>
|
|||
|
|
/// <param name="strXmmc"></param>
|
|||
|
|
/// <param name="iType"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public string GetResult(string strTmh, string strXmmc, int iType = 0)
|
|||
|
|
{
|
|||
|
|
DataRow dr = dtExamResult.Select("tm = " + strTmh + " and jcxmmc='" + strXmmc + "'").FirstOrDefault();
|
|||
|
|
//项目名称包含
|
|||
|
|
if (iType == 1)
|
|||
|
|
{
|
|||
|
|
dr = dtExamResult.Select("tm = " + strTmh + " and jcxmmc like '%" + strXmmc + "%'").FirstOrDefault();
|
|||
|
|
}
|
|||
|
|
if (dr != null)
|
|||
|
|
{
|
|||
|
|
return dr["jg"].ToString();
|
|||
|
|
}
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
public class HttpUpload
|
|||
|
|
{
|
|||
|
|
private ArrayList bytesArray;
|
|||
|
|
private Encoding encoding = Encoding.UTF8;
|
|||
|
|
private string boundary = String.Empty;
|
|||
|
|
|
|||
|
|
public HttpUpload()
|
|||
|
|
{
|
|||
|
|
bytesArray = new ArrayList();
|
|||
|
|
string flag = DateTime.Now.Ticks.ToString("x");
|
|||
|
|
boundary = "---------------------------" + flag;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 合并请求数据
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
private byte[] MergeContent()
|
|||
|
|
{
|
|||
|
|
int length = 0;
|
|||
|
|
int readLength = 0;
|
|||
|
|
string endBoundary = "--" + boundary + "--\r\n";
|
|||
|
|
byte[] endBoundaryBytes = encoding.GetBytes(endBoundary);
|
|||
|
|
|
|||
|
|
bytesArray.Add(endBoundaryBytes);
|
|||
|
|
|
|||
|
|
foreach (byte[] b in bytesArray)
|
|||
|
|
{
|
|||
|
|
length += b.Length;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
byte[] bytes = new byte[length];
|
|||
|
|
|
|||
|
|
foreach (byte[] b in bytesArray)
|
|||
|
|
{
|
|||
|
|
b.CopyTo(bytes, readLength);
|
|||
|
|
readLength += b.Length;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return bytes;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 上传
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="requestUrl">请求url</param>
|
|||
|
|
/// <param name="responseText">响应</param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public bool Upload(String requestUrl, out String responseText)
|
|||
|
|
{
|
|||
|
|
WebClient webClient = new WebClient();
|
|||
|
|
webClient.Headers.Add("Content-Type", "multipart/form-data; boundary=" + boundary);
|
|||
|
|
|
|||
|
|
byte[] responseBytes;
|
|||
|
|
byte[] bytes = MergeContent();
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
responseBytes = webClient.UploadData(requestUrl, bytes);
|
|||
|
|
responseText = System.Text.Encoding.UTF8.GetString(responseBytes);
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
catch (WebException ex)
|
|||
|
|
{
|
|||
|
|
Stream responseStream = ex.Response.GetResponseStream();
|
|||
|
|
responseBytes = new byte[ex.Response.ContentLength];
|
|||
|
|
responseStream.Read(responseBytes, 0, responseBytes.Length);
|
|||
|
|
}
|
|||
|
|
responseText = System.Text.Encoding.UTF8.GetString(responseBytes);
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设置表单数据字段
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="fieldName">字段名</param>
|
|||
|
|
/// <param name="fieldValue">字段值</param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public void SetFieldValue(String fieldName, String fieldValue)
|
|||
|
|
{
|
|||
|
|
string httpRow = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}\r\n";
|
|||
|
|
string httpRowData = String.Format(httpRow, fieldName, fieldValue);
|
|||
|
|
|
|||
|
|
bytesArray.Add(encoding.GetBytes(httpRowData));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 设置表单文件数据
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="fieldName">字段名</param>
|
|||
|
|
/// <param name="filename">字段值</param>
|
|||
|
|
/// <param name="contentType">内容内型</param>
|
|||
|
|
/// <param name="fileBytes">文件字节流</param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public void SetFieldValue(String fieldName, String filename, String contentType, Byte[] fileBytes)
|
|||
|
|
{
|
|||
|
|
string end = "\r\n";
|
|||
|
|
string httpRow = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";
|
|||
|
|
string httpRowData = String.Format(httpRow, fieldName, filename, contentType);
|
|||
|
|
|
|||
|
|
byte[] headerBytes = encoding.GetBytes(httpRowData);
|
|||
|
|
byte[] endBytes = encoding.GetBytes(end);
|
|||
|
|
byte[] fileDataBytes = new byte[headerBytes.Length + fileBytes.Length + endBytes.Length];
|
|||
|
|
|
|||
|
|
headerBytes.CopyTo(fileDataBytes, 0);
|
|||
|
|
fileBytes.CopyTo(fileDataBytes, headerBytes.Length);
|
|||
|
|
endBytes.CopyTo(fileDataBytes, headerBytes.Length + fileBytes.Length);
|
|||
|
|
|
|||
|
|
bytesArray.Add(fileDataBytes);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|