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

📄 procorchiectomiesform.ascx.cs

📁 医疗决策支持系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace Caisis.UI.Modules.Testis.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 System.Web.UI;

	using Caisis.UI.Core.Classes;
	using Caisis.UI.Core.Classes.CustomControls;



	public abstract class ProcOrchiectomiesForm : DataEntryControl
	{

//		protected HtmlInputHidden SurgeryId;
		protected HtmlSelect SurgeryId;

		protected HtmlInputText OpCPT_Code;
		protected HtmlInputText OpCPT_Description;
		protected ComboBox OpSurgeon;
		protected HtmlSelect OpSurgeonType;
		protected ComboBox OpAssistant;
		protected HtmlSelect OpAssistantType;
		protected HtmlSelect OpType;
		protected HtmlSelect OpSide;
		protected HtmlTextArea OpNotes;
		protected HtmlInputText PathNum;
		protected HtmlInputText OrchDateText;
		protected HtmlInputText OrchDate;
		protected HtmlSelect PathExtension;
		protected HtmlSelect PathGrade;
		protected ComboBox PathHistology;
		protected HtmlSelect PathStageSystem;
		protected HtmlSelect PathStageT;
		protected HtmlSelect PathVascularInv;
		protected HtmlSelect PathSpermaticCordInv;
		protected HtmlSelect PathScrotalInv;
		protected HtmlSelect PathEpididymisInv;
		protected HtmlSelect PathReteTestisInv;
		protected HtmlSelect PathTunicaAlbugineaInv;
		protected HtmlInputText PathCancerMaxDim;
		protected HtmlSelect PathITGCN;
		protected HtmlInputText PathOtherTestis;
		protected ComboBox Pathologist;
		protected HtmlTextArea PathNotes;
		protected ComboBox PathDataSource;
		protected HtmlSelect PathQuality;
		protected HtmlInputHidden ProcOrchiectomyId;

		protected HtmlImage OrchDateTextCal;
		protected Literal setSurgeryDateJsVar;


		protected Repeater rptStages;

		protected HtmlAnchor StagingInfoLink;


		override protected void Page_Load(object sender, System.EventArgs e)
		{
			//set parentKey if value is passed to page
//			PageUtil.SetParentKey(SurgeryId);

			//populate from distinct values
			SurgeryDa da = new SurgeryDa();
			DataSet surgeryDs = da.GetRecords(this.patientID);
			
			if (surgeryDs.Tables.Count > 0)
			{
				SurgeryId.DataSource = surgeryDs.Tables[0].DefaultView;
				SurgeryId.DataValueField	= "SurgeryId";
				SurgeryId.DataTextField		= "SurgDateText";
				SurgeryId.DataBind();
				SurgeryId.Items.Insert(0,new ListItem(""));

				PageUtil.SelectDropDownItem(SurgeryId, ViewState[SurgeryId.UniqueID]);

//				Page.RegisterClientScriptBlock("setSurgeryDateJsVar", "<SCRIPT LANGUAGE=javascript>if(document.getElementById('" + SurgeryId.ClientID + "').options[document.getElementById('" + SurgeryId.ClientID + "').options.selectedIndex].innerText != '') surgeryDateIsSet = true;</SCRIPT>");



				SurgeryId.Attributes.Add("onchange", "setSurgeryChildDate('" + SurgeryId.ClientID + "', '" + OrchDateText.ClientID + "', '" + OrchDate.ClientID + "');");
				
				OrchDateText.Attributes.Add("onfocus", "checkIfSurgeryDateIsSet(document.getElementById('" + OrchDateText.ClientID + "'));");

			}

			
			//populate look up and distinct value select boxes
			//PageUtil.FillLkpDropDown(OpCPT_Code, "OpCPT_Code", ViewState);
			PageUtil.FillLkpDropDown(OpSurgeonType, "OpSurgeonType", ViewState);
			PageUtil.FillLkpDropDown(OpAssistantType, "OpSurgeonType", ViewState);
			PageUtil.FillLkpDropDown(OpType, "OpTypeOrchiectomy", ViewState);
			PageUtil.FillLkpDropDown(OpSide, "FindSide", ViewState);
			PageUtil.FillLkpDropDown(PathExtension, "PathExtension", ViewState);
			PageUtil.FillLkpDropDown(PathGrade, "PathGrade", ViewState);
			PageUtil.FillLkpDropDown(PathStageSystem, "StagingSystem", ViewState);

			SetStageSelects();

//			PageUtil.FillLkpDropDown(PathStageT, "TestisPathStageT", ViewState);
			PageUtil.FillLkpDropDown(PathVascularInv, "YesNoUnknown", ViewState);
			PageUtil.FillLkpDropDown(PathSpermaticCordInv, "Invasion", ViewState);
			PageUtil.FillLkpDropDown(PathScrotalInv, "Invasion", ViewState);
			PageUtil.FillLkpDropDown(PathEpididymisInv, "Invasion", ViewState);
			PageUtil.FillLkpDropDown(PathReteTestisInv, "Invasion", ViewState);
			PageUtil.FillLkpDropDown(PathTunicaAlbugineaInv, "Invasion", ViewState);
			PageUtil.FillLkpDropDown(PathITGCN, "YesNoUnknown", ViewState);
			//Not needed with the change to a text field
			//PageUtil.FillLkpDropDown(PathOtherTestis, "PathHistologyTestis", ViewState);
			PageUtil.FillLkpDropDown(PathQuality, "DataQuality", ViewState);

			//create arrays that populate combo boxes
			
			Page.RegisterClientScriptBlock("OpSurgeon", PageUtil.FillComboDropDown(OpSurgeon.RefBy, "OpSurgeon"));
			Page.RegisterClientScriptBlock("OpAssistant", PageUtil.FillComboDropDown(OpAssistant.RefBy, "OpSurgeon"));
			Page.RegisterClientScriptBlock("PathHistology", PageUtil.FillComboDropDown(PathHistology.RefBy, "PathHistologyTestis"));
			Page.RegisterClientScriptBlock("Pathologist", PageUtil.FillComboDropDown(Pathologist.RefBy, "Pathologist"));
			Page.RegisterClientScriptBlock("PathDataSource", PageUtil.FillComboDropDown(PathDataSource.RefBy, "DataSource"));

			string reqFieldArray = PageUtil.CreateValidationScript("");
			Page.RegisterClientScriptBlock("requiredFieldArray", reqFieldArray);

			PageUtil.AddCalendarFunction(OrchDateTextCal, OrchDateText);
			PageUtil.AddFuzzyDateFunction(OrchDateText, OrchDate);


			base.Page_Load(sender, e);
		}

		override protected object SaveViewState()
		{
			//add select and combo boxes to view state
			PageUtil.AddSelectToViewState(ViewState,SurgeryId);
			//PageUtil.AddSelectToViewState(ViewState,OpCPT_Code);
			PageUtil.AddSelectToViewState(ViewState,OpSurgeonType);
			PageUtil.AddSelectToViewState(ViewState,OpAssistantType);
			PageUtil.AddSelectToViewState(ViewState,OpType);
			PageUtil.AddSelectToViewState(ViewState,OpSide);
			PageUtil.AddSelectToViewState(ViewState,PathExtension);
			PageUtil.AddSelectToViewState(ViewState,PathGrade);
			PageUtil.AddSelectToViewState(ViewState,PathStageSystem);
			PageUtil.AddSelectToViewState(ViewState,PathStageT);
			PageUtil.AddSelectToViewState(ViewState,PathVascularInv);
			PageUtil.AddSelectToViewState(ViewState,PathSpermaticCordInv);
			PageUtil.AddSelectToViewState(ViewState,PathScrotalInv);
			PageUtil.AddSelectToViewState(ViewState,PathEpididymisInv);
			PageUtil.AddSelectToViewState(ViewState,PathReteTestisInv);
			PageUtil.AddSelectToViewState(ViewState,PathTunicaAlbugineaInv);
			PageUtil.AddSelectToViewState(ViewState,PathITGCN);
			//PageUtil.AddSelectToViewState(ViewState,PathOtherTestis);
			PageUtil.AddSelectToViewState(ViewState,PathQuality);
			
			PageUtil.AddComboToViewState(ViewState,OpSurgeon);
			PageUtil.AddComboToViewState(ViewState,OpAssistant);
			PageUtil.AddComboToViewState(ViewState,PathHistology);
			PageUtil.AddComboToViewState(ViewState,Pathologist);
			PageUtil.AddComboToViewState(ViewState,PathDataSource);

			return base.SaveViewState();
		}

		override public HtmlInputHidden GetPrimKeyField()
		{
			return ProcOrchiectomyId;
		}

		override protected DataEntryController GetController()
		{
			return new DataEntryController(new OrchiectomyDa(), Orchiectomy.ProcOrchiectomyId); //NOTE: fix args
		}




		override protected void SetDataEntryInfo()
		{
			this._tableInfo = "ProcOrchiectomies";

			string parentKey = "";
			if (SurgeryId != null && SurgeryId.Value.Length > 0)
			{
				parentKey = SurgeryId.Value;
			}
			else if (HttpContext.Current.Request.QueryString["parentKey"] != null && HttpContext.Current.Request.QueryString["parentKey"].Length > 0 && Request.UrlReferrer.ToString().IndexOf("SurgeriesForm") > -1)
			{
				parentKey = HttpContext.Current.Request.QueryString["parentKey"];
			}



			if (parentKey.Length > 0)
			{
				this._dataEntryTitle = "<a class=\"patientDataSectionTitle\"  href=\"DataEntryContainer.aspx?dataForm=SurgeriesForm&primKey="+Request.QueryString["parentKey"]+"\">Surgeries</a> > Orchiectomies";
			}
			else
			{
				this._dataEntryTitle = "<a class=\"patientDataSectionTitle\"  href=\"DataEntryContainer.aspx?dataForm=SurgeriesForm\">Surgeries</a> > Orchiectomies";
			}
		}

		override protected BizObject GetParams()
		{
			Orchiectomy biz = new Orchiectomy();
			DataRow dr = biz.Tables[Orchiectomy.Table_ProcOrchiectomies].NewRow();

			dr[Orchiectomy.ProcOrchiectomyId] = PageUtil.ObjToInt(ProcOrchiectomyId.Value);

			//selects use: Request.Form[FieldName.UniqueID].ToString();
			//dates use: PageUtil.ObjToDateTime(FieldName.Value);
			//checkbox use: 
			//Patient ID should = this.patientID
			
			dr[Orchiectomy.PatientId] = this.patientID;

			//FRANK LOOK HERE!!!
//			dr[Orchiectomy.SurgeryId] = PageUtil.ObjToInt(SurgeryId.Value);

			if (Request.Form[SurgeryId.UniqueID] != null && Request.Form[SurgeryId.UniqueID].ToString().Length > 0)
			{
				dr[Procedure.SurgeryId] = PageUtil.ObjToInt(Request.Form[SurgeryId.UniqueID]);
			}
			 
			//dr[Orchiectomy.OpCPT_Code] = Request.Form[OpCPT_Code.UniqueID].ToString();
			dr[Orchiectomy.OpCPT_Code] = OpCPT_Code.Value;
			dr[Orchiectomy.OpCPT_Description] = OpCPT_Description.Value;
			dr[Orchiectomy.OpSurgeon] = Request.Form[OpSurgeon.UniqueID].ToString();
			dr[Orchiectomy.OpSurgeonType] = Request.Form[OpSurgeonType.UniqueID].ToString();
			dr[Orchiectomy.OpAssistant] = Request.Form[OpAssistant.UniqueID].ToString();
			dr[Orchiectomy.OpAssistantType] = Request.Form[OpAssistantType.UniqueID].ToString();
			dr[Orchiectomy.OpType] = Request.Form[OpType.UniqueID].ToString();
			dr[Orchiectomy.OpSide] = Request.Form[OpSide.UniqueID].ToString();
			dr[Orchiectomy.OpNotes] = OpNotes.Value;
			dr[Orchiectomy.PathNum] = PathNum.Value;
			dr[Orchiectomy.OrchDateText] = Request.Form[OrchDateText.UniqueID].ToString();
			
			dr[Orchiectomy.OrchDate] = PageUtil.ObjToDateTime(OrchDate.Value);
			dr[Orchiectomy.PathExtension] = Request.Form[PathExtension.UniqueID].ToString();
			dr[Orchiectomy.PathGrade] = Request.Form[PathGrade.UniqueID].ToString();
			dr[Orchiectomy.PathHistology] = Request.Form[PathHistology.UniqueID].ToString();
			dr[Orchiectomy.PathStageSystem] = Request.Form[PathStageSystem.UniqueID].ToString();


			if (Request.Form[PathStageT.UniqueID] != null && Request.Form[PathStageT.UniqueID].ToString() != "")
			{
				dr[Orchiectomy.PathStageT] = Request.Form[PathStageT.UniqueID].ToString();
			}


			dr[Orchiectomy.PathVascularInv] = Request.Form[PathVascularInv.UniqueID].ToString();
			dr[Orchiectomy.PathSpermaticCordInv] = Request.Form[PathSpermaticCordInv.UniqueID].ToString();
			dr[Orchiectomy.PathScrotalInv] = Request.Form[PathScrotalInv.UniqueID].ToString();
			dr[Orchiectomy.PathEpididymisInv] = Request.Form[PathEpididymisInv.UniqueID].ToString();
			dr[Orchiectomy.PathReteTestisInv] = Request.Form[PathReteTestisInv.UniqueID].ToString();
			dr[Orchiectomy.PathTunicaAlbugineaInv] = Request.Form[PathTunicaAlbugineaInv.UniqueID].ToString();
			dr[Orchiectomy.PathCancerMaxDim] = PathCancerMaxDim.Value;
			dr[Orchiectomy.PathITGCN] = Request.Form[PathITGCN.UniqueID].ToString();
			dr[Orchiectomy.PathOtherTestis] = PathOtherTestis.Value;
			//dr[Orchiectomy.PathOtherTestis] = Request.Form[PathOtherTestis.UniqueID].ToString();
			dr[Orchiectomy.Pathologist] = Request.Form[Pathologist.UniqueID].ToString();
			dr[Orchiectomy.PathNotes] = PathNotes.Value;
			dr[Orchiectomy.PathDataSource] = Request.Form[PathDataSource.UniqueID].ToString();
			dr[Orchiectomy.PathQuality] = Request.Form[PathQuality.UniqueID].ToString();

			AddBaseParams(dr);
			biz.Tables[Orchiectomy.Table_ProcOrchiectomies].Rows.Add(dr);
			biz.AcceptChanges();
			return biz;

		}


⌨️ 快捷键说明

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