📄 radiationtherapyform.ascx.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 RadiationTherapyForm : DataEntryControl
{
protected HtmlInputCheckBox RadTxPending;
protected HtmlInputText RadTxDateText;
protected HtmlInputText RadTxDate;
protected HtmlSelect RadTxType;
protected ComboBox RadTxIndication;
protected ComboBox RadTxIntent;
protected HtmlInputText RadTxSummary;
protected HtmlSelect RadTxTarget;
protected HtmlInputText RadTxStopDateText;
protected HtmlInputText RadTxStopDate;
protected HtmlSelect RadTxIsotope;
protected HtmlInputText RadTxDosePerFraction;
protected HtmlInputText RadTxTotalDose;
protected HtmlSelect RadTxUnits;
protected HtmlInputText RadTxNumFractions;
protected HtmlInputText RadTxNumFields;
protected HtmlInputText RadTxSchedule;
protected ComboBox RadTxPhysician;
protected ComboBox RadTxInstitution;
protected HtmlTextArea RadTxNotes;
protected ComboBox RadTxDataSource;
protected HtmlSelect RadTxQuality;
protected HtmlInputHidden RadiationTherapyId;
protected HtmlImage RadTxDateTextCal, RadTxStopDateTextCal;
protected Caisis.UI.Core.Classes.PDLabel RadTxDateText_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxPending_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxDate_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxStopDateText_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxStopDate_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxType_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxTarget_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxTotalDose_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxUnits_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxDataSource_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxQuality_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxIndication_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxIntent_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxSummary_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxIsotope_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxDosePerFraction_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxNumFractions_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxNumFields_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxSchedule_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxPhysician_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxInstitution_PdLabel;
protected Caisis.UI.Core.Classes.PDLabel RadTxNotes_PdLabel;
override protected void Page_Load(object sender, System.EventArgs e)
{
//populate look up and distinct value select boxes
PageUtil.FillLkpDropDown(RadTxType, "RadTxType", ViewState);
PageUtil.FillLkpDropDown(RadTxTarget, "RadTxTarget", ViewState);
PageUtil.FillLkpDropDown(RadTxIsotope, "RadTxIsotope", ViewState);
PageUtil.FillLkpDropDown(RadTxUnits, "RadTxUnits", ViewState);
//PageUtil.FillLkpDropDown(RadTxSchedule, "RadTxSchedule", ViewState);
PageUtil.FillLkpDropDown(RadTxQuality, "DataQuality", ViewState);
//create arrays that populate combo boxes
Page.RegisterClientScriptBlock("RadTxInstitution", PageUtil.FillComboDropDown(RadTxInstitution.RefBy, "Institution"));
Page.RegisterClientScriptBlock("RadTxIntent", PageUtil.FillComboDropDown(RadTxIntent.RefBy, "TxIntent"));
Page.RegisterClientScriptBlock("RadTxIndication", PageUtil.FillComboDropDown(RadTxIndication.RefBy, "Indication"));
Page.RegisterClientScriptBlock("RadTxPhysician", PageUtil.FillComboDropDown(RadTxPhysician.RefBy, "RadiationOncologist"));
Page.RegisterClientScriptBlock("RadTxDataSource", PageUtil.FillComboDropDown(RadTxDataSource.RefBy, "DataSource"));
string reqFieldArray = PageUtil.CreateValidationScript("'"+RadTxType.ClientID+"'");
Page.RegisterClientScriptBlock("requiredFieldArray", reqFieldArray);
PageUtil.AddCalendarFunction(RadTxDateTextCal, RadTxDateText);
PageUtil.AddCalendarFunction(RadTxStopDateTextCal, RadTxStopDateText);
PageUtil.AddFuzzyDateFunction(RadTxDateText, RadTxDate);
PageUtil.AddFuzzyDateFunction(RadTxStopDateText, RadTxStopDate);
base.Page_Load(sender, e);
}
override protected object SaveViewState()
{
//add select and combo boxes to view state
PageUtil.AddSelectToViewState(ViewState,RadTxType);
PageUtil.AddSelectToViewState(ViewState,RadTxTarget);
PageUtil.AddSelectToViewState(ViewState,RadTxIsotope);
PageUtil.AddSelectToViewState(ViewState,RadTxUnits);
//PageUtil.AddSelectToViewState(ViewState,RadTxSchedule);
PageUtil.AddSelectToViewState(ViewState,RadTxQuality);
PageUtil.AddComboToViewState(ViewState,RadTxInstitution);
PageUtil.AddComboToViewState(ViewState,RadTxIntent);
PageUtil.AddComboToViewState(ViewState,RadTxIndication);
PageUtil.AddComboToViewState(ViewState,RadTxPhysician);
PageUtil.AddComboToViewState(ViewState,RadTxDataSource);
return base.SaveViewState();
}
override public HtmlInputHidden GetPrimKeyField()
{
return RadiationTherapyId;
}
override protected DataEntryController GetController()
{
return new DataEntryController(new RadiationTherapyDa(), RadiationTherapy.RadiationTherapyId); //NOTE: fix args
}
override protected void SetDataEntryInfo()
{
this._tableInfo = "RadiationTherapy";
this._dataEntryTitle = "Radiation Therapy";
}
override protected BizObject GetParams()
{
RadiationTherapy biz = new RadiationTherapy();
DataRow dr = biz.Tables[RadiationTherapy.Table_RadiationTherapy].NewRow();
if (!RadiationTherapyId.Value.Equals(""))
{
dr[RadiationTherapy.RadiationTherapyId] = RadiationTherapyId.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[RadiationTherapy.PatientId] = this.patientID;
dr[RadiationTherapy.RadTxPending] = RadTxPending.Checked;
dr[RadiationTherapy.RadTxDateText] = Request.Form[RadTxDateText.UniqueID].ToString();
dr[RadiationTherapy.RadTxDate] = PageUtil.ObjToDateTime(RadTxDate.Value);
dr[RadiationTherapy.RadTxType] = Request.Form[RadTxType.UniqueID].ToString();
dr[RadiationTherapy.RadTxIndication] = Request.Form[RadTxIndication.UniqueID].ToString();
dr[RadiationTherapy.RadTxIntent] = Request.Form[RadTxIntent.UniqueID].ToString();
dr[RadiationTherapy.RadTxSummary] = RadTxSummary.Value;
dr[RadiationTherapy.RadTxTarget] = Request.Form[RadTxTarget.UniqueID].ToString();
dr[RadiationTherapy.RadTxStopDateText] = Request.Form[RadTxStopDateText.UniqueID].ToString();
dr[RadiationTherapy.RadTxStopDate] = PageUtil.ObjToDateTime(RadTxStopDate.Value);
dr[RadiationTherapy.RadTxIsotope] = Request.Form[RadTxIsotope.UniqueID].ToString();
dr[RadiationTherapy.RadTxDosePerFraction] = RadTxDosePerFraction.Value;
dr[RadiationTherapy.RadTxTotalDose] = RadTxTotalDose.Value;
dr[RadiationTherapy.RadTxUnits] = Request.Form[RadTxUnits.UniqueID].ToString();
dr[RadiationTherapy.RadTxNumFractions] = RadTxNumFractions.Value;
dr[RadiationTherapy.RadTxNumFields] = RadTxNumFields.Value;
dr[RadiationTherapy.RadTxSchedule] = RadTxSchedule.Value;
dr[RadiationTherapy.RadTxPhysician] = Request.Form[RadTxPhysician.UniqueID].ToString();
dr[RadiationTherapy.RadTxInstitution] = Request.Form[RadTxInstitution.UniqueID].ToString();
dr[RadiationTherapy.RadTxNotes] = RadTxNotes.Value;
dr[RadiationTherapy.RadTxDataSource] = Request.Form[RadTxDataSource.UniqueID].ToString();
dr[RadiationTherapy.RadTxQuality] = Request.Form[RadTxQuality.UniqueID].ToString();
AddBaseParams(dr);
biz.Tables[RadiationTherapy.Table_RadiationTherapy].Rows.Add(dr);
biz.AcceptChanges();
return biz;
}
protected override void SetFields(BizObject bz)
{
RadiationTherapy biz = (RadiationTherapy)bz;
DataRow dr = biz.Tables[RadiationTherapy.Table_RadiationTherapy].Rows[0];
//selects use: PageUtil.SelectDropDownItem(fieldIdName, dr[Object.FieldName]);
RadiationTherapyId.Value = dr[RadiationTherapy.RadiationTherapyId].ToString();
PageUtil.SetCheckBox(RadTxPending, dr[RadiationTherapy.RadTxPending]);
// RadTxPending.Value = dr[RadiationTherapy.RadTxPending].ToString();
RadTxDateText.Value = dr[RadiationTherapy.RadTxDateText].ToString();
RadTxDate.Value = PageUtil.ObjToDateString(dr[RadiationTherapy.RadTxDate]);
PageUtil.SelectDropDownItem(RadTxType, dr[RadiationTherapy.RadTxType]);
RadTxIndication.Value = dr[RadiationTherapy.RadTxIndication].ToString();
RadTxIntent.Value = dr[RadiationTherapy.RadTxIntent].ToString();
RadTxSummary.Value = dr[RadiationTherapy.RadTxSummary].ToString();
PageUtil.SelectDropDownItem(RadTxTarget, dr[RadiationTherapy.RadTxTarget]);
RadTxStopDateText.Value = dr[RadiationTherapy.RadTxStopDateText].ToString();
RadTxStopDate.Value = PageUtil.ObjToDateString(dr[RadiationTherapy.RadTxStopDate]);
PageUtil.SelectDropDownItem(RadTxIsotope, dr[RadiationTherapy.RadTxIsotope]);
RadTxDosePerFraction.Value = dr[RadiationTherapy.RadTxDosePerFraction].ToString();
RadTxTotalDose.Value = dr[RadiationTherapy.RadTxTotalDose].ToString();
PageUtil.SelectDropDownItem(RadTxUnits, dr[RadiationTherapy.RadTxUnits]);
RadTxNumFractions.Value = dr[RadiationTherapy.RadTxNumFractions].ToString();
RadTxNumFields.Value = dr[RadiationTherapy.RadTxNumFields].ToString();
//PageUtil.SelectDropDownItem(RadTxSchedule, dr[RadiationTherapy.RadTxSchedule]);
RadTxSchedule.Value = dr[RadiationTherapy.RadTxSchedule].ToString();
RadTxPhysician.Value = dr[RadiationTherapy.RadTxPhysician].ToString();
RadTxInstitution.Value = dr[RadiationTherapy.RadTxInstitution].ToString();
RadTxNotes.Value = dr[RadiationTherapy.RadTxNotes].ToString();
RadTxDataSource.Value = dr[RadiationTherapy.RadTxDataSource].ToString();
PageUtil.SelectDropDownItem(RadTxQuality, dr[RadiationTherapy.RadTxQuality]);
SetBaseFields(dr);
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -