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

📄 cytologiesform.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;
	using Caisis.UI.Core.Classes.CustomControls;

	public abstract class CytologiesForm : DataEntryControl
	{

		protected HtmlInputText CytoDateText;
		protected HtmlInputText CytoDate;
		protected HtmlInputText CytoPathNum;
		protected ComboBox CytoType;
		protected ComboBox CytoResult;
		protected ComboBox CytoHistology;
		protected HtmlTextArea CytoNotes;
		protected ComboBox CytoDataSource;
		protected HtmlSelect CytoQuality;
		protected HtmlInputHidden CytologyId;

		protected HtmlImage CytoDateTextCal;

		override protected void Page_Load(object sender, System.EventArgs e)
		{
			//populate look up and distinct value select boxes
			
			PageUtil.FillLkpDropDown(CytoQuality, "DataQuality", ViewState);

			//create arrays that populate combo boxes
			
			Page.RegisterClientScriptBlock("CytoType", PageUtil.FillComboDropDown(CytoType.RefBy, "CytoType"));
			Page.RegisterClientScriptBlock("CytoResult", PageUtil.FillComboDropDown(CytoResult.RefBy, "CytoResult"));
			Page.RegisterClientScriptBlock("CytoHistology", PageUtil.FillComboDropDown(CytoHistology.RefBy, "CytoHistology"));
			Page.RegisterClientScriptBlock("CytoDataSource", PageUtil.FillComboDropDown(CytoDataSource.RefBy, "DataSource"));

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

			PageUtil.AddCalendarFunction(CytoDateTextCal, CytoDateText);
			PageUtil.AddFuzzyDateFunction(CytoDateText, CytoDate);

			base.Page_Load(sender, e);
		}

		/*override protected object SaveViewState()
		{
			//add select and combo boxes to view state
			
			PageUtil.AddSelectToViewState(ViewState,CytoType);
			PageUtil.AddSelectToViewState(ViewState,CytoResult);
			PageUtil.AddSelectToViewState(ViewState,CytoQuality);
			
			PageUtil.AddComboToViewState(ViewState,CytoHistology);
			PageUtil.AddComboToViewState(ViewState,CytoDataSource);

			return base.SaveViewState();
			
		
		}*/

		override public HtmlInputHidden GetPrimKeyField()
		{
			return CytologyId;
		}

		override protected DataEntryController GetController()
		{
			return new DataEntryController(new CytologyDa(), Cytology.CytologyId); //NOTE: fix args
		}

		override protected void SetDataEntryInfo()
		{
			this._tableInfo = "Cytologies";
			this._dataEntryTitle = "Cytologies";
		}

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

			if (!CytologyId.Value.Equals(""))
			{
				dr[Cytology.CytologyId] = CytologyId.Value;
			}

			//selects use: Request.Form[FieldName.UniqueID].ToString();
			//dates use: PageUtil.ObjToDateTime(FieldName.Value);
			//checkbox use: if(FieldName.Checked){dr[BizObject.FieldName] = 1;}
			//Patient ID should = this.patientID
			
			dr[Cytology.PatientId] = this.patientID;
			 
			dr[Cytology.CytoDateText] = Request.Form[CytoDateText.UniqueID].ToString();
			dr[Cytology.CytoDate] = PageUtil.ObjToDateTime(CytoDate.Value);
			dr[Cytology.CytoPathNum] = CytoPathNum.Value;
			dr[Cytology.CytoType] = Request.Form[CytoType.UniqueID].ToString();
			dr[Cytology.CytoResult] = Request.Form[CytoResult.UniqueID].ToString();
			dr[Cytology.CytoHistology] = Request.Form[CytoHistology.UniqueID].ToString();
			dr[Cytology.CytoNotes] = CytoNotes.Value;
			dr[Cytology.CytoDataSource] = Request.Form[CytoDataSource.UniqueID].ToString();
			dr[Cytology.CytoQuality] = Request.Form[CytoQuality.UniqueID].ToString();

			AddBaseParams(dr);
			biz.Tables[Cytology.Table_Cytologies].Rows.Add(dr);
			biz.AcceptChanges();
			return biz;

		}

		protected override void SetFields(BizObject bz)
		{
			Cytology biz = (Cytology)bz;
			DataRow dr = biz.Tables[Cytology.Table_Cytologies].Rows[0];

			//selects use: PageUtil.SelectDropDownItem(fieldIdName, dr[Object.FieldName]);
			
			CytologyId.Value = dr[Cytology.CytologyId].ToString();
			CytoDateText.Value = dr[Cytology.CytoDateText].ToString();
			CytoDate.Value = PageUtil.ObjToDateString(dr[Cytology.CytoDate]);
			CytoPathNum.Value = dr[Cytology.CytoPathNum].ToString();
			CytoType.Value = dr[Cytology.CytoType].ToString();
			CytoResult.Value = dr[Cytology.CytoResult].ToString();
			CytoHistology.Value = dr[Cytology.CytoHistology].ToString();
			CytoNotes.Value = dr[Cytology.CytoNotes].ToString();
			CytoDataSource.Value = dr[Cytology.CytoDataSource].ToString();
			PageUtil.SelectDropDownItem(CytoQuality, dr[Cytology.CytoQuality]);

			SetBaseFields(dr);
		}
	}
}

⌨️ 快捷键说明

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