📄 proceduresform.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 ProceduresForm : DataEntryControl
{
protected HtmlSelect SurgeryId;
protected HtmlInputText OpCPT_Code;
protected HtmlInputText OpCPT_Description;
protected HtmlInputCheckBox OpPending;
protected HtmlInputText OpDateText;
protected HtmlInputText OpDate;
protected ComboBox OpInstitution;
protected ComboBox OpSurgeon;
protected HtmlSelect OpSurgeonType;
protected ComboBox OpAssistant;
protected HtmlSelect OpAssistantType;
protected ComboBox OpName;
protected HtmlSelect OpSide;
protected ComboBox OpIndication;
protected HtmlTextArea OpNotes;
protected HtmlInputText PathNum;
protected HtmlSelect PathStageSystem;
protected HtmlInputText PathStageT;
protected HtmlSelect PathStageN;
protected HtmlInputText PathStageM;
protected HtmlSelect PathGrade;
protected ComboBox PathHistology;
protected ComboBox PathResult;
protected ComboBox Pathologist;
protected ComboBox PathDataSource;
protected HtmlSelect PathQuality;
protected HtmlInputHidden ProcedureId;
protected HtmlImage OpDateTextCal;
protected HyperLink procPathFindingsLink;
protected HyperLink procNodesLink;
protected HyperLink procNodesGrossFindingsLink;
protected HyperLink procNodesPathFindingsLink;
protected Literal setSurgeryDateJsVar;
override protected void Page_Load(object sender, System.EventArgs e)
{
//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]);
SurgeryId.Attributes.Add("onchange", "setSurgeryChildDate('" + SurgeryId.ClientID + "', '" + OpDateText.ClientID + "', '" + OpDate.ClientID + "');");
OpDateText.Attributes.Add("onfocus", "checkIfSurgeryDateIsSet(document.getElementById('" + OpDateText.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(OpSide, "OpSide", ViewState);
PageUtil.FillLkpDropDown(PathStageSystem, "StagingSystem", ViewState);
// PageUtil.FillLkpDropDown(PathStageT, "PathStageT", ViewState);
PageUtil.FillLkpDropDown(PathStageN, "PathStageN", ViewState);
// PageUtil.FillLkpDropDown(PathStageM, "PathStageM", ViewState);
PageUtil.FillLkpDropDown(PathGrade, "PathGrade", ViewState);
PageUtil.FillLkpDropDown(PathQuality, "DataQuality", ViewState);
//create arrays that populate combo boxes
Page.RegisterClientScriptBlock("OpInstitution", PageUtil.FillComboDropDown(OpInstitution.RefBy, "Institution"));
Page.RegisterClientScriptBlock("OpSurgeon", PageUtil.FillComboDropDown(OpSurgeon.RefBy, "OpSurgeon"));
Page.RegisterClientScriptBlock("OpAssistant", PageUtil.FillComboDropDown(OpAssistant.RefBy, "OpSurgeon"));
Page.RegisterClientScriptBlock("OpIndication", PageUtil.FillComboDropDown(OpIndication.RefBy, "Indication"));
//Select Distinct
Page.RegisterClientScriptBlock("PathHistology", PageUtil.FillComboDropDown(PathHistology.RefBy, "NS"));
Page.RegisterClientScriptBlock("Pathologist", PageUtil.FillComboDropDown(Pathologist.RefBy, "Pathologist"));
Page.RegisterClientScriptBlock("OpName", PageUtil.FillComboDropDown(OpName.RefBy, "ProcName"));
Page.RegisterClientScriptBlock("PathResult", PageUtil.FillComboDropDown(PathResult.RefBy, "Result"));
Page.RegisterClientScriptBlock("PathDataSource", PageUtil.FillComboDropDown(PathDataSource.RefBy, "DataSource"));
//array created holding required fields
string reqFieldArray = PageUtil.CreateValidationScript("'"+OpName.ClientID+"'");
Page.RegisterClientScriptBlock("RequiredFieldArray", reqFieldArray);
PageUtil.AddCalendarFunction(OpDateTextCal, OpDateText);
PageUtil.AddFuzzyDateFunction(OpDateText, OpDate);
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,OpSide);
PageUtil.AddSelectToViewState(ViewState,PathStageSystem);
// PageUtil.AddSelectToViewState(ViewState,PathStageT);
PageUtil.AddSelectToViewState(ViewState,PathStageN);
// PageUtil.AddSelectToViewState(ViewState,PathStageM);
PageUtil.AddSelectToViewState(ViewState,PathGrade);
PageUtil.AddSelectToViewState(ViewState,PathQuality);
PageUtil.AddComboToViewState(ViewState,OpInstitution);
PageUtil.AddComboToViewState(ViewState,OpSurgeon);
PageUtil.AddComboToViewState(ViewState,OpAssistant);
PageUtil.AddComboToViewState(ViewState,OpIndication);
PageUtil.AddComboToViewState(ViewState,PathHistology);
PageUtil.AddComboToViewState(ViewState,Pathologist);
PageUtil.AddComboToViewState(ViewState,PathDataSource);
PageUtil.AddComboToViewState(ViewState,PathResult);
PageUtil.AddComboToViewState(ViewState,OpName);
return base.SaveViewState();
}
override public HtmlInputHidden GetPrimKeyField()
{
return ProcedureId;
}
override protected DataEntryController GetController()
{
return new DataEntryController(new ProcedureDa(), Procedure.ProcedureId); //NOTE: fix args
}
override protected void SetDataEntryInfo()
{
this._tableInfo = "Procedures";
this._dataEntryTitle = "Procedures";
}
override protected BizObject GetParams()
{
Procedure biz = new Procedure();
DataRow dr = biz.Tables[Procedure.Table_Procedures].NewRow();
if (!ProcedureId.Value.Equals(""))
{
dr[Procedure.ProcedureId] = ProcedureId.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[Procedure.SurgeryId] = PageUtil.ObjToInt(Request.Form[SurgeryId.UniqueID]);
//dr[Procedure.SurgeryId] = PageUtil.ObjToInt(SurgeryId.Value);
dr[Procedure.PatientId] = this.patientID;
//dr[Procedure.OpCPT_Code] = Request.Form[OpCPT_Code.UniqueID].ToString();
dr[Procedure.OpCPT_Code] = OpCPT_Code.Value;
dr[Procedure.OpCPT_Description] = OpCPT_Description.Value;
dr[Procedure.OpPending] = OpPending.Checked;
dr[Procedure.OpDateText] = Request.Form[OpDateText.UniqueID].ToString();
dr[Procedure.OpDate] = PageUtil.ObjToDateTime(OpDate.Value);
dr[Procedure.OpInstitution] = Request.Form[OpInstitution.UniqueID].ToString();
dr[Procedure.OpSurgeon] = Request.Form[OpSurgeon.UniqueID].ToString();
dr[Procedure.OpSurgeonType] = Request.Form[OpSurgeonType.UniqueID].ToString();
dr[Procedure.OpAssistant] = Request.Form[OpAssistant.UniqueID].ToString();
dr[Procedure.OpAssistantType] = Request.Form[OpAssistantType.UniqueID].ToString();
dr[Procedure.OpName] = Request.Form[OpName.UniqueID].ToString();
dr[Procedure.OpSide] = Request.Form[OpSide.UniqueID].ToString();
dr[Procedure.OpIndication] = Request.Form[OpIndication.UniqueID].ToString();
dr[Procedure.OpNotes] = OpNotes.Value;
dr[Procedure.PathNum] = PathNum.Value;
dr[Procedure.PathStageSystem] = Request.Form[PathStageSystem.UniqueID].ToString();
dr[Procedure.PathStageT] = Request.Form[PathStageT.UniqueID].ToString();
dr[Procedure.PathStageN] = Request.Form[PathStageN.UniqueID].ToString();
dr[Procedure.PathStageM] = Request.Form[PathStageM.UniqueID].ToString();
dr[Procedure.PathGrade] = Request.Form[PathGrade.UniqueID].ToString();
dr[Procedure.PathHistology] = Request.Form[PathHistology.UniqueID].ToString();
dr[Procedure.PathResult] = Request.Form[PathResult.UniqueID].ToString();
dr[Procedure.Pathologist] = Request.Form[Pathologist.UniqueID].ToString();
dr[Procedure.PathDataSource] = Request.Form[PathDataSource.UniqueID].ToString();
dr[Procedure.PathQuality] = Request.Form[PathQuality.UniqueID].ToString();
AddBaseParams(dr);
biz.Tables[Procedure.Table_Procedures].Rows.Add(dr);
biz.AcceptChanges();
return biz;
}
protected override void SetFields(BizObject bz)
{
Procedure biz = (Procedure)bz;
DataRow dr = biz.Tables[Procedure.Table_Procedures].Rows[0];
//selects use: PageUtil.SelectDropDownItem(fieldIdName, dr[Object.FieldName]);
//SurgeryId.Value = dr[Procedure.SurgeryId].ToString();
PageUtil.SelectDropDownItem(SurgeryId, dr[Procedure.SurgeryId]);
ProcedureId.Value = dr[Procedure.ProcedureId].ToString();
//PageUtil.SelectDropDownItem(OpCPT_Code, dr[Procedure.OpCPT_Code]);
OpCPT_Code.Value = dr[Procedure.OpCPT_Code].ToString();
OpCPT_Description.Value = dr[Procedure.OpCPT_Description].ToString();
PageUtil.SetCheckBox(OpPending, dr[Procedure.OpPending]);
OpDateText.Value = dr[Procedure.OpDateText].ToString();
OpDate.Value = PageUtil.ObjToDateString(dr[Procedure.OpDate]);
OpInstitution.Value = dr[Procedure.OpInstitution].ToString();
OpSurgeon.Value = dr[Procedure.OpSurgeon].ToString();
PageUtil.SelectDropDownItem(OpSurgeonType, dr[Procedure.OpSurgeonType]);
OpAssistant.Value = dr[Procedure.OpAssistant].ToString();
PageUtil.SelectDropDownItem(OpAssistantType, dr[Procedure.OpAssistantType]);
OpName.Value = dr[Procedure.OpName].ToString();
PageUtil.SelectDropDownItem(OpSide, dr[Procedure.OpSide]);
OpIndication.Value = dr[Procedure.OpIndication].ToString();
OpNotes.Value = dr[Procedure.OpNotes].ToString();
PathNum.Value = dr[Procedure.PathNum].ToString();
PageUtil.SelectDropDownItem(PathStageSystem, dr[Procedure.PathStageSystem]);
PathStageT.Value = dr[Procedure.PathStageT].ToString();
// PathStageN.Value = dr[Procedure.PathStageN].ToString();
PathStageM.Value = dr[Procedure.PathStageM].ToString();
// PageUtil.SelectDropDownItem(PathStageT, dr[Procedure.PathStageT]);
PageUtil.SelectDropDownItem(PathStageN, dr[Procedure.PathStageN]);
// PageUtil.SelectDropDownItem(PathStageM, dr[Procedure.PathStageM]);
PageUtil.SelectDropDownItem(PathGrade, dr[Procedure.PathGrade]);
PathHistology.Value = dr[Procedure.PathHistology].ToString();
PathResult.Value = dr[Procedure.PathResult].ToString();
Pathologist.Value = dr[Procedure.Pathologist].ToString();
PathDataSource.Value = dr[Procedure.PathDataSource].ToString();
PageUtil.SelectDropDownItem(PathQuality, dr[Procedure.PathQuality]);
SetBaseFields(dr);
SetSubPageLinks();
if (dr[Procedure.SurgeryId] != null && dr[Procedure.SurgeryId].ToString().Length > 0)
{
setSurgeryDateJsVar.Text = "<SCRIPT LANGUAGE=javascript>surgeryDateIsSet = true;</SCRIPT>";
}
}
protected void SetSubPageLinks()
{
//enable links and set the url's
if(ProcedureId != null && !ProcedureId.Value.Equals(""))
{
procPathFindingsLink.NavigateUrl = Request.Path.ToString()+ "?dataForm=ProcPathFindingsForm&parentKey="+ProcedureId.Value+"&rltnshp=many";
procPathFindingsLink.Enabled = true;
procNodesLink.NavigateUrl = Request.Path.ToString()+ "?dataForm=ProcNodesForm&parentKey="+ProcedureId.Value+"&rltnshp=one";
procNodesLink.Enabled = true;
procNodesGrossFindingsLink.NavigateUrl = Request.Path.ToString()+ "?dataForm=ProcNodeGrossFindingsForm&parentKey="+ProcedureId.Value+"&rltnshp=many";
procNodesGrossFindingsLink.Enabled = true;
procNodesPathFindingsLink.NavigateUrl = Request.Path.ToString()+ "?dataForm=ProcNodePathFindingsForm&parentKey="+ProcedureId.Value+"&rltnshp=many";
procNodesPathFindingsLink.Enabled = true;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -