Ejemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (SqlConnection conn = new SqlConnection(Globals.ConnectionString))
            {
                PersonDAL personDAL = new PersonDAL(conn);

                string name = this.txtName_.Text;
                string birth = this.txtBirth.Text;
                string hujidi = this.txtHujidi.Text;
                string people = this.ddlPeople.SelectedValue;
                string sex = this.ddlSex.SelectedValue;
                string idnumber = this.txtIDNumber.Text;
                string mobile = this.txtMobile.Text;
                string hujitype = this.ddlHujiType.SelectedValue;
                string family_addr = this.txtFamilyAddr.Text;
                string family_postcode = this.txtFamilyPostCode.Text;
                string work_addr = this.txtWorkAddr.Text;
                string work_postcode = this.txtWorkPostCode.Text;

                DataRow person = personDAL.GetAPerson(personid);

                person["realName"] = name;
                person["Birthday"] = DateTime.Parse(birth);
                person["Hujidi"] = hujidi;
                person["People"] = people;
                person["gendar"] = sex;
                person["Idnumber"] = idnumber;
                person["mobile"] = mobile;
                person["hujitype"] = hujitype;
                person["family_addr"] = family_addr;
                person["family_postcode"] = family_postcode;
                person["work_addr"] = work_addr;
                person["work_postcode"] = work_postcode;

                personDAL.Update(person);

                string from = ViewState["from"].ToString();
                if (from.Equals("reg"))
                {
                    //GetAlertMsg("用户基本信息已更新,注册完成,请使用契合网签系统.");
                    //Response.Redirect("../index.aspx");

                    GetSuccessMsg("用户基本信息已更新,注册完成,请使用契合网签系统.","../index.aspx",false);
                }
                else
                {
                    GetAlertMsg("用户基本信息已更新");
                }
            }
        }
Ejemplo n.º 2
0
        private void BindData()
        {
            string pid = this._personid;
            ViewState["personid"] = pid;

            PersonDAL personDAL = new PersonDAL(_conn);
            SysResDAL sysResDAL = new SysResDAL(_conn);

            DataRow pa = personDAL.GetAPerson(pid);
            if (null == pa) return;

            this.lRealName.Text = Functions.CleanDBString(pa["realname"]);
            this.lBirthday.Text = Functions.GetShortDateStringFromNullableDateTime(Functions.CleanDBDateTime(pa["birthday"]));
            this.lIDNumber.Text = Functions.CleanDBString(pa["idnumber"]);
            this.lHujidi.Text = Functions.CleanDBString(pa["hujidi"]);
            this.lSex.Text = SexHashTable.GetName(Functions.CleanDBInt(pa["gendar"]));
            this.lPeople.Text = sysResDAL.GetResName("res_people", Functions.CleanDBString(pa["people"]));
            this.lRealName.Text = Functions.CleanDBString(pa["realname"]);
        }
Ejemplo n.º 3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (SqlConnection conn = new SqlConnection(Globals.ConnectionString))
            {
                string password = this.txtPassword.Text;
                string newpassword = this.txtNewPassword.Text;
                string newpassword2 = this.txtNewPassword2.Text;

                string password_md5 = CommonBLL.GetMD5Password(password);

                //if (!newpassword.Equals(newpassword2)) {
                //    GetSuccessMsg("两次输入新密码不一致.");
                //    return;
                //}

                PersonDAL personDAL = new PersonDAL(conn);
                DataRow person = personDAL.GetAPerson(personid);

                CommonDAL dal = new CommonDAL(conn);

                if (password_md5.Equals(Functions.CleanDBString(person["password"])))
                {
                    string newpassword_md5 = CommonBLL.GetMD5Password(newpassword);
                    string sql = "update person set password='******',passworduserchanged=1 where id='" + personid+"'";
                    dal.ExecSQL(sql);
                    Session["person.passworduserchanged"] = 1;
                    GetSuccessMsg("密码已更新", "../index.aspx");
                    return;
                }
                else
                {
                    GetSuccessMsg("原密码不正确");
                    return;
                }
            }
        }
Ejemplo n.º 4
0
        private void BindData(SqlConnection conn)
        {
            PersonDAL personDAL = new PersonDAL(conn);

            DataRow person = personDAL.GetAPerson(personid);

            this.lUserCode.Text = Functions.CleanDBString(person["usercode"]);

            this.txtIDNumber.Text = Functions.CleanDBString(person["Idnumber"]);
            this.txtIDNumber0.Text = this.txtIDNumber.Text;

            this.txtName_.Text = Functions.CleanDBString(person["realname"]);

            DateTime? birthday = Functions.CleanDBDateTime(person["Birthday"]);
            if (null == birthday)
            {
                 this.txtBirth.Text = Functions.GetShortDateStringFromNullableDateTime(
                     Functions.GetBirthDayFromIDNumber(Functions.CleanDBString(person["Idnumber"])));
            }else{
                this.txtBirth.Text = Functions.GetShortDateStringFromNullableDateTime(birthday);
            }
            this.txtHujidi.Text = Functions.CleanDBString(person["Hujidi"]);
            this.ddlSex.SelectedValue = Functions.ParseStr(Functions.CleanDBInt(person["gendar"]));
            this.ddlPeople.SelectedValue = Functions.CleanDBString(person["People"]);

            this.txtMobile.Text = Functions.CleanDBString(person["mobile"]);
            this.ddlHujiType.SelectedValue = Functions.CleanDBString(person["hujitype"]);

            this.txtFamilyAddr.Text = Functions.CleanDBString(person["family_addr"]);
            this.txtFamilyPostCode.Text = Functions.CleanDBString(person["family_postcode"]);
            this.txtWorkAddr.Text = Functions.CleanDBString(person["work_addr"]);
            this.txtWorkPostCode.Text = Functions.CleanDBString(person["work_postcode"]);
        }