⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 procpathfindingsform.ascx.cs

📁 医疗决策支持系统
💻 CS
字号:
namespace Caisis.UI.Modules.All.DataEntryForms
{
	using System;
	using System.Data;
	using System.Data.SqlClient;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Collections;
	using System.Collections.Specialized;

	using Caisis.Controller;
	using Caisis.DataAccess;
	using Caisis.BusinessObject;

	using Caisis.UI.Core.Classes;

	public abstract class ProcPathFindingsForm : DataGridControl
	{

		override protected DataEntryController GetController()
		{
			return new DataGridController(new PathologyFindingDa(), PathologyFinding.ProcPathFindingId);
		}

		override protected void SetDataEntryInfo()
		{
			this._tableInfo = "ProcPathFindings";
			this._dataEntryTitle = "<a href=\"DataEntryContainer.aspx?dataForm=ProceduresForm&primKey="+Request.QueryString["parentKey"]+"\"> Procedures</a> > Pathology Findings";
			}

		protected override DataTable PhysicalDataRead()
		{
			DataGridController ct = new DataGridController(new PathologyFindingDa(), PathologyFinding.ProcPathFindingId);
			DataSet ds = ct.GetDataGridRecords(int.Parse(Request.QueryString["parentKey"].ToString()));
			return ds.Tables[0];
		}

		protected override DataSet GetGridRow(DataGridCommandEventArgs e)
		{
			PathologyFinding biz = new PathologyFinding();
			DataSet ds = new DataSet();
			ds.Tables.Add(biz);
			DataRow dr = biz.NewRow();

			
			HtmlSelect PathFindSide			= (HtmlSelect) e.Item.FindControl("PathFindSide");
			//HtmlSelect PathFindSite			= (HtmlSelect) e.Item.FindControl("PathFindSite");
			TextBox PathFindSite			= (TextBox) e.Item.Cells[2].Controls[0];
			PathFindSite.Width				= 100;
			//HtmlSelect PathFindSubsite		= (HtmlSelect) e.Item.FindControl("PathFindSubsite");
			TextBox PathFindSubsite			= (TextBox) e.Item.Cells[3].Controls[0];
			PathFindSubsite.Width				= 100;
			//HtmlSelect PathFindHistology	= (HtmlSelect) e.Item.FindControl("PathFindHistology");
			TextBox PathFindHistology		= (TextBox) e.Item.Cells[4].Controls[0];
			PathFindHistology.Width			= 100;
			TextBox PathFindHeight			= (TextBox) e.Item.Cells[5].Controls[0];
			PathFindHeight.Width			= 100;
			TextBox PathFindWidth			= (TextBox) e.Item.Cells[6].Controls[0];
			PathFindWidth.Width				= 100;
			TextBox PathFindLength			= (TextBox) e.Item.Cells[7].Controls[0];
			PathFindLength.Width			= 100;
			HtmlSelect PathFindGrade		= (HtmlSelect) e.Item.FindControl("PathFindGrade");
			HtmlSelect PathFindResult		= (HtmlSelect) e.Item.FindControl("PathFindResult");
			TextBox updateTime				= (TextBox) e.Item.FindControl("UpdateTime");

			
			dr[PathologyFinding.ProcedureId]		= Request.QueryString["parentKey"].ToString();
			dr[PathologyFinding.ProcPathFindingId]	= grid.DataKeys[e.Item.ItemIndex];
			dr[PathologyFinding.PathFindSide]		= Request.Form[PathFindSide.UniqueID].ToString();
			//should be COMBOBOX dr[PathologyFinding.PathFindSite]		= Request.Form[PathFindSite.UniqueID].ToString();
			//should be COMBOBOX dr[PathologyFinding.PathFindSubsite]	= Request.Form[PathFindSubsite.UniqueID].ToString();
			//should be COMBOBOX dr[PathologyFinding.PathFindHistology]	= Request.Form[PathFindHistology.UniqueID].ToString();
			dr[PathologyFinding.PathFindSite]		= PathFindSite.Text;
			dr[PathologyFinding.PathFindSubsite]	= PathFindSubsite.Text;
			dr[PathologyFinding.PathFindHistology]	= PathFindHistology.Text;
			dr[PathologyFinding.PathFindHeight]		= PathFindHeight.Text;
			dr[PathologyFinding.PathFindWidth]		= PathFindWidth.Text;
			dr[PathologyFinding.PathFindLength]		= PathFindLength.Text;
			dr[PathologyFinding.PathFindGrade]		= Request.Form[PathFindGrade.UniqueID].ToString();
			dr[PathologyFinding.PathFindResult]		= Request.Form[PathFindResult.UniqueID].ToString();

			dr[BizObject.UpdatedTime]				= PageUtil.ObjToDateTime(updateTime.Text);

			biz.Rows.Add(dr);
			return ds;
		}

