AIMS/AIMSControls/OremrUserControl/ucPatientRecoverCard.cs
2023-08-16 22:32:16 +08:00

129 lines
4.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AIMSModel;
using DevComponents.DotNetBar.SuperGrid;
using AIMSExtension;
using AIMSBLL;
using AIMS.PublicUI;
using System.Drawing.Drawing2D;
namespace AIMS.OremrUserControl
{
public partial class ucPatientRecoverCard : UserControl
{
public int ApplyId;
public int PatientId;
public DataRow _dr;
public delegate void InRoomHandler(ucPatientRecoverCard uc, int PatientId, int applyId);
public event InRoomHandler InRoom;
public delegate void ClicksHandler(ucPatientRecoverCard uc, DataRow dr);
public event ClicksHandler Clicks;
public OperationRoom operationRoom;
public ucPatientRecoverCard()
{
InitializeComponent();
}
public void SetucPatientRecoverCard(DataRow dr)
{
buttonX1.Text = "查看复苏";
_dr = dr;
ApplyId = int.Parse(dr["ApplyId"].ToString());
PatientId = int.Parse(dr["PatientId"].ToString());
labPatientName.Text = dr["PatientName"].ToString() + " " + dr["Sex"].ToString() + " " + dr["age"].ToString();
lblSexAge.Text = dr["ApplyOperationInfoName"].ToString();
lblAnaesthesiaMethodName.Text = dr["AnaesthesiaMethodName"].ToString();
label2.Text = "手术医生:" + dr["OperationDoctor"].ToString();
lblAnesDoctors.Text = "麻醉医生:" + dr["AnesthesiaDoctor"].ToString();
label10.Text = "手术时间:" + dr["OutRoomTime"].ToString();
label13.Text = "复苏时间:" + dr["InRoomTime"].ToString();
panel1.BackColor = Color.SkyBlue;
lblBR.Text = "--";
lblHR.Text = "--";
lblSpO2.Text = "--/--";
lblSys.Text = "--";
lblT.Text = "--";
}
public ucPatientRecoverCard(OperationRoom room)
{
InitializeComponent();
this.Tag = room.Id;
labelName.Text = room.Name;
lblBR.Text = "--";
lblHR.Text = "--";
lblSpO2.Text = "--/--";
lblSys.Text = "--";
lblT.Text = "--";
}
private void ucPatientRecoverCard_Click(object sender, EventArgs e)
{
//ucPatientRecoverCard operationRoomClicked = GetParentRoomCards(sender as Control);
}
public ucPatientRecoverCard GetParentRoomCards(Control control)
{
if (control.Parent is ucPatientRecoverCard)
{
return control.Parent as ucPatientRecoverCard;
}
else
{
return GetParentRoomCards(control.Parent);
}
}
private void buttonX1_Click(object sender, EventArgs e)
{
InRoom(this, PatientId, ApplyId);
}
private void labTabindex_Click(object sender, EventArgs e)
{
Clicks(this, _dr);
}
private void SetWindowRegion()
{
GraphicsPath FormPath = new GraphicsPath();
Rectangle rect = new Rectangle(0, 2, this.Width, this.Height - 2);
FormPath = GetRoundedRectPath(rect, 19);
this.Region = new Region(FormPath);
}
private GraphicsPath GetRoundedRectPath(Rectangle rect, int radius)
{
int diameter = radius;
Rectangle arcRect = new Rectangle(rect.Location, new Size(diameter, diameter));
GraphicsPath path = new GraphicsPath();
//左上角
path.AddArc(arcRect, 180, 90);
//右上角
arcRect.X = rect.Right - diameter;
path.AddArc(arcRect, 270, 90);
//右下角
arcRect.Y = rect.Bottom - diameter;
path.AddArc(arcRect, 0, 90);
//左下角
arcRect.X = rect.Left;
path.AddArc(arcRect, 90, 90);
path.CloseFigure();
return path;
}
protected override void OnResize(System.EventArgs e)
{
this.Region = null;
SetWindowRegion();
}
}
}