コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["loginModel"] == null)
        {
            Response.Write("<script>alert('请重新登录');opener.top.location.href='../../Default.aspx';window.close();</script>");
            return;
        }

        id = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["id"]));
        pi = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["pi"]));

        if (!IsPostBack)
        {
            loginModel = new LoginModel();
            studentsPersonalInformationModel = new StudentsPersonalInformation2Model();
            studentsPersonalInformationBLL   = new StudentsPersonalInformation2BLL();
            dt = new DataTable();


            professionalBaseDeptBLL = new ProfessionalBaseDeptBLL();

            loginModel         = (LoginModel)Session["loginModel"];
            writor.Text        = loginModel.real_name;
            real_name.Text     = loginModel.real_name;
            real_name.ReadOnly = true;
            if (string.IsNullOrEmpty(id))
            {
                register_date.Text = DateTime.Now.Date.ToString("yyyy-MM-dd");
            }


            na         = loginModel.name;
            name.Value = na;
            tbcode     = loginModel.training_base_code;

            studentsPersonalInformationModel = studentsPersonalInformationBLL.GetModelByNameTBCode(na, tbcode);

            if (studentsPersonalInformationModel == null)
            {
                Response.Write("<script> alert('请完善个人基本信息');window.close();</script>");
                return;
            }
            else
            {
                TrainingBaseCode.Value      = studentsPersonalInformationModel.TrainingBaseCode.ToString();
                training_base_name.Text     = studentsPersonalInformationModel.TrainingBaseName.ToString();
                training_base_name.ReadOnly = true;

                ProfessionalBaseCode.Value      = studentsPersonalInformationModel.ProfessionalBaseCode.ToString();
                professional_base_name.Text     = studentsPersonalInformationModel.ProfessionalBaseName.ToString();
                professional_base_name.ReadOnly = true;

                dt = professionalBaseDeptBLL.GetDeptDataTableByCode(studentsPersonalInformationModel.ProfessionalBaseCode.ToString());

                RotaryDept.DataSource = dt;

                RotaryDept.DataTextField  = "dept_name";
                RotaryDept.DataValueField = "dept_code";
                RotaryDept.DataBind();
                RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0"));
            }
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["loginModel"] == null)
        {
            Response.Write("<script>alert('请重新登录');opener.top.location.href='../../Default.aspx';window.close();</script>");
            return;
        }

        id = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["id"]));
        pi = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["pi"]));
        if (!IsPostBack)
        {
            loginModel = new LoginModel();
            studentsPersonalInformationModel = new StudentsPersonalInformation2Model();
            studentsPersonalInformationBLL   = new StudentsPersonalInformation2BLL();
            dt = new DataTable();


            professionalBaseDeptBLL = new ProfessionalBaseDeptBLL();

            loginModel            = (LoginModel)Session["loginModel"];
            Writor.Text           = loginModel.real_name;
            StudentsRealName.Text = loginModel.real_name; StudentsRealName.ReadOnly = true;
            RegisterDate.Text     = DateTime.Now.Date.ToString("yyyy-MM-dd");
            RegisterDate.ReadOnly = true;

            na = loginModel.name;
            StudentsName.Value = na;
            tbcode             = loginModel.training_base_code;

            studentsPersonalInformationModel = studentsPersonalInformationBLL.GetModelByNameTBCode(na, tbcode);

            if (studentsPersonalInformationModel == null)
            {
                Response.Write("<script> alert('请完善个人基本信息');window.close();</script>");
                return;
            }
            else
            {
                TrainingBaseCode.Value = studentsPersonalInformationModel.TrainingBaseCode.ToString();
                TrainingBaseName.Text  = studentsPersonalInformationModel.TrainingBaseName.ToString(); TrainingBaseName.ReadOnly = true;

                ProfessionalBaseCode.Value = studentsPersonalInformationModel.ProfessionalBaseCode.ToString();
                ProfessionalBaseName.Text  = studentsPersonalInformationModel.ProfessionalBaseName.ToString(); ProfessionalBaseName.ReadOnly = true;

                dt = professionalBaseDeptBLL.GetDeptDataTableByCode(studentsPersonalInformationModel.ProfessionalBaseCode.ToString());

                RotaryDept.DataSource = dt;

                RotaryDept.DataTextField  = "dept_name";
                RotaryDept.DataValueField = "dept_code";
                RotaryDept.DataBind();
                RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0"));
            }


            if (!string.IsNullOrEmpty(id))
            {//如果不是表单提交,并且带了id值来做修改操作,则在界面上把值都呈现出来
                rescuePatientRecordsModel = new RescuePatientRecordsModel();
                rescuePatientRecordsBLL   = new RescuePatientRecordsBLL();

                rescuePatientRecordsModel = rescuePatientRecordsBLL.GetModelById(id);
                StudentsRealName.Text     = rescuePatientRecordsModel.StudentsRealName.ToString();
                TrainingBaseName.Text     = rescuePatientRecordsModel.TrainingBaseName.ToString();
                ProfessionalBaseName.Text = rescuePatientRecordsModel.ProfessionalBaseName.ToString();
                //RotaryDept.SelectedItem.Text = rescuePatientRecordsModel.DeptName.ToString();
                RotaryDept.SelectedValue = rescuePatientRecordsModel.DeptCode.ToString();
                //RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0"));
                dt = new LoginBLL().GetTeachersDtByDeptCode(rescuePatientRecordsModel.TrainingBaseCode, rescuePatientRecordsModel.ProfessionalBaseCode, rescuePatientRecordsModel.DeptCode, "teachers");
                Teacher.DataSource     = dt;
                Teacher.DataTextField  = "real_name";
                Teacher.DataValueField = "name";
                Teacher.DataBind();
                Teacher.Items.Insert(0, new ListItem("==请选择==", "0"));
                Teacher.SelectedValue = rescuePatientRecordsModel.TeacherId;
                //Teacher.SelectedItem.Text = rescuePatientRecordsModel.TeacherName.ToString();
                //Teacher.SelectedItem.Value = rescuePatientRecordsModel.TeacherId.ToString();

                PatientName.Text   = rescuePatientRecordsModel.PatientName.ToString();
                CaseId.Text        = rescuePatientRecordsModel.CaseId.ToString();
                DiseaseName.Text   = rescuePatientRecordsModel.DiseaseName.ToString();
                Condition.Text     = rescuePatientRecordsModel.Condition.ToString();
                RescueMeasure.Text = rescuePatientRecordsModel.RescueMeasure.ToString();
                Comment.Text       = rescuePatientRecordsModel.Comment.ToString();
                Writor.Text        = rescuePatientRecordsModel.Writor.ToString();
                RegisterDate.Text  = rescuePatientRecordsModel.RegisterDate.ToString();
            }
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["loginModel"] == null)
        {
            Response.Write("<script>alert('请重新登录');opener.top.location.href='../../Default.aspx';window.close();</script>");
            return;
        }

        id = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["id"]));
        pi = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["pi"]));
        if (!IsPostBack)
        {
            loginModel = new LoginModel();
            studentsPersonalInformationModel = new StudentsPersonalInformation2Model();
            studentsPersonalInformationBLL   = new StudentsPersonalInformation2BLL();
            dt = new DataTable();


            professionalBaseDeptBLL = new ProfessionalBaseDeptBLL();

            loginModel              = (LoginModel)Session["loginModel"];
            writor.Text             = loginModel.real_name;
            students_real_name.Text = loginModel.real_name; students_real_name.ReadOnly = true;
            if (string.IsNullOrEmpty(id))
            {
                register_date.Text = DateTime.Now.Date.ToString("yyyy-MM-dd");
            }


            na = loginModel.name;
            students_name.Value = na;
            tbcode = loginModel.training_base_code;

            studentsPersonalInformationModel = studentsPersonalInformationBLL.GetModelByNameTBCode(na, tbcode);

            if (studentsPersonalInformationModel == null)
            {
                Response.Write("<script> alert('请完善个人基本信息');window.close();</script>");
                return;
            }
            else
            {
                TrainingBaseCode.Value  = studentsPersonalInformationModel.TrainingBaseCode.ToString();
                training_base_name.Text = studentsPersonalInformationModel.TrainingBaseName.ToString(); training_base_name.ReadOnly = true;

                ProfessionalBaseCode.Value  = studentsPersonalInformationModel.ProfessionalBaseCode.ToString();
                professional_base_name.Text = studentsPersonalInformationModel.ProfessionalBaseName.ToString(); professional_base_name.ReadOnly = true;

                dt = professionalBaseDeptBLL.GetDeptDataTableByCode(studentsPersonalInformationModel.ProfessionalBaseCode.ToString());

                RotaryDept.DataSource = dt;

                RotaryDept.DataTextField  = "dept_name";
                RotaryDept.DataValueField = "dept_code";
                RotaryDept.DataBind();
                RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0"));
            }


            if (!string.IsNullOrEmpty(id))
            {//如果不是表单提交,并且带了id值来做修改操作,则在界面上把值都呈现出来
                bedManagementMode = new BedManagementModel();
                bedManagementBLL  = new BedManagementBLL();

                bedManagementMode           = bedManagementBLL.GetModelById(id);
                students_real_name.Text     = bedManagementMode.students_real_name.ToString();
                training_base_name.Text     = bedManagementMode.training_base_name.ToString();
                professional_base_name.Text = bedManagementMode.professional_base_name.ToString();
                //RotaryDept.SelectedItem.Text = bedManagementMode.dept_name.ToString();
                RotaryDept.SelectedValue = bedManagementMode.dept_code.ToString();
                //RotaryDept.Items.Insert(0, new ListItem("==请选择==", "0"));
                dt = new LoginBLL().GetTeachersDtByDeptCode(bedManagementMode.training_base_code, bedManagementMode.professional_base_code, bedManagementMode.dept_code, "teachers");
                Teacher.DataSource     = dt;
                Teacher.DataTextField  = "real_name";
                Teacher.DataValueField = "name";
                Teacher.DataBind();
                Teacher.Items.Insert(0, new ListItem("==请选择==", "0"));
                Teacher.SelectedValue = bedManagementMode.TeacherId;
                //Teacher.SelectedItem.Text = bedManagementMode.TeacherName.ToString();
                //Teacher.SelectedItem.Value = bedManagementMode.TeacherId.ToString();


                patient_name.Text  = bedManagementMode.patient_name.ToString();
                patient_id.Text    = bedManagementMode.patient_id.ToString();
                bed_id.Text        = bedManagementMode.bed_id.ToString();
                bed_card.Text      = bedManagementMode.bed_card.ToString();
                bed_price.Text     = bedManagementMode.bed_price.ToString();
                bed_status.Text    = bedManagementMode.bed_status.ToString();
                room_id.Text       = bedManagementMode.room_id.ToString();
                building_id.Text   = bedManagementMode.building_id.ToString();
                comment.Text       = bedManagementMode.comment.ToString();
                writor.Text        = bedManagementMode.writor.ToString();
                register_date.Text = bedManagementMode.register_date.ToString();
            }
        }
    }