public void SetElementValue(string name, string value) { foreach (PElement element in this.Elements) { if (element is PDrawHeader) { PDrawHeader header = (PDrawHeader)element; if (header.Name == name) { header.Content = value; break; } } } }
public Document() { userinfo = new PUserInfo(this); format.LineAlignment = StringAlignment.Center; format.Alignment = StringAlignment.Center; format.FormatFlags = 0;// StringFormatFlags.DirectionRightToLeft; PPrintLog printLog = new PPrintLog(200, 98, Resource.logo.Width, Resource.logo.Height, "", this, (Image)Resource.logo); this.Elements.Add(printLog); PDrawTime p2 = new PDrawTime(89, 234, 0, 28, "时 间", this); this.Elements.Add(p2); //姓名 PDrawHeader pxm = new PDrawHeader(p2.X, 180, 200, 20, "姓名:", this); this.Elements.Add(pxm); //年龄 PDrawHeader pnl = new PDrawHeader(pxm.X + 130, pxm.Y, pxm.Width, pxm.Height, "年龄:", this); this.Elements.Add(pnl); //病室 PDrawHeader pbs = new PDrawHeader(pnl.X + 130, pxm.Y, pxm.Width, pxm.Height, "病室:", this); this.Elements.Add(pbs); //床号 PDrawHeader pch = new PDrawHeader(pbs.X + 130, pxm.Y, pxm.Width, pxm.Height, "床号:", this); this.Elements.Add(pch); //住院号 PDrawHeader pzyh = new PDrawHeader(pch.X + 130, pxm.Y, pxm.Width, pxm.Height, "住院号:", this); this.Elements.Add(pzyh); //孕 PDrawHeader py = new PDrawHeader(pxm.X, 210, 50, 20, "孕", this); this.Elements.Add(py); //产 PDrawHeader pc = new PDrawHeader(pxm.X + 25, py.Y, 50, 20, "产", this); this.Elements.Add(pc); PDrawHeader pyz = new PDrawHeader(pnl.X, py.Y, pnl.Width, pnl.Height, "孕周:", this); this.Elements.Add(pyz); PDrawHeader psg = new PDrawHeader(pbs.X, py.Y, pbs.Width, pbs.Height, "身高:", this); this.Elements.Add(psg); PDrawHeader ptz = new PDrawHeader(pch.X, py.Y, pch.Width, pch.Height, "体重:", this); this.Elements.Add(ptz); PWgCurve pwg = new PWgCurve(p2.X, p2.RealBottom, this); userinfo.Pwg = pwg; p2.Width = pwg.Width; this.Elements.Add(pwg); PDrawTimeHours pth = new PDrawTimeHours(p2.X, pwg.RealBottom, p2.Width, 28, "", this); this.Elements.Add(pth); PTxy txy = new PTxy(p2.X, pth.RealBottom, p2.Width, 28, "胎心音", this); this.Elements.Add(txy); PTm tm = new PTm(p2.X, txy.RealBottom, p2.Width, 28, "胎 膜", this); this.Elements.Add(tm); PYs ys = new PYs(p2.X, tm.RealBottom, p2.Width, 28, "羊 水", this); this.Elements.Add(ys); PGs gs = new PGs(p2.X, ys.RealBottom, p2.Width, 28, "宫 缩", this); this.Elements.Add(gs); PXy xy = new PXy(p2.X, gs.RealBottom, p2.Width, 28, "血 压", this); this.Elements.Add(xy); POther other = new POther(p2.X, xy.RealBottom, p2.Width, 268, "治疗及其他", this); this.Elements.Add(other); PQm qm = new PQm(p2.X, other.RealBottom, p2.Width, 60, "签 名", this); this.Elements.Add(qm); }