某医院体检结果在线查询系统毕业设计(论文)word格式(7)

2019-02-15 16:46

DataTable table1 = new DataTable();

DbDataAdapter adapter1 = this.CreatAdapter();

adapter1.SelectCommand = this.CreatCommand(commandText, paraValue); try {

adapter1.Fill(table1); } finally {

adapter1.Dispose(); }

return table1; }

public void ExecuteNonQuery(string commandText) {

string[] textArray1 = new string[0];

this.ExecuteNonQuery(commandText, textArray1); }

public void ExecuteNonQuery(string commandText, object[] paraValue) {

this.CreatCommand(commandText, paraValue).ExecuteNonQuery(); }

public void ExecuteNonQuery(string commandText, string[] paraValue) {

this.CreatCommand(commandText, paraValue).ExecuteNonQuery(); }

public object ExecuteScalar(string commandText) {

string[] textArray1 = new string[0];

return this.CreatCommand(commandText, textArray1).ExecuteScalar(); }

public object ExecuteScalar(string commandText,object[] paraValue) {

return this.CreatCommand(commandText,paraValue).ExecuteScalar(); }

public object ExecuteScalar(string commandText,string[] paraValue) {

return this.CreatCommand(commandText,paraValue).ExecuteScalar(); } } }

(2)、根据XML文件生成表格类(MakeTable.cs):

using System;

using System.Data;

using System.Configuration; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml; namespace Zhigu.Common {

///

/// 根据XML文件生成Table对象 ///

public class MakeTable {

public MakeTable() { //

// TODO: 在此处添加构造函数逻辑 // }

#region 根据XML文件生成Table ///

/// 根据XML文件生成Table ///

/// ///

public Table MakeTableByXml(string _XmlFileName) {

int iSpan = Zhigu.Common.StaticVariable.CellsForOneRow; Table Table1 = new Table(); Table1.Width = Unit.Parse(\); Table1.CellPadding = 0; Table1.CellSpacing = 1;

Table1.BackColor = System.Drawing.Color.White; XmlDataSource XmlDataSource1 = new XmlDataSource(); XmlDataSource1.DataFile = _XmlFileName;

XmlDocument doc = XmlDataSource1.GetXmlDocument(); XmlElement xRoot = doc.DocumentElement; TableRow trTitle = new TableRow(); TableCell tcTitle = new TableCell(); Label LblUserName = new Label(); Label LblInfo = new Label();

LblInfo.Text = \的体检结果:\;

LblUserName.Text = xRoot.Name;//整编文档的根节点 此处为“未命名” LblUserName.Font.Bold = true;

LblUserName.ForeColor = System.Drawing.Color.Red; tcTitle.Controls.Add(LblUserName); tcTitle.Controls.Add(LblInfo); tcTitle.ColumnSpan = iSpan;

tcTitle.HorizontalAlign = HorizontalAlign.Left; tcTitle.Height = Unit.Parse(\); trTitle.Controls.Add(tcTitle); Table1.Rows.Add(trTitle); if (xRoot.HasChildNodes) {

for (int i = 0; i < xRoot.ChildNodes.Count; i++) {

TableRow tr = new TableRow(); TableCell td = new TableCell(); XmlNode xN = xRoot.ChildNodes[i]; Label LblkeshiName = new Label();

LblkeshiName.Text = \ + xN.Name + \体检详细情况:\;

Image img = new Image(); img.ID = \ + i.ToString(); img.ImageUrl = \; img.AlternateText = \展开详细内容\; td.Controls.Add(img);

td.Controls.Add(LblkeshiName);

tr.Attributes.Add(\, \); tr.Attributes.Add(\, \);

td.Attributes.Add(\, \ + i.ToString() + \);

td.ToolTip = \展开详细内容\;

tr.HorizontalAlign = HorizontalAlign.Left; tr.Font.Bold = true; tr.Cells.Add(td); Table1.Rows.Add(tr); if (xN.HasChildNodes) {

TableRow trInfo = new TableRow(); TableCell tcInfo = new TableCell(); Panel pan = new Panel(); pan.ID = \ + i.ToString();

pan.Attributes.Add(\,\);

Table tableInfo = new Table(); tableInfo.Width = Unit.Parse(\); tableInfo.CellPadding = 5; tableInfo.CellSpacing = 1; tableInfo.BorderWidth = 1;

tableInfo.BorderWidth = Unit.Parse(\);

for (int j = 0; j < xN.ChildNodes.Count; ) {

TableRow tr1 = new TableRow(); if (j - (iSpan * (j / iSpan)) == 0) {

tr1.Attributes.Add(\, \); } else {

tr1.Attributes.Add(\, \); }

for (int jj = 1; jj < iSpan / 2; jj++) {

if (xN.ChildNodes[j] != null) {

TableCell tc1 = new TableCell();

tc1.HorizontalAlign = HorizontalAlign.Right; tc1.Width = Unit.Parse(\);

tc1.Text = xN.ChildNodes[j].Name + \:\; tr1.Cells.Add(tc1);

TableCell tc2 = new TableCell();

tc2.HorizontalAlign = HorizontalAlign.Left; tc2.Width = Unit.Parse(\); tc2.Text = xN.ChildNodes[j].InnerText; tr1.Cells.Add(tc2); j++; }

if (xN.ChildNodes[j] != null) {

TableCell tc3 = new TableCell();

tc3.HorizontalAlign = HorizontalAlign.Right; tc3.Width = Unit.Parse(\);

tc3.Text = xN.ChildNodes[j].Name + \:\; tr1.Cells.Add(tc3);

TableCell tc4 = new TableCell();

tc4.HorizontalAlign = HorizontalAlign.Left;

tc4.Width = Unit.Parse(\); tc4.Text =

xN.ChildNodes[j].InnerText;//.Replace(xN.ChildNodes[j].Name, \ tr1.Cells.Add(tc4); j++; } }

tableInfo.Rows.Add(tr1); }

pan.Controls.Add(tableInfo); tcInfo.Controls.Add(pan); trInfo.Cells.Add(tcInfo); Table1.Rows.Add(trInfo); } } }

XmlDataSource1.Dispose(); return Table1; }

#endregion }

}

(3)、通用函数类(StaticFunction.cs):

using System; using System.Data;

using System.Configuration; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Text.RegularExpressions; using System.IO; namespace Zhigu.Common {

///

/// 静态方法过程类 ///

public class StaticFunction {

#region 根据提示信息、出错返回方式及返回地址生成Javascript代码 ///


某医院体检结果在线查询系统毕业设计(论文)word格式(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:电视节目导播

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: