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

575 lines
25 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using AIMS.DocManager;
using AIMS.OperationAanesthesia;
using AIMSBLL;
using AIMSExtension;
using AIMSModel;
using DevComponents.DotNetBar;
using DocumentManagement;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AIMS
{
public partial class FormMainManage : OfficeForm
{
public FormMainManage()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
//Task.Factory.StartNew(() => { PreLoad(); });
comboBoxEx1.Items.AddRange(new object[] {
eStyle.Office2013 ,
eStyle.Office2016 ,
eStyle.Office2007Blue ,
eStyle.Office2007Silver ,
eStyle.Office2007Black,
eStyle.Office2007VistaGlass,
eStyle.Office2010Silver,
eStyle.Office2010Blue,
eStyle.Office2010Black ,
eStyle.Windows7Blue ,
eStyle.VisualStudio2010Blue ,
eStyle.VisualStudio2012Light ,
eStyle.VisualStudio2012Dark ,
eStyle.OfficeMobile2014 });
comboBoxEx1.SelectedIndex = 1;
SetGridAlternatingRows(lv1);
SetGridAlternatingRows(lv2);
SetGridAlternatingRows(lv3);
SetGridAlternatingRows(lv4);
SetGridAlternatingRows(lv5);
SetGridAlternatingRows(lv6);
}
private void switchButton1_ValueChanged(object sender, EventArgs e)
{
sideNav1.EnableClose = switchButton1.Value;
UpdateSideNavDock();
}
private void switchButton2_ValueChanged(object sender, EventArgs e)
{
sideNav1.EnableMaximize = switchButton2.Value;
UpdateSideNavDock();
}
private void switchButton3_ValueChanged(object sender, EventArgs e)
{
sideNav1.EnableSplitter = switchButton3.Value;
UpdateSideNavDock();
}
private void UpdateSideNavDock()
{
if (sideNav1.EnableClose || sideNav1.EnableMaximize || sideNav1.EnableSplitter)
{
if (sideNav1.Dock != DockStyle.Left)
{
sideNav1.Dock = DockStyle.Left;
sideNav1.Width = this.ClientRectangle.Width - 32;
ToastNotification.Close(this); // Closes any toast messages if already open
ToastNotification.Show(this, "With current settings SideNav control must be able to resize itself so its Dock is set to Left.", 4000);
}
}
else if (sideNav1.Dock != DockStyle.Fill)
{
sideNav1.Dock = DockStyle.Fill;
ToastNotification.Close(this); // Closes any toast messages if already open
ToastNotification.Show(this, "SideNav control Dock is set to Fill.", 2000);
}
}
private void comboBoxEx1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBoxEx1.SelectedItem == null) return;
eStyle style = (eStyle)comboBoxEx1.SelectedItem;
if (styleManager1.ManagerStyle != style)
styleManager1.ManagerStyle = style;
}
private void FormMainManage_Load(object sender, EventArgs e)
{
this.Text = " <20><>¼<EFBFBD>ˣ<EFBFBD>" + AIMSExtension.PublicMethod.OperatorName + " " + AIMSExtension.PublicMethod.OperatorNo;
int PanelWidth = Convert.ToInt32(sideNavPanel1.Size.Width / 3.4);
int PanelHeight = Convert.ToInt32(sideNavPanel1.Size.Height / 2.4);
int WidthSplit = sideNavPanel1.Size.Width / 3 / 11;
int HeightSplit = sideNavPanel1.Size.Height / 3 / 9;
expandablePanel2.Location = new Point(WidthSplit, HeightSplit);
expandablePanel2.Size = new Size(PanelWidth, PanelHeight);
expandablePanel1.Location = new Point(WidthSplit + PanelWidth + WidthSplit, HeightSplit);
expandablePanel1.Size = new Size(PanelWidth, PanelHeight);
expandablePanel3.Location = new Point(WidthSplit + PanelWidth + WidthSplit + PanelWidth + WidthSplit, HeightSplit);
expandablePanel3.Size = new Size(PanelWidth, PanelHeight);
expandablePanel4.Location = new Point(WidthSplit, HeightSplit + PanelHeight + HeightSplit);
expandablePanel4.Size = new Size(PanelWidth, PanelHeight);
expandablePanel5.Location = new Point(WidthSplit + PanelWidth + WidthSplit, HeightSplit + PanelHeight + HeightSplit);
expandablePanel5.Size = new Size(PanelWidth, PanelHeight);
expandablePanel6.Location = new Point(WidthSplit + PanelWidth + WidthSplit + PanelWidth + WidthSplit, HeightSplit + PanelHeight + HeightSplit);
expandablePanel6.Size = new Size(PanelWidth, PanelHeight);
superTabControl1.Size = new Size(PanelWidth - 5, PanelHeight - 35);
superTabControl1.Location = new Point(2, 28);
superTabControl2.Size = new Size(PanelWidth - 5, PanelHeight - 35);
superTabControl2.Location = new Point(2, 28);
superTabControl3.Size = new Size(PanelWidth - 5, PanelHeight - 35);
superTabControl3.Location = new Point(2, 28);
chart1.Size = new Size(PanelWidth - 5, PanelHeight - 35);
chart1.Location = new Point(2, 28);
chart2.Size = new Size(PanelWidth - 5, PanelHeight - 35);
chart2.Location = new Point(2, 28);
lv7.Size = new Size(PanelWidth - 5, PanelHeight - 35);
lv7.Location = new Point(2, 28);
List<AIMSModel.Menu> menuListP = new List<AIMSModel.Menu>();
AIMSModel.Menu menu = new AIMSModel.Menu();
menuListP = BMenu.GetMenuRootListManage(AIMSExtension.PublicMethod.RoleId, "0");
for (int i = 0; i < menuListP.Count; i++)
{
var menuSec = menuListP[i];
if (menuSec.Name == "<22><><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>")
continue;
DevComponents.DotNetBar.Controls.SideNavPanel sideNavPanel = new DevComponents.DotNetBar.Controls.SideNavPanel();
sideNavPanel.AutoScroll = true;
sideNavPanel.Dock = System.Windows.Forms.DockStyle.Fill;
sideNavPanel.Location = new System.Drawing.Point(156, 32);
sideNavPanel.Name = "sideNavPanel" + menuSec.Name;
sideNavPanel.Size = new System.Drawing.Size(696, 508);
sideNavPanel.TabIndex = i;
this.sideNav1.Controls.Add(sideNavPanel);
DevComponents.DotNetBar.Controls.SideNavItem sideNavItem = new DevComponents.DotNetBar.Controls.SideNavItem();
sideNavItem.Checked = false;
sideNavItem.Name = menuSec.Name;
sideNavItem.Panel = sideNavPanel;
sideNavItem.Text = menuSec.Name;
sideNavItem.Tag = menuSec;
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf044";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD>")
sideNavItem.Symbol = "\uf073";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼")
sideNavItem.Symbol = "\uf15b";
if (menuSec.Name == "<22>ָ<EFBFBD><D6B8><EFBFBD>¼")
sideNavItem.Symbol = "\uf15c";
if (menuSec.Name == "<22>յ<EFBFBD><D5B5><EFBFBD>¼")
sideNavItem.Symbol = "\uf044";
if (menuSec.Name == "<22><>ʹ<EFBFBD><CDB4>¼")
sideNavItem.Symbol = "\uf044";
if (menuSec.Name == "<22>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf044";
if (menuSec.Name == "<22><><EFBFBD>ҵǼ<D2B5>")
sideNavItem.Symbol = "\uf044";
if (menuSec.Name == "<22><><EFBFBD>ռ<EFBFBD>¼")
sideNavItem.Symbol = "\uf15c";
if (menuSec.Name == "<22><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf00e";
if (menuSec.Name == "<22>շѹ<D5B7><D1B9><EFBFBD>")
sideNavItem.Symbol = "\uf00e";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>")
sideNavItem.Symbol = "\uf0cb";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf0cb";
if (menuSec.Name == "<22>ų̲<C5B3>ѯ")
sideNavItem.Symbol = "\uf0c5";
if (menuSec.Name == "ҽ<><D2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf14b";
if (menuSec.Name == "<22><>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf0f0";
if (menuSec.Name == "ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf1de";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>")
sideNavItem.Symbol = "\uf080";
if (menuSec.Name == "<22>Ű<EFBFBD><C5B0><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf03a";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD>໤")
sideNavItem.Symbol = "\uf109";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf022";
if (menuSec.Name == "<22>ʿع<CABF><D8B9><EFBFBD>")
sideNavItem.Symbol = "\uf200";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>")
sideNavItem.Symbol = "\uf183";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf18d";
if (menuSec.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
sideNavItem.Symbol = "\uf0ea";
this.sideNav1.Items.Add(sideNavItem);
}
LoadDataRescue();
}
private System.Windows.Forms.Timer timerLoadRescue;
public void LoadDataRescue()
{
timerLoadRescue = new System.Windows.Forms.Timer();
timerLoadRescue.Enabled = true;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ΪFALSE <20><>
timerLoadRescue.Interval = 300;
timerLoadRescue.Tick -= timerLoadRescue_Tick;
timerLoadRescue.Tick += timerLoadRescue_Tick;
timerLoadRescue.Start();
}
private void timerLoadRescue_Tick(object sender, EventArgs e)
{
timerLoadRescue.Dispose();
//Task.Factory.StartNew(() =>
//{
BindOperationsList(lv1, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), labTa, true);
BindOperationsList(lv3, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(2), labTo, true);
BindOperationsList(lv5, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(-7), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), labWeek, true, true);
//});
//Task.Factory.StartNew(() =>
//{
BindOperationsListChart();
SetBackColor(expandablePanel5.Controls.Find("button" + DateTime.Now.Month, false)[0] as Button);
BindOperationsListChart2(DateTime.Now.Month.ToString());
BindfrmNoticeMain();
//});
}
public void BindOperationsList(DevComponents.DotNetBar.Controls.DataGridViewX lvex, DateTime beginTime, DateTime endTime, DevComponents.DotNetBar.LabelX labCount, bool isLoginPerson, bool isEnOpe = false)
{
lvex.Rows.Clear();
DataTable dt = SelectPatient.GetSelectPatientDataTable
(beginTime, endTime, isLoginPerson, AIMSExtension.PublicMethod.OperatorName, isEnOpe);
if (dt.Rows.Count == 0) labCount.Visible = false;
else labCount.Visible = true;
labCount.Text = dt.Rows.Count.ToString() + "̨";
for (int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = dt.Rows[i];
string patient = dr["OperationRoom"].ToString() + (dr["PlanOrder"].ToString() == "" ? "" : ("-" + dr["PlanOrder"].ToString() + " ")) + dr["MdrecNo"].ToString() + " " +
dr["PatientName"].ToString();
if (isEnOpe == true) patient = dr["InRoomTime"].ToString() + " " + patient;
string AnesthesiaDoctor = dr["AnesthesiaDoctor"].ToString() == "" ? "" : (" <20><><EFBFBD><EFBFBD>:" +
dr["AnesthesiaDoctor"].ToString());
string Nurse = (dr["InstrumentNurse"].ToString() == "" & dr["TourNurse"].ToString() == "") ? "" : (" <20><>ʿ:" + dr["InstrumentNurse"].ToString() + " " + dr["TourNurse"].ToString());
string message = patient + AnesthesiaDoctor + Nurse;
//if (AIMSExtension.PublicMethod.RoleId == 7 || AIMSExtension.PublicMethod.RoleId == 10)
//{
// message = patient + AnesthesiaDoctor + Nurse;
//}
//else if (AIMSExtension.PublicMethod.RoleId == 6 || AIMSExtension.PublicMethod.RoleId == 8)
//{
// message = patient + Nurse;
//}
DataGridViewRow drc = new DataGridViewRow();
drc.CreateCells(lvex);
drc.Cells[0].Value = dr["ApplyId"].ToString();
drc.Cells[1].Value = dr["PatientId"].ToString();
drc.Cells[2].Value = message;
drc.Cells[3].Value = dr["State"].ToString();
lvex.Rows.Insert(i, drc);
lvex.ClearSelection();
}
}
public void BindOperationsListChart()
{
try
{
DataTable dt = SelectPatient.GetSelectPatientChart();
List<string> xData = new List<string>();
List<int> yData = new List<int>();
foreach (DataRow item in dt.Rows)
{
xData.Add(item["dat"].ToString());
yData.Add((int)(double.Parse(item["DiffDate"].ToString())));
}
chart1.Series[0].Points.DataBindXY(xData, yData);
}
catch (Exception)
{
}
}
public void BindOperationsListChart2(string Months)
{
DateTime dateTime = new DateTime(DateTime.Now.Year, int.Parse(Months), 1);
DataTable dt = SelectPatient.GetSelectPatientChart2(dateTime);
List<string> xData = new List<string>();
List<int> yData = new List<int>();
foreach (DataRow item in dt.Rows)
{
xData.Add(item["dat"].ToString());
yData.Add(int.Parse(item["con"].ToString()));
}
chart2.Series[0]["PieLabelStyle"] = "Outside";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>
chart2.Series[0]["PieLineColor"] = "Black";//<2F><><EFBFBD>ƺ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>ߡ<EFBFBD>
chart2.Series[0].Points.DataBindXY(xData, yData);
}
public DevComponents.DotNetBar.Controls.SideNavItem selsideNavItem = null;
private void sideNav1_SelectedItemChanged(object sender, EventArgs e)
{
if (selsideNavItem != null) selsideNavItem.Text = selsideNavItem.Text.Replace(" <20><>", "");
DevComponents.DotNetBar.Controls.SideNavItem sideNavItem = sideNav1.SelectedItem;
if (sideNavItem.Tag == null) return;
selsideNavItem = sideNavItem;
sideNavItem.Text = sideNavItem.Text + " <20><>";
AIMSModel.Menu menu = sideNavItem.Tag as AIMSModel.Menu;
if (menu.Name == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
{
BrowserHelper.OpenBrowserUrlChrome(menu.Path);
}
else if (menu.Name == "<22><><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>")
{
DialogResult dialog = MessageBox.Show("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><E6B1A8><EFBFBD><EFBFBD>", "ϵͳ<CFB5><CDB3>ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dialog == DialogResult.Yes)
BrowserHelper.OpenBrowserUrlChrome(menu.Path);
menu.Path = "AIMS.frmReportExport";
}
if (menu.Path.Contains("AIMS."))
{
string path = menu.Path;
if (path.Length > 0)
{
try
{
Form frm = GetForm(path);
if (menu.IsAloneOpen == 1)
sideNav1.IsMenuExpanded = false;
frm.TopLevel = false;
frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
frm.WindowState = FormWindowState.Maximized;
sideNavItem.Panel.Controls.Clear();
sideNavItem.Panel.Controls.Add(frm);
frm.Show();
frm.BringToFront();
}
catch (Exception)
{
if (path.Contains("MainFormManage"))
{
MainFormManage frm = new MainFormManage();
frm.Show();
frm.BringToFront();
}
}
}
}
}
public Form GetForm(string Path)
{
object result = null;
Type type = Type.GetType(Path);
result = (Form)Activator.CreateInstance(type);
return (Form)result;
}
private void btnExit_Click(object sender, EventArgs e)
{
AIMS.PublicUI.UI.frmEditPassWord frmEditPassWord = new PublicUI.UI.frmEditPassWord();
//frmEditPassWord.FormClosing += (s, er) => { btnOk_Click(null, null); };
frmEditPassWord.ShowDialog();
}
private void btnOk_Click(object sender, EventArgs e)
{
try
{
foreach (Form frm in Application.OpenForms)
{
if (frm.Name != "frmLogin" && frm.Name != this.Name)
{
frm.Close();
break;
}
}
foreach (Form frm in Application.OpenForms)
{
if (frm.Name == "frmLogin")
{
frm.Show();
isClose = true;
this.Close();
break;
}
}
}
catch (Exception)
{
}
}
bool isClose = false;
private void FormMainManage_FormClosing(object sender, FormClosingEventArgs e)
{
if (isClose == false)
{
if (MessageBox.Show(this, <><C8B7>Ҫ<EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ǰϵͳ<CFB5><CDB3>", "ϵͳ<CFB5><CDB3>ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
GC.Collect();
GC.WaitForPendingFinalizers();
this.Dispose();
Environment.Exit(0);
}
e.Cancel = true;
}
}
private void buttonX1_Click(object sender, EventArgs e)
{
AIMS.PublicUI.UI.frmAbout frmEditPassWord = new PublicUI.UI.frmAbout();
frmEditPassWord.ShowDialog();
}
private void buttonX2_Click(object sender, EventArgs e)
{
AIMS.PublicUI.UI.frmNoticeMain main = new PublicUI.UI.frmNoticeMain();
main.FormClosing += (s, er) => { BindfrmNoticeMain(); };
main.ShowDialog();
}
public void BindfrmNoticeMain()
{
List<Notice> NoticeList = BNotice.HistoryNoticeData();
System.Windows.Forms.ListViewItem[] lists = new System.Windows.Forms.ListViewItem[NoticeList.Count];
lv7.Items.Clear();
for (int i = 0; i < NoticeList.Count; i++)
{
lists[i] = new System.Windows.Forms.ListViewItem(new string[] { NoticeList[i].Id.ToString(), NoticeList[i].Contents, NoticeList[i].OperateDate.Value.ToString("yyyy-MM-dd") }, i);
}
lv7.Items.AddRange(lists);
}
private void buttonX3_Click(object sender, EventArgs e)
{
AIMS.OperationFront.UI.frmOperationApplyDetail frmOperationApplyDetail = new AIMS.OperationFront.UI.frmOperationApplyDetail();
frmOperationApplyDetail.State = AIMSExtension.EditState.ADD;
frmOperationApplyDetail.FormClosed += (ee, err) =>
{
BindOperationsList(lv1, DateTime.Now, DateTime.Now.AddDays(1), labTa, true);
};
frmOperationApplyDetail.ShowDialog();
}
private void superTabControl1_SelectedTabChanged(object sender, SuperTabStripSelectedTabChangedEventArgs e)
{
if (superTabControl1.SelectedTab.Name == "P1")
{
BindOperationsList(lv1, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), labTa, true);
}
if (superTabControl1.SelectedTab.Name == "P2")
{
BindOperationsList(lv2, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), labTa, false);
}
}
private void superTabControl2_SelectedTabChanged(object sender, SuperTabStripSelectedTabChangedEventArgs e)
{
if (superTabControl2.SelectedTab.Name == "P3")
{
BindOperationsList(lv3, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(2), labTo, true);
}
if (superTabControl2.SelectedTab.Name == "P4")
{
BindOperationsList(lv4, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(2), labTo, false);
}
}
private void superTabControl3_SelectedTabChanged(object sender, SuperTabStripSelectedTabChangedEventArgs e)
{
if (superTabControl3.SelectedTab.Name == "P5")
{
BindOperationsList(lv5, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(-7), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), labWeek, true, true);
}
if (superTabControl3.SelectedTab.Name == "P6")
{
BindOperationsList(lv6, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(-7), DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).AddDays(1), labWeek, false, true);
}
}
private void lv2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
DataGridView dataGridView = sender as DataGridView;
int SelApplyId = int.Parse(dataGridView.CurrentRow.Cells[0].Value.ToString());
int SelPatientId = int.Parse(dataGridView.CurrentRow.Cells[1].Value.ToString());
if (SelPatientId == 0)
{
return;
}
PatientRecord patient = PatientRecord.GetPatientRecord(SelPatientId);
frmDocument frmDocument = new frmDocument(patient);
frmDocument.StartPosition = FormStartPosition.CenterScreen;
frmDocument.WindowState = FormWindowState.Maximized;
frmDocument.ShowDialog();
}
private void lv5_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
DataGridView dataGridView = sender as DataGridView;
int SelApplyId = int.Parse(dataGridView.CurrentRow.Cells[0].Value.ToString());
if (SelApplyId != 0)
{
OperationApply apply = BOperationApply.GetModel(SelApplyId);
frmAanesthesiaRecord frmAnasRecord = new frmAanesthesiaRecord();
frmAnasRecord.PatientId = apply.OrisPatientId.Value;
frmAnasRecord.ApplyId = apply.Id.Value;
frmAnasRecord.State = AIMSExtension.EditState.BROWSE;
frmAnasRecord.Show();
}
}
public void SetGridAlternatingRows(DataGridView dg)
{
if (dg != null)
{
dg.RowsDefaultCellStyle.BackColor = Color.FromArgb(255, 255, 255);
dg.AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue;
}
}
private void button1_Click(object sender, EventArgs e)
{
SetBackColor(sender as Button);
BindOperationsListChart2((sender as Button).Text.Replace("<22><>", ""));
}
public void SetBackColor(Button btn)
{
btn.BackColor = Color.DeepSkyBlue;
foreach (var item in btn.Parent.Controls)
{
if (item != btn)
if (item is Button)
{
(item as Button).BackColor = Color.White;
}
}
}
//static void PreLoad()
//{
// string msg = DCSoft.Writer.Controls.WriterControl.CheckSystemEnvironment(false);
// if (msg != null)
// {
// MessageBox.Show(null, msg, "ϵͳ<CFB5><CDB3>ʾ", MessageBoxButtons.OK, MessageBoxIcon.Error);
// return;
// }
// // Ԥ<>ȳ<EFBFBD>ʼ<EFBFBD><CABC>һЩ<D2BB><D0A9><EFBFBD><EFBFBD>
// DCSoft.Writer.WriterAppHost.PreloadSystem();
// DCSoft.Writer.Controls.WriterControl.StaticSetRegisterCode(AIMSExtension.PublicMethod.Decrypt(AIMSControls.Properties.Resources.C));
//}
}
}