Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        StudentsPersonalInformationModel studentsPersonalInformationModel = null;

        id = CommonFunc.SafeGetStringFromObj(Request.QueryString["id"]);
        pi = CommonFunc.SafeGetStringFromObj(Request.QueryString["pi"]);
        if (Session["loginModel"] == null)
        {
            Response.Write("<script>alert('请重新登录');opener.top.location.href='../../Default.aspx';window.close();</script>");
            return;
        }

        if (!IsPostBack)
        {
            studentsPersonalInformationModel = new StudentsPersonalInformationModel();
            studentsPersonalInformationModel = studentsPersonalInformationBLL.GetModelById(id);

            real_name.Text = studentsPersonalInformationModel.real_name.ToString();

            sex.SelectedValue = studentsPersonalInformationModel.sex.ToString();

            id_number.Text = studentsPersonalInformationModel.id_number.ToString();

            datebirth.Text   = studentsPersonalInformationModel.datebirth.ToString();
            age.Text         = studentsPersonalInformationModel.age.ToString();
            datebirth1.Value = studentsPersonalInformationModel.datebirth.ToString();
            age1.Value       = studentsPersonalInformationModel.age.ToString();

            province1.Value = studentsPersonalInformationModel.province.ToString();
            city1.Value     = studentsPersonalInformationModel.city.ToString();
            area1.Value     = studentsPersonalInformationModel.area.ToString();

            detail_address.Text = studentsPersonalInformationModel.detail_address.ToString();
            telephon.Text       = studentsPersonalInformationModel.telephon.ToString();
            mail.Text           = studentsPersonalInformationModel.mail.ToString();

            minzu.SelectedValue = studentsPersonalInformationModel.minzu.ToString();

            bk_school.Text       = studentsPersonalInformationModel.bk_school.ToString();
            bk_major.Text        = studentsPersonalInformationModel.bk_major.ToString();
            graduation_time.Text = studentsPersonalInformationModel.graduation_time.ToString();

            high_education.SelectedValue = studentsPersonalInformationModel.high_education.ToString();

            high_school.Text         = studentsPersonalInformationModel.high_school.ToString();
            high_major.Text          = studentsPersonalInformationModel.high_major.ToString();
            high_education_time.Text = studentsPersonalInformationModel.high_education_time.ToString();

            identity_type.SelectedValue = studentsPersonalInformationModel.identity_type.ToString();

            send_unit.Text = studentsPersonalInformationModel.send_unit.ToString();

            training_base_province_code.Value = studentsPersonalInformationModel.training_base_province_code.ToString();
            training_base_province_name.Value = studentsPersonalInformationModel.training_base_province_name.ToString();
            training_base_code.Value          = studentsPersonalInformationModel.training_base_code.ToString();
            training_base_name.Value          = studentsPersonalInformationModel.training_base_name.ToString();

            collaborative_unit.Text = studentsPersonalInformationModel.collaborative_unit.ToString();

            professional_base_code.Value = studentsPersonalInformationModel.professional_base_code.ToString();
            professional_base_name.Value = studentsPersonalInformationModel.professional_base_name.ToString();

            training_time.Text = studentsPersonalInformationModel.training_time.ToString();

            plan_training_time.SelectedValue = studentsPersonalInformationModel.plan_training_time.ToString();

            writor.Text        = studentsPersonalInformationModel.writor.ToString();
            register_date.Text = studentsPersonalInformationModel.register_date.ToString();
        }
    }
