Ejemplo n.º 1
0
        //更改个人信息
        public void update_personal_information()
        {
            string email     = Request.QueryString["email"];
            string qq        = Request.QueryString["qq"];
            string wechat    = Request.QueryString["wechat"];
            string birthday  = Request.QueryString["birthday"];
            string sex       = Request.QueryString["sex"];
            string hometown  = Request.QueryString["hometown"];
            string introduce = Request.QueryString["introduce"];

            if (Session["username"] != null)
            {
                Users_Linq person = new Users_Linq();
                var        query  = from s in ta.Users_Linq where s.user_name == Session["username"].ToString() select s;
                person           = query.FirstOrDefault();
                person.email     = email;
                person.qq        = qq;
                person.wechat    = wechat;
                person.birthday  = birthday;
                person.sex       = sex;
                person.hometown  = hometown;
                person.introduce = introduce;
                ta.SubmitChanges();
                Response.Write("保存成功!");
                Response.End();
            }
        }
Ejemplo n.º 2
0
        public void register()
        {
            string     user     = Request.QueryString["register_user"];
            string     password = Request.QueryString["register_password"];
            Users_Linq a        = new Users_Linq();

            a.user_name     = user;
            a.user_password = password;
            ta.Users_Linq.InsertOnSubmit(a);
            ta.SubmitChanges();
            Response.Write("注册成功!返回登录页面");
            Response.End();
        }
Ejemplo n.º 3
0
        //传递个人信息
        public void personal_information()
        {
            if (Session["username"] != null)
            {
                Users_Linq person = new Users_Linq();
                var        query  = from s in ta.Users_Linq where s.user_name == Session["username"].ToString() select s;
                person = query.FirstOrDefault();
                string email     = person.email;
                string qq        = person.qq;
                string wechat    = person.wechat;
                string birthday  = person.birthday;
                string hometown  = person.hometown;
                string sex       = person.sex;
                string introduce = person.introduce;

                StringBuilder jsonBuilder = new StringBuilder();
                jsonBuilder.Append("{email:\"");
                jsonBuilder.Append(email);
                jsonBuilder.Append("\",qq:\"");
                jsonBuilder.Append(qq);
                jsonBuilder.Append("\",wechat:\"");
                jsonBuilder.Append(wechat);
                jsonBuilder.Append("\",birthday:\"");
                jsonBuilder.Append(birthday);
                jsonBuilder.Append("\",hometown:\"");
                jsonBuilder.Append(hometown);
                jsonBuilder.Append("\",sex:\"");
                jsonBuilder.Append(sex);
                jsonBuilder.Append("\",introduce:\"");
                jsonBuilder.Append(introduce);
                jsonBuilder.Append("\"}");

                Response.Write(jsonBuilder.ToString());
                Response.End();
            }
        }