104 lines
3.4 KiB
C#
104 lines
3.4 KiB
C#
using AIMSModel;
|
|
using DevComponents.DotNetBar.Controls;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AIMS.OremrUserControl
|
|
{
|
|
public static class RoomCardManage
|
|
{
|
|
#region 权限控制
|
|
/// <summary>
|
|
/// 是否允许排程患者
|
|
/// </summary>
|
|
public static bool IsAllowPat = false;
|
|
/// <summary>
|
|
/// 是否允许排程麻醉
|
|
/// </summary>
|
|
public static bool IsAllowAns = false;
|
|
/// <summary>
|
|
/// 是否允许排程护士
|
|
/// </summary>
|
|
public static bool IsAllowNur = false;
|
|
/// <summary>
|
|
/// 是否允许停止手术
|
|
/// </summary>
|
|
public static bool IsAllowStopOpe = false;
|
|
/// <summary>
|
|
/// 是否允许排程通过
|
|
/// </summary>
|
|
public static bool IsAllowPassOpe = false;
|
|
#endregion
|
|
|
|
public static List<int> OldSelectIds;
|
|
public static List<int> SelectIds = new List<int>();
|
|
public static DataGridView SelectDgv;
|
|
public static ucPlanOperationRoomCard lastSelectOpeRoom;
|
|
public static bool IsFillAll = false;
|
|
|
|
|
|
public static Action<ucPlanOperationRoomCard, OperationRoom, bool, int> OnDataSaved;
|
|
|
|
/// <summary>
|
|
/// 激活对象事件
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <param name="EventName"></param>
|
|
/// <param name="e"></param>
|
|
public static void CallObjectEvent(Object obj, string EventName, EventArgs e = null)
|
|
{
|
|
try
|
|
{
|
|
//建立一个类型
|
|
Type t = Type.GetType(obj.GetType().AssemblyQualifiedName);
|
|
//产生方法
|
|
MethodInfo m = t.GetMethod(EventName, BindingFlags.NonPublic | BindingFlags.Instance);
|
|
//参数赋值。传入函数
|
|
//获得参数资料
|
|
ParameterInfo[] para = m.GetParameters();
|
|
//根据参数的名字,拿参数的空值。
|
|
//参数对象
|
|
object[] p = new object[1];
|
|
if (para.Count() > 0)
|
|
{
|
|
if (e == null)
|
|
p[0] = Type.GetType(para[0].ParameterType.BaseType.FullName).GetProperty("Empty");
|
|
else
|
|
p[0] = e;
|
|
m.Invoke(obj, p);
|
|
}
|
|
else
|
|
m.Invoke(obj, null);
|
|
}
|
|
catch (Exception )
|
|
{
|
|
}
|
|
}
|
|
public static void WriteMsg(RichTextBoxEx rbLog, string pMsg)
|
|
{
|
|
try
|
|
{
|
|
rbLog.AppendText("\r\n");
|
|
rbLog.Select(rbLog.TextLength - 1, 1);
|
|
rbLog.SelectionColor = Color.Black;
|
|
rbLog.AppendText(DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + " " + pMsg);
|
|
rbLog.Select(rbLog.TextLength - 1, 1);
|
|
rbLog.ScrollToCaret();
|
|
}
|
|
catch { }
|
|
}
|
|
public static bool GetRolePermission(string permissionItem)
|
|
{
|
|
if (AIMSExtension.PublicMethod.RoleName.Contains(permissionItem))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
}
|
|
}
|