		public void ItemBound(Object sender, DataGridItemEventArgs e)
		{
			if(e.Item.ItemType == ListItemType.EditItem)
			{
				DataRowView drv = (DataRowView) e.Item.DataItem;

				//make objects below lowercase to differ from above method and match Lkp Arguments
			
				
				HtmlSelect pathfindside			= (HtmlSelect) e.Item.FindControl("PathFindSide");
				//HtmlSelect pathfindsite			= (HtmlSelect) e.Item.FindControl("PathFindSite");
				//HtmlSelect pathfindsubsite		= (HtmlSelect) e.Item.FindControl("PathFindSubsite");
				//HtmlSelect pathfindhistology	= (HtmlSelect) e.Item.FindControl("PathFindHistology");
				TextBox pathfindsite			= (TextBox) e.Item.Cells[5].Controls[0];
				pathfindsite.Width			= 100;
				TextBox pathfindsubsite			= (TextBox) e.Item.Cells[5].Controls[0];
				pathfindsubsite.Width			= 100;
				TextBox pathfindhistology			= (TextBox) e.Item.Cells[5].Controls[0];
				pathfindhistology.Width			= 100;
				TextBox pathfindheight			= (TextBox) e.Item.Cells[5].Controls[0];
				pathfindheight.Width			= 100;
				TextBox pathfindwidth			= (TextBox) e.Item.Cells[6].Controls[0];
				pathfindwidth.Width				= 100;
				TextBox pathfindlength			= (TextBox) e.Item.Cells[7].Controls[0];
				pathfindlength.Width			= 100;
				HtmlSelect pathfindgrade		= (HtmlSelect) e.Item.FindControl("PathFindGrade");
				HtmlSelect pathfindresult		= (HtmlSelect) e.Item.FindControl("PathFindResult");

			
				PageUtil.FillLkpDropDown(pathfindside, "FindSide");
				PageUtil.SelectDropDownItem(pathfindside, drv[PathologyFinding.PathFindSide].ToString());
				//PageUtil.FillLkpDropDown(pathfindsite, "");
				//PageUtil.SelectDropDownItem(pathfindsite, drv[PathologyFinding.PathFindSite].ToString());
				//PageUtil.FillLkpDropDown(pathfindsubsite, "");
				//PageUtil.SelectDropDownItem(pathfindsubsite, drv[PathologyFinding.PathFindSubsite].ToString());
				//PageUtil.FillLkpDropDown(pathfindhistology, "");
				//PageUtil.SelectDropDownItem(pathfindhistology, drv[PathologyFinding.PathFindHistology].ToString());
				PageUtil.FillLkpDropDown(pathfindgrade, "PathGrade");
				PageUtil.SelectDropDownItem(pathfindgrade, drv[PathologyFinding.PathFindGrade].ToString());
				PageUtil.FillLkpDropDown(pathfindresult, "Result");
				PageUtil.SelectDropDownItem(pathfindresult, drv[PathologyFinding.PathFindResult].ToString());

				//
				TextBox procId = (TextBox) e.Item.FindControl("ProcedureId");
				procId.Text = drv[PathologyFinding.ProcedureId].ToString();
				TextBox updateTime = (TextBox)e.Item.FindControl("UpdateTime");
				updateTime.Text = drv[BizObject.UpdatedTime].ToString();
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -