procprostatectomiespathform.ascx.cs

来自「医疗决策支持系统」· CS 代码 · 共 492 行 · 第 1/2 页

CS
492
字号
			PageUtil.SelectDropDownItem(PathIDC, dr[ProstatectomyPathology.PathIDC]);
			PageUtil.SelectDropDownItem(PathVascularInv, dr[ProstatectomyPathology.PathVascularInv]);
			PageUtil.SelectDropDownItem(PathBN_Inv, dr[ProstatectomyPathology.PathBN_Inv]);
			PageUtil.SelectDropDownItem(PathMultifocal, dr[ProstatectomyPathology.PathMultifocal]);
			Pathologist.Value = dr[ProstatectomyPathology.Pathologist].ToString();
			PathNotes.Value = dr[ProstatectomyPathology.PathNotes].ToString();
			PageUtil.SelectDropDownItem(PathQuality, dr[ProstatectomyPathology.PathQuality]);

			SetBaseFields(dr);
			//SetSubPageLinks();
			SetStageSelects();
			PageUtil.SelectDropDownItem(PathStageT, dr[ProstatectomyPathology.PathStageT]);
			PageUtil.SelectDropDownItem(PathStageSystem, dr[ProstatectomyPathology.PathStageSystem]);




		}

		/* replaced by drop down menu
		protected void SetSubPageLinks()
		{
			
			//enable links and set the url's
			if(SurgeryId != null && !SurgeryId.Value.Equals(""))
			{
				
				ProstatectomyPathFindingsFormLink.NavigateUrl = "DataEntryContainer.aspx?dataForm=ProstatectomyPathFindingsForm&parentKey="+SurgeryId.Value+"&Relationship=one";
				ProstatectomyPathFindingsFormLink.Enabled = true;
				ProstatectomyPathSectionsFormLink.NavigateUrl = "DataEntryContainer.aspx?dataForm=ProstatectomyPathSectionsForm&parentKey="+SurgeryId.Value+"&Relationship=one";
				ProstatectomyPathSectionsFormLink.Enabled = true;

				//set icons if findings record exist in subpages
				ProstatectomyPathologyFindingDa da = new ProstatectomyPathologyFindingDa();
				DataSet ds = da.GetRecords(int.Parse(SurgeryId.Value));
				if(ds.Tables[0].Rows.Count > 0)
				{//make icon visible
					FindingsDetailFlagOn.Visible = true;
					FindingsDetailFlagOff.Visible = false;
				}
	
				//set icons if sections records exist in subpages
				ProstatectomyPathologySectionDa sda = new ProstatectomyPathologySectionDa();
				DataSet sds = sda.GetRecords(int.Parse(SurgeryId.Value));
				if(sds.Tables[0].Rows.Count > 0)
				{//make icon visible
					SectionsDetailFlagOn.Visible = true;
					SectionsDetailFlagOff.Visible = false;
				}
			}
		}
		*/



		// enabling of staging fields is different
/*		override public void EnableFormFields()  
		{
			foreach(Control con in this.Controls)  
			{
				if (con is HtmlControl)  
				{
					if (con is HtmlInputControl || con is HtmlSelect || con is HtmlTextArea || con is HtmlInputText)  
					{
						if (!con.ID.Equals("PathStageT"))
						{
							((HtmlControl)con).Disabled = false;
						}
					}
					else if (con is HtmlImage) // added by jf for the calendar buttons
					{
						((HtmlControl)con).Attributes.Add("class", "pdFormFieldButtonOn");
						((HtmlControl)con).Disabled = false;
					}
				}
				else if (con is DataGrid)  
				{
					((DataGrid)con).Enabled = true;
				}
				else if (con is LinkButton)  
				{
					((LinkButton)con).Enabled = true;
				}
				else if (con is Caisis.UI.ComboBox)
				{
					((Caisis.UI.ComboBox)con).Disabled = false;
				}


				SetStageSelects();
			}
		}
*/

		override protected void SetStageSelects()
		{
			string selectedPathStageSystem;
			string trimSelectedPathStageSystem;

			if (Request.Form[PathStageSystem.UniqueID] != null && Request.Form[PathStageSystem.UniqueID] != "")
			{
				selectedPathStageSystem = Request.Form[PathStageSystem.UniqueID];
			}
			else
			{
				selectedPathStageSystem = PathStageSystem.Value;
			}
//			PageUtil.SelectDropDownItem(PathStageSystem, selectedPathStageSystem);	


			if (selectedPathStageSystem.StartsWith("UICC_").Equals(true))
			{
				trimSelectedPathStageSystem = selectedPathStageSystem.Remove(0, 4);
			}
			else
			{
				trimSelectedPathStageSystem = "_" + selectedPathStageSystem;
			}


			
			string stageLkp = "ProstatePathStageT" + trimSelectedPathStageSystem;

			PageUtil.FillLkpDropDown(PathStageT, stageLkp, ViewState);



			// logic to turn off TM stages if Stage System not selected not working currently. leave on for now.
/*			if (PathStageSystem.Disabled.Equals(false) && selectedPathStageSystem != null && selectedPathStageSystem.Length > 0)
			{				
				PathStageT.Disabled = false;
			}
			else
			{
				PathStageT.Disabled = true;
			}
*/

			if (PathStageSystem.Disabled.Equals(false))
			{				
				PathStageT.Disabled = false;
			}
			else
			{
				PathStageT.Disabled = true;
			}

			ActivateStagingInfo(stageLkp);
		}



		protected void FillStagingInfo(string fieldName)
		{

			DataTable dt = PageUtil.RetrieveList(fieldName);


			if (dt.Rows.Count < 1)
			{
				DataRow blankRow = dt.NewRow();
				dt.Rows.Add(blankRow);
				dt.Rows[0]["LkpDescription"] = "You must select a staging system to view available options.";
			}
			else
			{
				rptStages.DataSource = dt.DefaultView;
				rptStages.DataBind();
			}


//			rptStages.DataSource = PageUtil.RetrieveList(fieldName).DefaultView;
//			rptStages.DataBind();
		}


		protected void ActivateStagingInfo(string stageLkp)
		{
			if (PathStageSystem.Disabled.Equals(false))
			{	
				if (PathStageT.Disabled.Equals(false))
				{
					FillStagingInfo(stageLkp);
					StagingInfoLink.Attributes.Add("style", "cursor: hand;");
					StagingInfoLink.Attributes.Add("onclick", "ShowStagingInfo();");
				}
				else
				{
					StagingInfoLink.Attributes.Add("onclick", "RequestStagingSystem();");
				}
			}

		}






		protected void StagingInfoDataBound(Object Sender, RepeaterItemEventArgs e) 
		{

			System.Web.UI.HtmlControls.HtmlAnchor tStageLink;
			tStageLink = (HtmlAnchor) e.Item.FindControl("tStageLink");


			if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 
			{

				int linkIndex = e.Item.ItemIndex + 1;
				tStageLink.Attributes.Add("onclick", "MM_showHideLayers('stagingInfoDiv','','hide'); setStageSelectValue('" + PathStageT.ClientID + "', " + linkIndex.ToString() + ");");
//				tStageRadio.Name = "tStageRadio";
//				tStageRadio.Value = e.Item.ItemIndex.ToString();
				


			}
		}




		// need to turn staging wizard off if cancel is clicked
		override public void DisableFormFields()  
		{
			base.DisableFormFields();
			StagingInfoLink.Attributes.Clear();
		}


		override public void PopulateForm(BizObject bz)  
		{
			//only setFields if GetRecords actually returns at least one row, primKey may exist because passed down from parent record in one to one relationship
			if (bz != null && bz.Tables[0].Rows.Count != 0)
			{
				base.PopulateForm(bz);
			}
			else
			{
				ResetFormFields();
			}

		}
	}
}

⌨️ 快捷键说明

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