Пример #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;
        }
        pi = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["pi"]));
        id = CommonFunc.FilterSpecialString(CommonFunc.SafeGetStringFromObj(Request.QueryString["id"]));

        if (!IsPostBack)
        {
            loginModel         = (LoginModel)Session["loginModel"];
            writor.Text        = loginModel.real_name;
            real_name.Text     = loginModel.real_name;
            register_date.Text = DateTime.Now.Date.ToString("yyyy-MM-dd");
            na = loginModel.name;
            training_time.Text = DateTime.Now.Year.ToString() + "年";

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

                real_name.Text = studentsPersonalInformationModel.real_name == null?"":studentsPersonalInformationModel.real_name.ToString();

                sex.SelectedValue = studentsPersonalInformationModel.sex == null?"":studentsPersonalInformationModel.sex.ToString();

                id_number.Text = studentsPersonalInformationModel.id_number == null ? "" : studentsPersonalInformationModel.id_number.ToString();

                datebirth.Text = studentsPersonalInformationModel.datebirth == null ? "" : studentsPersonalInformationModel.datebirth.ToString();
                age.Text       = studentsPersonalInformationModel.age == null ? "" : studentsPersonalInformationModel.age.ToString();
                datebirth.Text = studentsPersonalInformationModel.datebirth == null ? "" : studentsPersonalInformationModel.datebirth.ToString();
                age.Text       = studentsPersonalInformationModel.age == null ? "" : studentsPersonalInformationModel.age.ToString();

                province_name.Value = studentsPersonalInformationModel.province == null ? "" : studentsPersonalInformationModel.province.ToString();
                city_name.Value     = studentsPersonalInformationModel.city == null ? "" : studentsPersonalInformationModel.city.ToString();
                area_name.Value     = studentsPersonalInformationModel.area == null ? "" : studentsPersonalInformationModel.area.ToString();

                province_code.Value = studentsPersonalInformationModel.province_code == null ? "" : studentsPersonalInformationModel.province_code.ToString();
                city_code.Value     = studentsPersonalInformationModel.city_code == null ? "" : studentsPersonalInformationModel.city_code.ToString();
                area_code.Value     = studentsPersonalInformationModel.area_code == null ? "" : studentsPersonalInformationModel.area_code.ToString();

                detail_address.Text = studentsPersonalInformationModel.detail_address == null ? "" : studentsPersonalInformationModel.detail_address.ToString();
                telephon.Text       = studentsPersonalInformationModel.telephon == null ? "" : studentsPersonalInformationModel.telephon.ToString();
                mail.Text           = studentsPersonalInformationModel.mail == null ? "" : studentsPersonalInformationModel.mail.ToString();

                minzu.SelectedValue = studentsPersonalInformationModel.minzu == null ? "" : studentsPersonalInformationModel.minzu.ToString();

                bk_school.Text       = studentsPersonalInformationModel.bk_school == null ? "" : studentsPersonalInformationModel.bk_school.ToString();
                bk_major.Text        = studentsPersonalInformationModel.bk_major == null ? "" : studentsPersonalInformationModel.bk_major.ToString();
                graduation_time.Text = studentsPersonalInformationModel.graduation_time == null ? "" : studentsPersonalInformationModel.graduation_time.ToString();

                high_education.SelectedValue = studentsPersonalInformationModel.sex == null ? "" : studentsPersonalInformationModel.high_education.ToString();

                high_school.Text         = studentsPersonalInformationModel.high_school == null ? "" : studentsPersonalInformationModel.high_school.ToString();
                high_major.Text          = studentsPersonalInformationModel.high_major == null ? "" : studentsPersonalInformationModel.high_major.ToString();
                high_education_time.Text = studentsPersonalInformationModel.high_education_time == null ? "" : studentsPersonalInformationModel.high_education_time.ToString();

                identity_type.SelectedValue = studentsPersonalInformationModel.identity_type == null ? "" : studentsPersonalInformationModel.identity_type.ToString();

                send_unit.Text = studentsPersonalInformationModel.send_unit == null ? "" : studentsPersonalInformationModel.send_unit.ToString();

                training_base_province_code.Value = studentsPersonalInformationModel.training_base_province_code == null ? "" : studentsPersonalInformationModel.training_base_province_code.ToString();
                training_base_province_name.Value = studentsPersonalInformationModel.training_base_province_name == null ? "" : studentsPersonalInformationModel.training_base_province_name.ToString();
                training_base_code.Value          = studentsPersonalInformationModel.training_base_code == null ? "" : studentsPersonalInformationModel.training_base_code.ToString();
                training_base_name.Value          = studentsPersonalInformationModel.training_base_name == null ? "" : studentsPersonalInformationModel.training_base_name.ToString();

                collaborative_unit.Text = studentsPersonalInformationModel.collaborative_unit == null ? "" : studentsPersonalInformationModel.collaborative_unit.ToString();

                professional_base_code.Value = studentsPersonalInformationModel.professional_base_code == null ? "" : studentsPersonalInformationModel.professional_base_code.ToString();
                professional_base_name.Value = studentsPersonalInformationModel.professional_base_name == null ? "" : studentsPersonalInformationModel.professional_base_name.ToString();

                training_time.Text = studentsPersonalInformationModel.training_time == null ? "" : studentsPersonalInformationModel.training_time.ToString();

                plan_training_time.SelectedValue = studentsPersonalInformationModel.plan_training_time == null ? "" : studentsPersonalInformationModel.plan_training_time.ToString();

                writor.Text        = studentsPersonalInformationModel.writor == null ? "" : studentsPersonalInformationModel.writor.ToString();
                register_date.Text = studentsPersonalInformationModel.register_date == null ? "" : studentsPersonalInformationModel.register_date.ToString();

                urgent.Text          = studentsPersonalInformationModel.urgent == null ? "" : studentsPersonalInformationModel.urgent.ToString();
                urgent_telephon.Text = studentsPersonalInformationModel.urgent_telephon == null ? "" : studentsPersonalInformationModel.urgent_telephon.ToString();
                image_path.Value     = studentsPersonalInformationModel.image_path == null ? "" : studentsPersonalInformationModel.image_path.ToString();
            }
        }
    }