📄 prostatectomypathsectionsform.ascx.cs
字号:
namespace Caisis.UI.Modules.Prostate.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;
public abstract class ProstatectomyPathSectionsForm : DataGridControl
{
override protected DataEntryController GetController()
{
return new DataGridController(new ProstatectomyPathologySectionDa(), ProstatectomyPathologySection.PathSectionId);
}
override protected void SetDataEntryInfo()
{
this._tableInfo = "ProstatectomyPathSections";
this._dataEntryTitle = "<a href=\"DataEntryContainer.aspx?dataForm=ProcProstatectomiesPathForm&parentKey="+Request.QueryString["parentKey"]+"\"> Prostatectomy Pathology</a> > Sections";
}
protected override DataTable PhysicalDataRead()
{
DataGridController ct = new DataGridController(new ProstatectomyPathologySectionDa(), ProstatectomyPathologySection.PathSectionId);
DataSet ds = ct.GetDataGridRecords(int.Parse(Request.QueryString["parentKey"].ToString()));
return ds.Tables[0];
}
protected override DataSet GetGridRow(DataGridCommandEventArgs e)
{
ProstatectomyPathologySection biz = new ProstatectomyPathologySection();
DataSet ds = new DataSet();
ds.Tables.Add(biz);
DataRow dr = biz.NewRow();
HtmlSelect PathSection = (HtmlSelect) e.Item.FindControl("PathSection");
HtmlSelect PathSectionLevel = (HtmlSelect) e.Item.FindControl("PathSectionLevel");
TextBox PathSectionArea = (TextBox) e.Item.Cells[3].Controls[0];
PathSectionArea.Width = 100;
TextBox PathSectionImageName = (TextBox) e.Item.Cells[4].Controls[0];
PathSectionImageName.Width = 100;
TextBox updateTime = (TextBox) e.Item.FindControl("UpdateTime");
dr[BizObject.UpdatedTime] = PageUtil.ObjToDateTime(updateTime.Text);
dr[ProstatectomyPathologySection.SurgeryId] = Request.QueryString["parentKey"].ToString();
dr[ProstatectomyPathologySection.PathSectionId] = grid.DataKeys[e.Item.ItemIndex];
dr[ProstatectomyPathologySection.PathSection] = Request.Form[PathSection.UniqueID].ToString();
dr[ProstatectomyPathologySection.PathSectionLevel] = Request.Form[PathSectionLevel.UniqueID].ToString();
dr[ProstatectomyPathologySection.PathSectionArea] = PathSectionArea.Text;
dr[ProstatectomyPathologySection.PathSectionImageName] = PathSectionImageName.Text;
biz.Rows.Add(dr);
return ds;
}
public void ItemBound(Object sender, DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.EditItem)
{
DataRowView drv = (DataRowView) e.Item.DataItem;
//make objects below lowercase to differ from above method and match Lkp Arguments
HtmlSelect pathsection = (HtmlSelect) e.Item.FindControl("PathSection");
HtmlSelect pathsectionlevel = (HtmlSelect) e.Item.FindControl("PathSectionLevel");
TextBox pathsectionarea = (TextBox) e.Item.Cells[3].Controls[0];
pathsectionarea.Width = 100;
TextBox pathsectionimagename = (TextBox) e.Item.Cells[4].Controls[0];
pathsectionimagename.Width = 100;
PageUtil.FillLkpDropDown(pathsection, "ProstateSection");
PageUtil.SelectDropDownItem(pathsection, drv[ProstatectomyPathologySection.PathSection].ToString());
PageUtil.FillLkpDropDown(pathsectionlevel, "ProstateLevel");
PageUtil.SelectDropDownItem(pathsectionlevel, drv[ProstatectomyPathologySection.PathSectionLevel].ToString());
TextBox surgId = (TextBox) e.Item.FindControl("SurgeryId");
surgId.Text = drv[ProstatectomyPathologyFinding.SurgeryId].ToString();
TextBox updateTime = (TextBox)e.Item.FindControl("UpdateTime");
updateTime.Text = drv[BizObject.UpdatedTime].ToString();
}
}
/*
override protected void DeleteData(Object sender, DataGridCommandEventArgs e)
{
ProstatectomyPathologySectionDa da = new ProstatectomyPathologySectionDa();
DataTable dt = da.ValidatePathSectionsDeletion(Convert.ToInt32(grid.DataKeys[e.Item.ItemIndex].ToString())).Tables[0];
if (dt.Rows.Count.Equals(0))
{
base.DeleteData(sender, e);
}
else
{
string validationMessageString;
validationMessageString = "<script> alert('";
validationMessageString += "This pathology section cannot be deleted at this time.\\n\\n";
validationMessageString += "There are " + dt.Rows[0]["TableCount"].ToString() + " records in the " + dt.Rows[0]["TableName"].ToString() + "table that are associated with this data.\\n";
validationMessageString += "\\nThese records must be deleted before this\\npathology section can be removed from the database.";
validationMessageString += "');</script>";
Page.RegisterClientScriptBlock("validationMessage", validationMessageString);
}
}
*/
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -