/// <summary> /// 计算Steward分值 /// </summary> private void CaluStewardScore(List <CustomControl> listCtrl) { int score = 0; foreach (var item in listCtrl) { if (item.SimpleValue != null && item.SimpleValue.ToString() != "") { string str = Regex.Replace(item.SimpleValue.ToString(), @"[^\d.\d]", ""); score += int.Parse(str); } } // 显示总分值 List <MTextBox> listTextBox = ReportViewer.GetControls <MTextBox>(); foreach (var item in listTextBox) { if (item.Name.Equals("MTextBoxStewardScore")) { item.Text = score.ToString(); break; } } }
/// <summary> /// 在控件全部生成和绑定数据完成后,给自定义控件添加ValueChanged事件 /// </summary> /// <param name="handlers"></param> /// <param name="dataSources"></param> protected override void OnViewBuilded(List <IUIElementHandler> handlers, Dictionary <string, DataTable> dataSources) { base.OnViewBuilded(handlers, dataSources); List <CustomControl> listCtrl = ReportViewer.GetControls <CustomControl>().Where(x => x.Name.Contains("ctrl")).ToList(); foreach (var item in listCtrl) { item.ValueChanged += StewardScoreBox_Click; } }
protected override void OnViewBuilded(List <IUIElementHandler> handlers, Dictionary <string, DataTable> dataSources) { base.OnViewBuilded(handlers, dataSources); List <MTextBox> txtBoxList = ReportViewer.GetControls <MTextBox>(); foreach (MTextBox txtBox in txtBoxList) { if (txtBox.SummaryName == "总输液量") { txtBox.Text = GetSummaryText("3"); } else if (txtBox.SummaryName == "总输血量") { txtBox.Text = GetSummaryText("B"); } } }
protected override void OnViewBuilded(List <IUIElementHandler> handlers, Dictionary <string, DataTable> dataSources) { base.OnViewBuilded(handlers, dataSources); List <MTextBox> txtBoxList = ReportViewer.GetControls <MTextBox>(); foreach (MTextBox tb in txtBoxList) { if (null != tb.SourceTableName && null != tb.SourceFieldName && tb.SourceTableName.Equals("MED_POSTOPERATIVE_EXTENDED") && tb.SourceFieldName.Equals("术后.日期")) { if (tb.Data == null || tb.Data.ToString() == "") { tb.Data = ((DateTime)dataSources["MED_OPERATION_MASTER"].Rows[0]["SCHEDULED_DATE_TIME"]).AddDays(1.0).ToString("yyyy-MM-dd"); tb.Text = ((DateTime)dataSources["MED_OPERATION_MASTER"].Rows[0]["SCHEDULED_DATE_TIME"]).AddDays(1.0).ToString("yyyy-MM-dd"); } break; } } }
/// <summary> /// 再自定义控件值变更时计算Steward分 /// </summary> private void StewardScoreBox_Click(object sender, EventArgs e) { CustomControl ctrl = sender as CustomControl; List <CustomControl> listCtrl = ReportViewer.GetControls <CustomControl>().Where(x => x.Name.Contains("ctrl")).ToList(); if (ctrl.SimpleValue != null && ctrl.SimpleValue.ToString() != "") { List <CustomControl> listSameType = listCtrl.FindAll(x => x.Name.Contains(ctrl.Name.Substring(0, ctrl.Name.Length - 2))); foreach (var item in listSameType) { if (item != ctrl) { item.SimpleValue = null; } } } this.CaluStewardScore(listCtrl); }
protected override void RescueMode() { MedVitalSignGraph vitalSignGraph = null; MedDrugGraph drugGraph = null; MedGridGraph gridGraph = null; List <MedVitalSignGraph> vitalSignGraphs = ReportViewer.GetControls <MedVitalSignGraph>(); List <MedDrugGraph> drugGraphs = ReportViewer.GetControls <MedDrugGraph>(); List <MedGridGraph> gridGraphs = ReportViewer.GetControls <MedGridGraph>(); if (vitalSignGraphs.Count > 0) { vitalSignGraph = vitalSignGraphs[0]; if (!ExtendApplicationContext.Current.IsRescueMode) { ExtendApplicationContext.Current.OldMinScaleCount = vitalSignGraph.MinScaleCount; } } if (drugGraphs.Count > 0) { drugGraph = drugGraphs[0]; } if (gridGraphs.Count > 0) { gridGraph = gridGraphs[0]; } base.RescueMode(); if (ExtendApplicationContext.Current.IsRescueMode) { switch (vitalSignGraph.ScaleType) { case ScaleType.HalfHour: vitalSignGraph.MinScaleCount = 30; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 30; gridGraph.MinScaleCount = 30; break; case ScaleType.Hour: vitalSignGraph.MinScaleCount = 60; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 60; gridGraph.MinScaleCount = 60; break; case ScaleType.OneMin: vitalSignGraph.MinScaleCount = 1; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 1; gridGraph.MinScaleCount = 1; break; case ScaleType.Quarter: vitalSignGraph.MinScaleCount = 15; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 15; gridGraph.MinScaleCount = 15; break; case ScaleType.TenMin: vitalSignGraph.MinScaleCount = 10; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 10; gridGraph.MinScaleCount = 10; break; case ScaleType.TriQuarter: vitalSignGraph.MinScaleCount = 45; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 45; gridGraph.MinScaleCount = 45; break; case ScaleType.TwiHour: vitalSignGraph.MinScaleCount = 120; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 120; gridGraph.MinScaleCount = 120; break; case ScaleType.TwoMin: vitalSignGraph.MinScaleCount = 2; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 2; gridGraph.MinScaleCount = 2; break; case ScaleType.FiveMin: vitalSignGraph.MinScaleCount = 5; vitalSignGraph.OnlyShowFileMinute = false; drugGraph.MinScaleCount = 5; gridGraph.MinScaleCount = 5; break; } } else { vitalSignGraph.MinScaleCount = ExtendApplicationContext.Current.OldMinScaleCount; vitalSignGraph.OnlyShowFileMinute = true; drugGraph.MinScaleCount = ExtendApplicationContext.Current.OldMinScaleCount; gridGraph.MinScaleCount = ExtendApplicationContext.Current.OldMinScaleCount; } this.RefreshData(); }