/// <summary> /// GetXR /// </summary> /// <returns></returns> XtraReport GetXR(decimal rptId) { EntitySysReport rptVo = null; using (ProxyCommon proxy = new ProxyCommon()) { rptVo = proxy.Service.GetReport(this.rptId); } XtraReport xr = new XtraReport(); if (rptVo != null) { MemoryStream ms = new MemoryStream(); ms.Write(rptVo.rptFile, 0, rptVo.rptFile.Length); xr.LoadLayout(ms); } xr.DataSource = this.gcData.DataSource as List <EntityYgInpatStat>; XRControl xc; //报表上的组件 xc = xr.FindControl("lblDate", true); if (xc != null) { (xc as XRLabel).Text = " " + dateScope; } xr.CreateDocument(); return(xr); }
public override void Intercept(IInvocation invocation) { // Get all the set attributes. // AllowMultiple = true HandleEventsAttribute[] attributes = ProxyCommon.AsAttribute <HandleEventsAttribute[]>(invocation.Method); // The attribute can only be applied to Properties that are objects and have a getter. if (attributes == null || attributes.Length == 0) { invocation.Proceed(); return; } if (ProxyCommon.GetMethodResult(invocation, $"get_{attributes[0].MemberName}") != null) { // Need to remove the listeners before changing the object. EditEvents(attributes, invocation, /*removeEvent*/ true); } invocation.Proceed(); if (ProxyCommon.GetMethodResult(invocation, $"get_{attributes[0].MemberName}") != null) { // Need to add the listeners on new object EditEvents(attributes, invocation, /*removeEvent*/ false); } }
public void NonProxyableMemberNotification(Type type, MemberInfo memberInfo) { if (ProxyCommon.IsSetter(memberInfo as MethodInfo)) { throw new NotProxyableException(memberInfo, GetType().Name); } }
/// <summary> /// DelFormDept /// </summary> internal void DelFormDept() { if (Viewer.gvDept.FocusedRowHandle < 0) { return; } if (DialogBox.Msg("是否删除?", MessageBoxIcon.Question) == DialogResult.Yes) { EntityEmrDept vo = DataSourceEmrDept[Viewer.gvDept.FocusedRowHandle]; if (vo != null) { using (ProxyCommon proxy = new ProxyCommon()) { if (proxy.Service.DelCaseDept(vo) > 0) { LoadCaseDept(vo.caseCode); DialogBox.Msg("删除成功!"); } else { DialogBox.Msg("删除失败。"); } } } } }
/// <summary> /// NewFormDept /// </summary> internal void NewFormDept() { EntityEmrBasicInfo caseVo = GetCaseVo(); if (caseVo == null) { DialogBox.Msg("请先保存病历基础信息。"); return; } frmNew frm = new frmNew(EntityTools.ConvertToDataTable <EntityCodeDepartment>(GlobalDic.DataSourceDepartment), "deptCode", "deptCode", "deptName"); if (frm.ShowDialog() == DialogResult.OK) { if (frm.lstNo.Count > 0) { foreach (int index in frm.lstNo) { EntityEmrDept emrDept = new EntityEmrDept(); emrDept.caseCode = caseVo.caseCode; emrDept.deptCode = GlobalDic.DataSourceDepartment[index].deptCode; emrDept.attrFlag = 1; using (ProxyCommon proxy = new ProxyCommon()) { if (proxy.Service.SaveCaseDept(emrDept) < 0) { DialogBox.Msg("保存病历所属专科失败。"); return; } } } LoadCaseDept(caseVo.caseCode); } } }
private void m_mthFilter(int p_intElementID) { ProxyCommon proxy = new ProxyCommon(); lstTemplateSource = proxy.Service.GetElementTemplate(p_intElementID); proxy = null; if (lstTemplateSource != null) { foreach (EntityElementTemplate obj in lstTemplateSource) { obj.pyCode = SpellCodeHelper.GetPyCode(obj.colcontent); obj.wbCode = SpellCodeHelper.GetWbCode(obj.colcontent); } BindingListView <EntityElementTemplate> bindingSource = new BindingListView <EntityElementTemplate>(); bindingSource.AddRange(lstTemplateSource); this.clstElement.DisplayMember = EntityElementTemplate.Columns.colcontent; this.clstElement.ValueMember = EntityElementTemplate.Columns.serno; this.clstElement.DataSource = bindingSource; for (int i = 0; i < bindingSource.Count; i++) { this.clstElement.SetItemChecked(i, false); } } else { this.clstElement.DataSource = null; } }
/// <summary> /// Delete /// </summary> internal void Delete() { EntityEmrBasicInfo caseVo = GetCaseVo(); if (caseVo != null && caseVo.serNo > 0) { if (DialogBox.Msg("是否删除当前病历资料??\r\n\r\n" + "【" + caseVo.caseName + "】", MessageBoxIcon.Question) == DialogResult.Yes) { using (ProxyCommon proxy = new ProxyCommon()) { if (proxy.Service.DeleteCaseBasicInfo((int)caseVo.serNo, caseVo.caseCode)) { DialogBox.Msg("删除成功!"); this.New(); this.RefreshData(); } else { DialogBox.Msg("删除失败。"); } } } } else { this.New(); } }
public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors) { if (ProxyCommon.IsSetterOrGetter(method)) { return(interceptors); } return(interceptors.Where(i => !(i is HandleEventsInterceptor)).ToArray()); }
public void Intercept(IInvocation invocation) { invocation.Proceed(); BaseNotifyPropertyChangedAttribute attribute = ProxyCommon.AsAttribute <BaseNotifyPropertyChangedAttribute>(invocation.Method); if (attribute != null) { BaseNotifyPropertyChanged @base = invocation.InvocationTarget as BaseNotifyPropertyChanged; foreach (string property in attribute.PropertiesToNotify) { @base.OnPropertyChanged(property); } } }
public void Intercept(IInvocation invocation) { // Get all the set attributes. HandleEventsAttribute[] attributes = ProxyCommon.AsAttribute <HandleEventsAttribute[]>(invocation.Method); // The attribute can only be applied to Properties that are objects and have a getter. if (attributes == null || attributes.Length == 0) { invocation.Proceed(); return; } if (GetMethod(invocation, $"get_{attributes[0].MemberName}") != null) { // Need to remove the listeners before changing the object. foreach (HandleEventsAttribute attribute in attributes) { EditEvent ( attribute.MemberName, attribute.EventName, attribute.MethodName, invocation.InvocationTarget, /*removeEvent*/ true ); } } invocation.Proceed(); if (GetMethod(invocation, $"get_{attributes[0].MemberName}") != null) { // Need to add the listeners on new object foreach (HandleEventsAttribute attribute in attributes) { EditEvent ( attribute.MemberName, attribute.EventName, attribute.MethodName, invocation.InvocationTarget, /*removeEvent*/ false ); } } }
/// <summary> /// caseCode /// </summary> /// <param name="caseCode"></param> void LoadCaseDept(string caseCode) { using (ProxyCommon proxy = new ProxyCommon()) { DataSourceEmrDept = proxy.Service.GetCaseDept(caseCode); } if (DataSourceEmrDept != null && DataSourceEmrDept.Count > 0) { foreach (EntityEmrDept item in DataSourceEmrDept) { if (GlobalDic.DataSourceDepartment.Any(t => t.deptCode.Trim() == item.deptCode.Trim())) { item.deptName = GlobalDic.DataSourceDepartment.FirstOrDefault(t => t.deptCode.Trim() == item.deptCode.Trim()).deptName; } } } Viewer.gcDept.DataSource = DataSourceEmrDept; }
/// <summary> /// Init /// </summary> void Init() { #region 参数 List <EntityRptEventParm> EventParmData = null; using (ProxyEntityFactory proxy = new ProxyEntityFactory()) { EventParmData = EntityTools.ConvertToEntityList <EntityRptEventParm>(proxy.Service.SelectFullTable(new EntityRptEventParm())); } #endregion #region xr decimal printId = 0; EntitySysReport rptVo = null; if (EventParmData != null) { if (EventParmData.Any(t => t.eventId == "12" && t.keyId == "printId")) { printId = Function.Dec(EventParmData.FirstOrDefault(t => t.eventId == "12" && t.keyId == "printId").keyValue); } } if (printId > 0) { using (ProxyCommon proxy = new ProxyCommon()) { rptVo = proxy.Service.GetReport(printId); } } else { return; } xr = new XtraReport(); if (rptVo != null) { MemoryStream ms = new MemoryStream(); ms.Write(rptVo.rptFile, 0, rptVo.rptFile.Length); xr.LoadLayout(ms); } this.ucPrintControl.PrintingSystem = xr.PrintingSystem; xr.CreateDocument(); #endregion this.Stat(); }
/// <summary> /// Init /// </summary> void InitXr() { #region xr decimal printId = 9; EntitySysReport rptVo = null; using (ProxyCommon proxy = new ProxyCommon()) { rptVo = proxy.Service.GetReport(printId); } xr = new XtraReport(); if (rptVo != null) { MemoryStream ms = new MemoryStream(); ms.Write(rptVo.rptFile, 0, rptVo.rptFile.Length); xr.LoadLayout(ms); } xr.CreateDocument(); #endregion }
/// <summary> /// init /// </summary> void init() { string[] arrStr = null; string strTmp = string.Empty; DateTime dtmNow = DateTime.Now; this.dteDateStart.DateTime = new DateTime(dtmNow.Year, dtmNow.Month, 1); this.dteDateEnd.DateTime = dtmNow; using (ProxyAnaReport proxy = new ProxyAnaReport()) { strTmp = proxy.Service.GetSysParamStr("3069"); if (!string.IsNullOrEmpty(strTmp)) { arrStr = strTmp.Split('*'); foreach (string str in arrStr) { JyStr += "'" + str + "'" + ","; } JyStr = "(" + JyStr.TrimEnd(',') + ")"; } } decimal printId = 23; EntitySysReport rptVo = null; using (ProxyCommon proxy = new ProxyCommon()) { rptVo = proxy.Service.GetReport(printId); } xr = new XtraReport(); if (rptVo != null) { MemoryStream ms = new MemoryStream(); ms.Write(rptVo.rptFile, 0, rptVo.rptFile.Length); xr.LoadLayout(ms); } this.ucPrintControl.PrintingSystem = xr.PrintingSystem; xr.CreateDocument(); }
private void EditEvents(HandleEventsAttribute[] attributes, IInvocation invocation, bool removeEvent = false) { foreach (HandleEventsAttribute attribute in attributes) { EventInfo _event; object _obj; // CLEAN: This is ugly codeage bacause of eventing structure if (typeof(GameItem) == invocation.InvocationTarget.GetType().GetProperty(attribute.MemberName)?.PropertyType) { // Object->Property->Action->Event // LivingEntity.get_CurrentWeapon.get_Action.OnActionPerformed // CurrentWeapon.Action.OnActionPerformed -= RaiseActionPerformedEvent object _currentWeapon = invocation.InvocationTarget.GetType().GetProperty(attribute.MemberName).GetValue(invocation.InvocationTarget); _obj = _currentWeapon.GetType().GetProperty("Action").GetValue(_currentWeapon); _event = invocation.InvocationTarget.GetType().GetProperty(attribute.MemberName).PropertyType.GetProperty("Action").PropertyType.GetEvent(attribute.EventName);; } else { // Object->Property->Event // GameSession.get_CurrentMonster.ActionPerformed // CurrentMonster.ActionPerformed -= OnActionPerformed_CurrentMonster _obj = invocation.InvocationTarget.GetType().GetProperty(attribute.MemberName).GetValue(invocation.InvocationTarget); _event = invocation.InvocationTarget.GetType().GetProperty(attribute.MemberName).PropertyType.GetEvent(attribute.EventName); } MethodInfo _method = invocation.InvocationTarget.GetType().GetMethod(attribute.MethodName); Delegate d = Delegate.CreateDelegate ( _event.EventHandlerType, invocation.InvocationTarget, _method ); ProxyCommon.EditEvent(_event, _obj, d, removeEvent); } }
public bool ShouldInterceptMethod(Type type, MethodInfo methodInfo) { return(ProxyCommon.IsSetterOrGetter(methodInfo) || ProxyCommon.HasAttribute <HandleEventsAttribute>(methodInfo)); }
// Pointcut with error checking. public override bool ShouldInterceptMethod(Type type, MethodInfo methodInfo) { return(ProxyCommon.IsPropertyWithAttribute <BaseNotifyPropertyChangedAttribute>(type, methodInfo)); }
public override bool ShouldInterceptMethod(Type type, MethodInfo methodInfo) { return(ProxyCommon.IsPropertyWithAttribute <HandleEventsAttribute>(type, methodInfo)); }
/// <summary> /// LoadDicEmployee /// </summary> static void LoadDicEmployee() { try { using (ProxyCommon proxy = new ProxyCommon()) { EntityCodeOperator[] data1 = null; data1 = proxy.Service.GetEmployee(0); if (data1 != null && data1.Length > 0) { GlobalDic.DataSourceEmployee = data1.ToList(); } else { GlobalDic.DataSourceEmployee = new List <EntityCodeOperator>(); } data1 = proxy.Service.GetEmployee(1); if (data1 != null && data1.Length > 0) { GlobalDic.DataSourceDoctor = data1.ToList(); } else { GlobalDic.DataSourceDoctor = new List <EntityCodeOperator>(); } data1 = proxy.Service.GetEmployee(2); if (data1 != null && data1.Length > 0) { GlobalDic.DataSourceNurse = data1.ToList(); } else { GlobalDic.DataSourceNurse = new List <EntityCodeOperator>(); } GlobalDic.dicEmpRole = proxy.Service.GetEmpRoleList(); GlobalDic.DataSourceDefDeptEmployee = proxy.Service.GetDefDeptEmployee(); // EntityIcd[] icdDataSource = proxy.Service.GetIcd(); if (icdDataSource != null && icdDataSource.Length > 0) { GlobalDic.DataSourceICD = icdDataSource.ToList(); } } using (ProxyEntityFactory proxy1 = new ProxyEntityFactory()) { DataTable dt = null; dt = proxy1.Service.SelectFullTable(new EntityPlusOperator()); GlobalDic.DataSourceEmpDept = EntityTools.ConvertToEntityList <EntityPlusOperator>(dt); dt = proxy1.Service.SelectFullTable(new EntityDefOperatorRole()); GlobalDic.DataSourceEmpRole = EntityTools.ConvertToEntityList <EntityDefOperatorRole>(dt); dt = proxy1.Service.SelectFullTable(new EntityCodeRank()); GlobalDic.DataSourceRank = EntityTools.ConvertToEntityList <EntityCodeRank>(dt); } //GlobalDic.DataSourceEmployee = null; //GlobalDic.DataSourceEmployee = new List<EntityCodeOperator>(); //if (GlobalDic.DataSourceDoctor != null) //{ // GlobalDic.DataSourceEmployee.AddRange(GlobalDic.DataSourceDoctor); //} //if (GlobalDic.DataSourceNurse != null) //{ // GlobalDic.DataSourceEmployee.AddRange(GlobalDic.DataSourceNurse); //} } catch (Exception e) { throw e; } }
/// <summary> /// Save /// </summary> internal void Save() { EntityEmrBasicInfo caseVo = new EntityEmrBasicInfo(); if (Viewer.txtCaseCode.Tag != null) { caseVo = Viewer.txtCaseCode.Tag as EntityEmrBasicInfo; } if (lueCataDatalog.Any(t => t.catalogId + "^" == caseVo.caseCode)) { DialogBox.Msg("病历目录,无需保存。"); return; } caseVo.caseCode = Viewer.txtCaseCode.Text; caseVo.caseName = Viewer.txtCaseName.Text; caseVo.formId = Function.Int(Viewer.lueFormTemplate.Properties.DBValue); caseVo.printTemplateId = Function.Int(Viewer.luePrintTemplate.Properties.DBValue); caseVo.typeId = Viewer.cboFormType.SelectedIndex; caseVo.status = Viewer.cboFormStatus.SelectedIndex; caseVo.catalogId = Function.Int(Viewer.lueCaseCata.Properties.DBValue); caseVo.caseStyle = Viewer.cboCaseStyle.SelectedIndex; caseVo.attribute = Viewer.cboCaseAttribute.SelectedIndex - 1; caseVo.showCaseStatus = Viewer.chkShowFormStatus1.Checked ? 1 : 0; caseVo.specialFlag = Viewer.chkExpert1.Checked ? 1 : 0; caseVo.multiPageFlag = Viewer.chkMultPage1.Checked ? 1 : 0; caseVo.referenceType = Viewer.chkRef1.Checked ? 1 : 0; caseVo.bandingFlag = Viewer.chkBanding1.Checked ? 1 : 0; caseVo.timeType = Viewer.cboDateType.SelectedIndex; caseVo.lockDateDirector = Function.Int(Viewer.txtHeadOfDeptTime.EditValue); caseVo.timeLimit = Function.Int(Viewer.txtWriteLimitTime.EditValue); caseVo.lockDateQcDept = Function.Int(Viewer.txtQcOfDeptTime.EditValue); caseVo.timePeriod = Function.Int(Viewer.txtTimePeriod.EditValue); caseVo.aheadTime = Function.Int(Viewer.txtPriorTime.EditValue); caseVo.signLevel = Viewer.cboSigLevel.SelectedIndex; caseVo.dirDoctSignFlag = Viewer.chkHeadOfDeptCheck1.Checked ? 1 : 0; caseVo.supDoctSignFlag = Viewer.chkSuperDoctCheck1.Checked ? 1 : 0; caseVo.caseScope = 2; // 1 门诊病历; 2 住院病历 if (string.IsNullOrEmpty(caseVo.caseCode) || caseVo.caseCode.Trim() == string.Empty) { DialogBox.Msg("请输入病历编码"); Viewer.txtCaseCode.Focus(); return; } if (string.IsNullOrEmpty(caseVo.caseName) || caseVo.caseName.Trim() == string.Empty) { DialogBox.Msg("请输入病历名称"); Viewer.txtCaseName.Focus(); return; } List <EntityEmrDept> lstEmrDept = new List <EntityEmrDept>(); using (ProxyCommon proxy = new ProxyCommon()) { bool isNew = caseVo.serNo <= 0 ? true : false; if (proxy.Service.SaveCaseBasicInfo(ref caseVo, lstEmrDept)) { Viewer.txtCaseCode.Tag = caseVo; if (isNew) { this.RefreshData(); } DialogBox.Msg("保存成功"); } else { DialogBox.Msg("保存失败"); } } }