/// <summary> /// 获取数据源 /// </summary> protected override void BuildData(Dictionary <string, DataTable> dataSource) { string patientId = ExtendAppContext.Current.PatientInformationExtend.PATIENT_ID; int visitId = ExtendAppContext.Current.PatientInformationExtend.VISIT_ID; int operId = ExtendAppContext.Current.PatientInformationExtend.OPER_ID; List <MED_ANESTHESIA_EVENT> _anesEvent = DataContext.GetCurrent().GetAnesthesiaEvent("0"); dataSource["AnesAllEvent"] = new ModelHandler <MED_ANESTHESIA_EVENT>().FillDataTable(_anesEvent); dataSource["MED_OPERATION_MASTER"] = DataContext.GetCurrent().GetData("MED_OPERATION_MASTER"); dataSource["MED_OPERATION_MASTER_EXT"] = DataContext.GetCurrent().GetData("MED_OPERATION_MASTER_EXT"); dataSource["MED_PAT_MASTER_INDEX"] = DataContext.GetCurrent().GetData("MED_PAT_MASTER_INDEX"); dataSource["MED_PAT_VISIT"] = DataContext.GetCurrent().GetData("MED_PAT_VISIT"); dataSource["MED_ANESTHESIA_INPUT_DATA"] = DataContext.GetCurrent().GetData("MED_ANESTHESIA_INPUT_DATA"); dataSource["MED_PATS_IN_HOSPITAL"] = DataContext.GetCurrent().GetData("MED_PATS_IN_HOSPITAL"); int chuFangClass = this.Name.Equals("麻醉处方单") ? 1 : 2; dataSource["MED_CHUFANG_RECORD"] = DataContext.GetCurrent().GetMedChuFangRecordList(patientId, visitId, operId, chuFangClass); // 获得斜线面板 if (null == this.xieLinePanel) { List <MPanel> panelList = this.GetControls <MPanel>(); foreach (MPanel npb in panelList) { if (null != npb.Tag && npb.Tag.ToString().Equals("斜线")) { this.xieLinePanel = npb; this.xieLinePanel.CustomDraw += MPanel_CustomDraw; break; } } } }
public override void SetDefault() { Variables = null; GroupingVariables = null; Mean = new Mean() { Visible = false }; CMean = new CMean() { Visible = false }; IQRBox = new IQRBox() { Visible = true }; RBox = new RangeBox() { Visible = false }; Outlier = new Outlier() { Visible = true }; Individual = new Individual() { Visible = false }; Whisker = new Whisker() { Visible = true }; YScale = new ContScale(ScaleDirection.Y_Axis); XScale = new CateScale(ScaleDirection.X_Axis); Panel = new MPanel(); MeanDatlab = new Meanlab(); IndivDatlab = new Indivlab(); //MeanDatlab.GetCommand = () => //{ // if (!MeanDatlab.Visible) return ""; // if (MeanDatlab.DatlabType == Component.Datlab.DisplayType.Column && MeanDatlab.LabelColumn == null) return "# 未指定給 Datlab 欄位\r\n"; // StringBuilder cmnd = new StringBuilder(); // switch (MeanDatlab.DatlabType) // { // case Component.Datlab.DisplayType.YValue: // cmnd.AppendLine(" Mealab;"); // cmnd.AppendLine(" YValue;"); // break; // case Component.Datlab.DisplayType.RowNumber: // cmnd.AppendLine(" Mealab;"); // cmnd.AppendLine(" Rownum;"); // break; // case Component.Datlab.DisplayType.Column: // cmnd.AppendFormat(" Mealab {0};\r\n", MeanDatlab.LabelColumn); // break; // } // if (MeanDatlab.FontColor > 0) cmnd.AppendFormat(" TColor {0};\r\n", MeanDatlab.FontColor); // if (MeanDatlab.FontSize > 0) cmnd.AppendFormat(" PSize {0};\r\n", MeanDatlab.FontSize); // if (MeanDatlab.Bold) cmnd.AppendLine(" Bold;"); // if (MeanDatlab.Italic) cmnd.AppendLine(" Italic;"); // if (MeanDatlab.Underline) cmnd.AppendLine(" Underline;"); // if (MeanDatlab.Angle < MtbTools.MISSINGVALUE) cmnd.AppendFormat(" Angle {0};\r\n", MeanDatlab.Angle); // if (MeanDatlab.Offset != null) cmnd.AppendFormat(" Offset {0};\r\n", string.Join(" &\r\n", MeanDatlab.Offset)); // if (MeanDatlab.Placement != null) cmnd.AppendFormat(" Placement {0};\r\n", string.Join(" &\r\n", MeanDatlab.Placement)); // foreach (LabelPosition pos in MeanDatlab.PositionList) // { // cmnd.Append(pos.GetCommand()); // } // cmnd.Append(Legend.GetCommand()); // return cmnd.ToString(); //}; GetCommand = DefaultCommand; }
protected void AddTableByLine() { try { object[] objects = propertyGrid1.SelectedObjects; if (objects == null || objects.Length == 0) { return; } MPanel mpanel = objects[0] as MPanel; if (mpanel == null) { return; } int maxy = 0; foreach (Control ctrl in mpanel.Controls) { if (ctrl.Bottom > maxy) { maxy = ctrl.Bottom; } } TableCreatorDlg tableCreator = new TableCreatorDlg(mpanel.Size); XtraForm dialogHostForm = new XtraForm(); tableCreator.TablePos = new Point(0, maxy); dialogHostForm.Width = 705; dialogHostForm.Height = 390; dialogHostForm.Text = "创建表格"; tableCreator.Dock = DockStyle.Fill; dialogHostForm.Controls.Add(tableCreator); if (dialogHostForm.ShowDialog() == DialogResult.OK) { Type tp = Type.GetType("MedicalSystem.Anes.Document.Controls.MedMyLine"); int allRowHeight = Convert.ToInt32(tableCreator.AllRowHeight); int allColWidth = Convert.ToInt32(tableCreator.AllColWidth); // 加入横线 int currentPos = tableCreator.TablePos.Y; for (int i = 0; i < tableCreator.RowHeight.Length; i++) { if (i > 0) { MedMyLine line1 = CurrentDocumentsHostControl.DesignerHost.CreateComponent(tp) as MedMyLine; line1.Location = new Point(tableCreator.TablePos.X, currentPos); line1.Width = allColWidth; line1.Height = 1; line1.LineType = MedMyLine.InnerLineType.Horizontal; line1.Parent = mpanel; } currentPos += Convert.ToInt32(tableCreator.RowHeight[i]); if (i == tableCreator.RowHeight.Length - 1) { MedMyLine line1 = CurrentDocumentsHostControl.DesignerHost.CreateComponent(tp) as MedMyLine; line1.Location = new Point(tableCreator.TablePos.X, currentPos); line1.Width = allColWidth; line1.Height = 1; line1.LineType = MedMyLine.InnerLineType.Horizontal; line1.Parent = mpanel; } } // 加入竖线 currentPos = tableCreator.TablePos.X; for (int i = 0; i < tableCreator.ColWidth.Length; i++) { if (i > 0) { MedMyLine line1 = CurrentDocumentsHostControl.DesignerHost.CreateComponent(tp) as MedMyLine; line1.Location = new Point(currentPos, tableCreator.TablePos.Y); line1.Width = 1; line1.Height = allRowHeight; line1.LineType = MedMyLine.InnerLineType.Vertical; line1.Parent = mpanel; } currentPos += Convert.ToInt32(tableCreator.ColWidth[i]); } } } catch { } }