📄 addemr.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class IndividualOperation_Doctor_AddEMR : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int age = 0;
for (int i = 1900; i < 2050; i++)
{
DropDownListYear.Items.Add(i.ToString());
DropDownListPatientAge.Items.Add(age.ToString());
age++;
}
DropDownListYear.SelectedValue = "1980";
}
}
protected void ButtonAddEmr_Click(object sender, EventArgs e)
{
string redirect = "CheckEMR.aspx";
PatientInfo patient = new PatientInfo();
patient.EMRNum = 0;
patient.PatientAddress = TextBoxPatientAddress.Text;
patient.PatientAge = Convert.ToInt32(DropDownListPatientAge.SelectedValue);
patient.PatientBirthday = DropDownListYear.SelectedValue + "-" + DropDownListMonth.SelectedValue + "-" + DropDownListDay.SelectedValue;
patient.PatientContactMan = TextBoxPatientContactMan.Text;
patient.PatientContactManAddress = TextBoxPatientContactManAddress.Text;
patient.PatientContactManRelation = TextBoxPatientContactManRelation.Text;
patient.PatientContactManTelephone = TextBoxPatientContactManTelephone.Text;
patient.PatientEducation = TextBoxPatientEducation.Text;
patient.PatientIDCardNum = TextBoxPatientIDCardNum.Text;
patient.PatientIsMarry = Convert.ToInt32(DropDownListIsMarry.SelectedValue);
patient.PatientJob = TextBoxPatientJob.Text;
patient.PatientName = TextBoxPatientName.Text;
patient.PatientNation = TextBoxPatientNation.Text;
patient.PatientNativePlace = TextBoxPatientNativePlace.Text;
patient.PatientPostalCode = TextBoxPatientPostalCode.Text;
patient.PatientRPRPlace = TextBoxPatientRPRPlace.Text;
patient.PatientSex = Convert.ToInt32(DropDownListPatientSex.SelectedValue);
patient.PatientTelephoneNum = TextBoxPatientTelephoneNum.Text;
if (!DoctorService.isExistEMR(TextBoxPatientIDCardNum.Text, TextBoxPatientName.Text))
{
string emrXmlPath = Server.MapPath("XML/EMR.xml");
if (DoctorService.addEMR(patient, emrXmlPath))
{
Response.Write(@"<script language='Javascript'> alert('添加病历成功!');window.location.href='" + redirect + "';</script>");
}
else
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", @"<script language='Javascript'>
alert('病人信息添加失败!');</script>");
}
}
else
{
if (DoctorService.savePatientInfo(patient, TextBoxPatientIDCardNum.Text, TextBoxPatientName.Text))
{
Response.Write(@"<script language='Javascript'> alert('此病人已经存在,信息已更新成功!');window.location.href='" + redirect + "';</script>");
}
else
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", @"<script language='Javascript'>
alert('此病人已经存在 ,信息更新失败!');</script>");
}
}
}
protected void ButtonCancel_Click(object sender, EventArgs e)
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -