AIMS/AIMS/OperationAanesthesia/DrawAnasReordBill.cs
2022-12-29 21:57:18 +08:00

315 lines
15 KiB
C#

using AIMSBLL;
using AxNsoOfficeLib;
using DrawGraph;
using HelperDB;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
namespace AIMS.OperationAanesthesia
{
public class DrawAnasReordBill
{
public static void IniDrawAnasReordBill2(OperationRecord _record, ZedGraphControl Zgc, ref TemplateManage templateManage)
{
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=1").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 1);
templateManage.ZedControl = Zgc;
templateManage.Id = 1;
bool reVal = templateManage.Load();
if (reVal)
{
templateManage.DrawArea();
DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16);
DrawGraph.ZUtil.DrawText(" 麻醉记录单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16);
#region
//在此处可随时设置板子的属性
templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54;
templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11;
TextPackObj janCePack = templateManage.GetPackObjectOTag<TextPackObj>("BaseInfoTopManage_TextPackObj_2");
int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * janCePack.RealY);
templateManage.LocationY = LocationY;
templateManage.SetPYL();
templateManage.ZedControl.AxisChange();
templateManage.ZedControl.Refresh();
//最后还要调整图表进行自适应
PackObjBase pack = templateManage.GetPackObjectOTag<PackObjBase>("PhysioDataManage_ChartPackObj_6");
if (pack != null)
pack.Draw();
#endregion
}
else
{
MessageBox.Show(templateManage.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public static void IniDrawAnasReordBill3(OperationRecord _record, ZedGraphControl Zgc, ref TemplateManage templateManage)
{
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=10").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage.ZedControl = Zgc;
templateManage.Id = 10;
templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 2);
bool reVal = templateManage.Load();
if (reVal)
{
templateManage.DrawArea();
DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16);
DrawGraph.ZUtil.DrawText(" 恢复记录单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16);
#region
//在此处可随时设置板子的属性
templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54;
templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11;
TextPackObj janCePack = templateManage.GetPackObjectOTag<TextPackObj>("BaseInfoTopManage_TextPackObj_2");
int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * janCePack.RealY);
templateManage.LocationY = LocationY;
templateManage.SetPYL();
templateManage.ZedControl.AxisChange();
templateManage.ZedControl.Refresh();
//最后还要调整图表进行自适应
PackObjBase pack = templateManage.GetPackObjectOTag<PackObjBase>("PhysioDataManage_ChartPackObj_6");
if (pack != null)
pack.Draw();
#endregion
}
else
{
MessageBox.Show(templateManage.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public static void IniDrawAnasReordBill4(OperationRecord _record, ZedGraphControl Zgc, ref TemplateManage templateManage)
{
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=20").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage.ZedControl = Zgc;
templateManage.Id = 20;
templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 2);
bool reVal = templateManage.Load();
if (reVal)
{
templateManage.DrawArea();
templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54;
templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11;
TextPackObj janCePack = templateManage.GetPackObjectOTag<TextPackObj>("BaseInfoTopManage_TextPackObj_912");
int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * janCePack.RealEndY);
templateManage.LocationY = LocationY;
templateManage.SetPYL();
templateManage.ZedControl.AxisChange();
templateManage.ZedControl.Refresh();
}
else
{
MessageBox.Show(templateManage.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public static void IniDrawAnasReordBill4(OperationRecord _record, ZedGraphControl Zgc, ZedGraphControl Zgc2, ref TemplateManage templateManage, ref TemplateManage templateManage2)
{
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=20").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage.ZedControl = Zgc;
templateManage.Id = 20;
templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 2);
bool reVal = templateManage.Load();
if (reVal)
{
templateManage.DrawArea();
DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16);
DrawGraph.ZUtil.DrawText(" 器械清点单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16);
templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54;
templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11;
TextPackObj janCePack = templateManage.GetPackObjectOTag<TextPackObj>("BaseInfoTopManage_TextPackObj_2");
int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * janCePack.RealY);
templateManage.LocationY = LocationY;
templateManage.SetPYL();
templateManage.ZedControl.AxisChange();
templateManage.ZedControl.Refresh();
}
else
{
MessageBox.Show(templateManage.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=30").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage2 = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage2.ZedControl = Zgc2;
templateManage2.Id = 30;
templateManage2.OpeRecord = BOperationRecord.getRecord(_record, -1, 2);
bool reVal = templateManage2.Load();
if (reVal)
{
templateManage2.DrawArea();
templateManage2.ZedControl.Width = templateManage2.ZedControl.Parent.Width - 54;
templateManage2.ZedControl.Height = (templateManage2.ZedControl.Parent.Width - 54) / 8 * 11;
templateManage2.LocationY = 0;
templateManage2.SetPYL();
templateManage2.ZedControl.AxisChange();
templateManage2.ZedControl.Refresh();
}
else
{
MessageBox.Show(templateManage2.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public static void IniDrawAnasReordBill5(OperationRecord _record, ZedGraphControl Zgc, ZedGraphControl Zgc2, ref TemplateManage templateManage, ref TemplateManage templateManage2)
{
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=40").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 1);
templateManage.ZedControl = Zgc;
templateManage.Id = 40;
bool reVal = templateManage.Load();
if (reVal)
{
templateManage.DrawArea();
DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16);
DrawGraph.ZUtil.DrawText(" 麻 醉 记 录", 0.42, 0.04, Zgc, DrawGraph.ZUtil.Font14);
#region
//在此处可随时设置板子的属性
templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54;
templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11;
int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * 0.04);
templateManage.LocationY = LocationY;
templateManage.SetPYL();
templateManage.ZedControl.AxisChange();
templateManage.ZedControl.Refresh();
//最后还要调整图表进行自适应
PackObjBase pack = templateManage.GetPackObjectOTag<PackObjBase>("PhysioDataManage_ChartPackObj_6");
if (pack != null)
pack.Draw();
#endregion
}
else
{
MessageBox.Show(templateManage.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
try
{
string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=50").ToString();
if (jsonStr != null && jsonStr != "")
{
templateManage2 = JsonConvert.DeserializeObject<TemplateManage>(jsonStr);
templateManage2.ZedControl = Zgc2;
templateManage2.Id = 50;
templateManage2.OpeRecord = BOperationRecord.getRecord(_record, -1, 2);
bool reVal = templateManage2.Load();
if (reVal)
{
templateManage2.DrawArea();
DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.038, Zgc2, DrawGraph.ZUtil.Font16);
DrawGraph.ZUtil.DrawText(" 麻 醉 记 录", 0.42, 0.065, Zgc2, DrawGraph.ZUtil.Font14);
templateManage2.ZedControl.Width = templateManage.ZedControl.Width;
templateManage2.ZedControl.Height = templateManage.ZedControl.Height;
int LocationY = Convert.ToInt32(templateManage2.ZedControl.Height * 0.065);
templateManage2.LocationY = LocationY;
templateManage2.SetPYL();
templateManage2.ZedControl.AxisChange();
templateManage2.ZedControl.Refresh();
}
else
{
MessageBox.Show(templateManage2.MsgStr);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
public static DataTable SelectPhysioDataUpdate(int Id)
{
string sql = string.Format("SELECT PhysioDataUpdate.Id,pr.Name ,PatientId,PhysioDataConfigId,RecordTime,[OldParamValue],[ParamValue],[PhysioDataUpdate].[OperatorName],[OperatorTime] FROM[dbo].[PhysioDataUpdate] left join PhysioDataConfig pr on pr.id =PhysioDataConfigId where PatientId ={0}", Id);
DataTable dt = DBHelper.GetDataTable(sql);
return dt;
}
}
}