Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["loginModel"] == null)
        {
            ShowMessageBox.Showmessagebox(this, "请重新登录", "../../Default.aspx");
            return;
        }

        if (!IsPostBack)
        {
            StudentsPersonalInformationModel studentsPersonalInformationModel = new StudentsPersonalInformationModel();
            StudentsPersonalInformationBLL   studentsPersonalInformationBLL   = new StudentsPersonalInformationBLL();
            loginModel    = (LoginModel)Session["loginModel"];
            students_name = loginModel.name;
        }
    }
Example #2
0
    protected void save_Click(object sender, EventArgs e)
    {
        bool count;

        datebirth.Text = datebirth1.Value;
        age.Text       = age1.Value;
        StudentsPersonalInformationModel studentspersonalinformationModel = new StudentsPersonalInformationModel();

        studentspersonalinformationModel.id        = id;
        studentspersonalinformationModel.real_name = CommonFunc.FilterSpecialString(real_name.Text.Trim());
        studentspersonalinformationModel.sex       = CommonFunc.FilterSpecialString(sex.SelectedValue.Trim());
        studentspersonalinformationModel.age       = CommonFunc.FilterSpecialString(age.Text.Trim());
        studentspersonalinformationModel.datebirth = CommonFunc.FilterSpecialString(datebirth.Text.Trim());
        studentspersonalinformationModel.minzu     = CommonFunc.FilterSpecialString(minzu.SelectedValue.Trim());

        studentspersonalinformationModel.province                    = CommonFunc.FilterSpecialString(province1.Value.Trim());
        studentspersonalinformationModel.city                        = CommonFunc.FilterSpecialString(city1.Value.Trim());
        studentspersonalinformationModel.area                        = CommonFunc.FilterSpecialString(area1.Value.Trim());
        studentspersonalinformationModel.detail_address              = CommonFunc.FilterSpecialString(detail_address.Text.Trim());
        studentspersonalinformationModel.id_number                   = CommonFunc.FilterSpecialString(id_number.Text.Trim());
        studentspersonalinformationModel.telephon                    = CommonFunc.FilterSpecialString(telephon.Text.Trim());
        studentspersonalinformationModel.mail                        = CommonFunc.FilterSpecialString(mail.Text.Trim());
        studentspersonalinformationModel.bk_school                   = CommonFunc.FilterSpecialString(bk_school.Text.Trim());
        studentspersonalinformationModel.bk_major                    = CommonFunc.FilterSpecialString(bk_major.Text.Trim());
        studentspersonalinformationModel.graduation_time             = CommonFunc.SafeGetDateTimeStringFromObjectByFormat(CommonFunc.FilterSpecialString(graduation_time.Text.Trim()), "yyyy-MM");
        studentspersonalinformationModel.high_education              = CommonFunc.FilterSpecialString(high_education.Text.Trim());
        studentspersonalinformationModel.high_school                 = CommonFunc.FilterSpecialString(high_school.Text.Trim());
        studentspersonalinformationModel.high_major                  = CommonFunc.FilterSpecialString(high_major.Text.Trim());
        studentspersonalinformationModel.high_education_time         = CommonFunc.SafeGetDateTimeStringFromObjectByFormat(CommonFunc.FilterSpecialString(high_education_time.Text.Trim()), "yyyy-MM");
        studentspersonalinformationModel.identity_type               = CommonFunc.FilterSpecialString(identity_type.SelectedValue.Trim());
        studentspersonalinformationModel.send_unit                   = CommonFunc.FilterSpecialString(send_unit.Text.Trim());
        studentspersonalinformationModel.training_base_province_code = CommonFunc.FilterSpecialString(training_base_province_code.Value.Trim());
        studentspersonalinformationModel.training_base_province_name = CommonFunc.FilterSpecialString(training_base_province_name.Value.Trim());
        studentspersonalinformationModel.training_base_code          = CommonFunc.FilterSpecialString(training_base_code.Value.Trim());
        studentspersonalinformationModel.training_base_name          = CommonFunc.FilterSpecialString(training_base_name.Value.Trim());
        studentspersonalinformationModel.collaborative_unit          = CommonFunc.FilterSpecialString(collaborative_unit.Text.Trim());
        studentspersonalinformationModel.professional_base_code      = CommonFunc.FilterSpecialString(professional_base_code.Value.Trim());
        studentspersonalinformationModel.professional_base_name      = CommonFunc.FilterSpecialString(professional_base_name.Value.Trim());
        studentspersonalinformationModel.training_time               = CommonFunc.FilterSpecialString(training_time.Text.Trim());
        studentspersonalinformationModel.plan_training_time          = CommonFunc.FilterSpecialString(plan_training_time.Text.Trim());
        studentspersonalinformationModel.writor                      = CommonFunc.FilterSpecialString(writor.Text.Trim());
        studentspersonalinformationModel.register_date               = CommonFunc.FilterSpecialString(register_date.Text.Trim());
        if (string.IsNullOrEmpty(studentspersonalinformationModel.id_number))
        {
            ShowMessageBox.Showmessagebox(this, "居民身份证号码不能为空", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.detail_address))
        {
            ShowMessageBox.Showmessagebox(this, "家庭详细地址不能为空", null);
            return;
        }
        if (studentspersonalinformationModel.detail_address.Length > 70)
        {
            ShowMessageBox.Showmessagebox(this, "家庭常住地址不能大于70个字符", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.sex))
        {
            ShowMessageBox.Showmessagebox(this, "性别不能为空", null);
            return;
        }


        if (string.IsNullOrEmpty(studentspersonalinformationModel.telephon))
        {
            ShowMessageBox.Showmessagebox(this, "常用手机号码不能为空", null);
            return;
        }
        if (!ValidityCheck.PhoneNumIsValid(studentspersonalinformationModel.telephon, this))
        {
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.mail))
        {
            ShowMessageBox.Showmessagebox(this, "常用邮箱不能为空", null);
            return;
        }
        if (!ValidityCheck.EmailIsValid(studentspersonalinformationModel.mail, this))
        {
            return;
        }

        if (string.IsNullOrEmpty(studentspersonalinformationModel.high_school))
        {
            ShowMessageBox.Showmessagebox(this, "最高学历毕业院校不能为空", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.high_major))
        {
            ShowMessageBox.Showmessagebox(this, "最高学历专业不能为空", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.high_education_time))
        {
            ShowMessageBox.Showmessagebox(this, "获得最高学历时间不能为空", null);
            return;
        }

        if (studentspersonalinformationModel.identity_type == "单位人")
        {
            if (string.IsNullOrEmpty(studentspersonalinformationModel.send_unit))
            {
                ShowMessageBox.Showmessagebox(this, "派出单位不能为空", null);
            }
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.training_base_name))
        {
            ShowMessageBox.Showmessagebox(this, "培训基地不能为空", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.professional_base_name))
        {
            ShowMessageBox.Showmessagebox(this, "培训专业不能为空", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.training_time))
        {
            ShowMessageBox.Showmessagebox(this, "参训时间不能为空", null);
            return;
        }
        if (string.IsNullOrEmpty(studentspersonalinformationModel.plan_training_time))
        {
            ShowMessageBox.Showmessagebox(this, "计划参训时间不能为空", null);
            return;
        }


        StudentsPersonalInformationBLL studentspersonalinformationBLL = new StudentsPersonalInformationBLL();

        count = studentspersonalinformationBLL.UpdateStudentsPersonalInformation(studentspersonalinformationModel);
        if (count)
        {
            try
            {
                Response.Write("<script> alert('个人信息修改成功');window.opener.window.loadPageList('" + pi + "');window.close();</script>");
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
        else
        {
            Response.Write("<script> alert('个人信息修改失败');</script>");
        }
    }
Example #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 StudentsPersonalInformationModel();
            studentsPersonalInformationBLL   = new StudentsPersonalInformationBLL();
            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
            {
                training_base_code.Value = studentsPersonalInformationModel.training_base_code.ToString();
                training_base_name.Text  = studentsPersonalInformationModel.training_base_name.ToString(); training_base_name.ReadOnly = true;

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

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

                rotary_dept_name.DataSource = dt;

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



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

                //rotary_dept_name.SelectedItem.Text = studentsRotaryModel.rotary_dept_name.ToString();
                rotary_dept_name.SelectedValue = studentsRotaryModel.rotary_dept_code.ToString();

                dt = new LoginBLL().GetTeachersDtByDeptCode(studentsRotaryModel.training_base_code, studentsRotaryModel.professional_base_code, studentsRotaryModel.rotary_dept_code, "teachers");
                Teacher.DataSource     = dt;
                Teacher.DataTextField  = "real_name";
                Teacher.DataValueField = "name";
                Teacher.DataBind();
                Teacher.Items.Insert(0, new ListItem("==请选择==", "0"));
                Teacher.SelectedValue = studentsRotaryModel.instructor_tag;

                //instructor.Text = studentsRotaryModel.instructor.ToString();
                //instructor_tag.Value = studentsRotaryModel.instructor_tag.ToString();
                //Teacher.SelectedItem.Text = studentsRotaryModel.instructor.ToString();
                //Teacher.SelectedItem.Value = studentsRotaryModel.instructor_tag.ToString();
                rotary_begin_time.Text = studentsRotaryModel.rotary_begin_time.ToString();
                rotary_end_time.Text   = studentsRotaryModel.rotary_end_time.ToString();
                register_date.Text     = studentsRotaryModel.register_date.ToString();
            }
        }
    }
Example #4
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();
            }
        }
    }