using AIMSModel; using DataDictionary; using System; using System.Data; using System.Drawing; using System.Windows.Forms; namespace AIMS.OremrUserControl { public partial class ucPatientCard : UserControl { public int RecorId; public int ApplyId; public int PatientId; public DataRow _dr; public delegate void InRoomHandler(ucPatientCard uc, int PatientId, int applyId); public event InRoomHandler InRoom; public delegate void QxRoomHandler(ucPatientCard uc, int RecorId, int PatientId, int applyId); public event QxRoomHandler QxRoom; public delegate void ClicksHandler(ucPatientCard uc, int PatientId, int applyId, DataRow dr); public event ClicksHandler Clicks; public OperationRoom operationRoom; public ucPatientCard() { InitializeComponent(); } public ucPatientCard(DataRow dr) { InitializeComponent(); panelExMain.BindWaterMark2(dr["OperationRoom"].ToString(), 150, 55, Color.DarkGray); //this.BindWaterMark(dr["OperationRoom"].ToString()); this.Tag = dr["OperationRoomId"].ToString(); _dr = dr; RecorId = int.Parse(dr["Id"].ToString()); ApplyId = int.Parse(dr["ApplyId"].ToString()); PatientId = int.Parse(dr["PatientId"].ToString()); labelName.Text = dr["OperationType"].ToString(); label3.Text = dr["MdrecNo"].ToString(); labTabindex.Text = dr["PatientName"].ToString(); lblOpeDoctors.Text = "手术名称:" + dr["ApplyOperationInfoName"].ToString(); lblAnesDoctors.Text = "麻醉医生:" + dr["AnesthesiaDoctor"].ToString(); lblNurse.Text = "洗手护士:" + dr["InstrumentNurse"].ToString(); lblNurse2.Text = "巡回护士:" + dr["TourNurse"].ToString(); if (dr["Contagion"] != null && dr["Contagion"].ToString() != "" && dr["Contagion"].ToString() != "无" && dr["Contagion"].ToString() != "未报") { lbaCon.Text = dr["Contagion"].ToString(); lbaCon.Visible = true; } if (!labelName.Text.Contains("急")) labelName.ForeColor = Color.DarkGreen; label2.Text = dr["State"].ToString(); if (dr["State"].ToString() == "手术中") { panelExMain.Style.BackColor1.Color = Color.OldLace; buttonX1.Text = "继续手术"; buttonX2.Text = "取消手术"; label2.ForeColor = Color.Red; } else if (dr["State"].ToString() == "已排程" || dr["State"].ToString() == "已访视") { panelExMain.Style.BackColor1.Color = Color.WhiteSmoke; buttonX1.Text = "转入术间"; buttonX2.Visible = false; //buttonX1.Text = "开始诱导"; //buttonX2.Text = "转入术间"; label2.ForeColor = Color.DarkRed; } else if (dr["State"].ToString() == "已审核" || dr["State"].ToString() == "预排程") { panelExMain.Style.BackColor1.Color = Color.WhiteSmoke; buttonX1.Text = "转入术间"; buttonX2.Visible = false; //buttonX1.Text = "开始诱导"; //buttonX2.Text = "转入术间"; label2.Text = "未排程"; label2.ForeColor = Color.DarkRed; } else if (dr["State"].ToString() == "停止手术") { panelExMain.Style.BackColor1.Color = Color.MistyRose; buttonX1.Text = "查看手术"; buttonX2.Text = "返回手术"; label2.ForeColor = Color.DarkGray; } else { panelExMain.Style.BackColor1.Color = Color.Honeydew; buttonX1.Text = "查看手术"; buttonX2.Text = "返回手术"; label2.ForeColor = Color.DarkGreen; } } public ucPatientCard GetParentRoomCards(Control control) { if (control.Parent is ucPatientCard) { return control.Parent as ucPatientCard; } else { return GetParentRoomCards(control.Parent); } } private void buttonX1_Click(object sender, EventArgs e) { InRoom(this, PatientId, ApplyId); } private void buttonX2_Click(object sender, EventArgs e) { QxRoom(this, RecorId, PatientId, ApplyId); } private void labTabindex_Click(object sender, EventArgs e) { Clicks(this, PatientId, ApplyId, _dr); } //private void SetWindowRegion() //{ // GraphicsPath FormPath = new GraphicsPath(); // Rectangle rect = new Rectangle(0, 4, this.Width, this.Height - 4); // FormPath = GetRoundedRectPath(rect, 10); // 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(); //} } }