Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = 0;
            gnum(ref id,"id");
            if (!IsPostBack)
            {
                MemberDal mb = new MemberDal();
                MemberInfo info = new MemberInfo();
                info = mb.view(id);
                username.Value = info.username;
                truename.Value = info.truename;
                birth.Value = info.birth;
                if (info.sex)
                    sex1.Checked = true;
                else
                    sex2.Checked = true;

                email.Value = info.email;
                telphone.Value = info.telphone;
                mobile.Value = info.mobile;
                qq.Value = info.qq;
                address.Value = info.address;
                nickname.Value = info.nickname;
            }

        }
Exemplo n.º 2
0
        protected void btn_ServerClick(object sender, EventArgs e)
        {
            int id = 0;
            gnum(ref id, "id");
            MemberInfo info = new MemberInfo();
            info.username = pform("username");
            info.password = md5(pform("pwd"));
            if (pform("sex") == "1")
                info.sex = true;
            else
                info.sex = false;

            info.truename = pform("truename");
            info.email = pform("email");
            info.telphone = pform("telphone");
            info.mobile = pform("mobile");
            info.qq = pform("qq");
            info.birth = pform("birth");

            info.address = pform("address");
            info.nickname = pform("nickname");
            MemberDal mb = new MemberDal();
            mb.edit(info, id);
            showMessage("修改成功");
        }
Exemplo n.º 3
0
        public Userinfo()
        {
            
            if (ISPOST)
            {
                MemberInfo info = new MemberInfo();
                info.username = minfo.username;
                info.password = minfo.password;
                if (pform("sex") == "1")
                    info.sex = true;
                else
                    info.sex = false;

                info.truename = pform("truename");
                info.email = pform("email");
                info.telphone = pform("telphone");
                info.mobile = pform("mobile");
                info.qq = "123123";//pform("qq");
                info.birth = pform("birth");
                info.ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

                info.address = pform("address");
                MemberDal pb = new MemberDal();


                pb.edit(info, minfo.id);
                showMessage("Ð޸ijɹ¦");
            }
            
        }
Exemplo n.º 4
0
        /// <summary>
        /// µÇ½Óû§ÐÅÏ¢
        /// </summary>
        /// <returns></returns>
        public MemberInfo get()
        {
            if (islogin())
            {
                MemberDal dal = new MemberDal();

                return dal.view(getCookie("username"));
            }
            else
                return new MemberInfo();
        }
Exemplo n.º 5
0
 /// <summary>
 /// ×¢²á
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public bool register(MemberInfo info)
 {
     MemberDal bal = new MemberDal();
     if (bal.isreg(info.username))
     {
         bal.register(info);
         login(info.username,info.password);
         return true;
     }
     else
         return false;
 }
Exemplo n.º 6
0
        public int drop(int[] ids)
        {
            MemberDal dal = new MemberDal();
            int c = 0;
            foreach (int id in ids)
            {
                if (dal.drop(id))
                    c++;
            }

            return c;
        }
Exemplo n.º 7
0
        /// <summary>
        /// 怫
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public bool login(string username, string password)
        {
            MemberInfo info = new MemberInfo();
            info.username = username;
            info.password = password;
            MemberDal bal = new MemberDal();
            if (bal.login(info))
            {
                MemberInfo info1 = bal.view(username);
                if (info1.nickname != "" && info.username != null)
                    setCookie("nickname", Server.UrlEncode(info1.nickname));
                else
                    setCookie("nickname", username);

                setCookie("username", username);

                setCookie("password", md5(password));
                return true;
            }
            else
                return false;
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string app = gform("app");

            MemberDal mb = new MemberDal();
            if (app == "drop")
            {
                int id = gformNum("id");
                mb.drop(id);
                showMessage("删除成功");
            }
            int page = 1;
            gnum(ref page, "page");
            int pagesize = 10;
            
            list.DataSource = mb.get_list(page,pagesize);
            list.DataBind();

            int recordcount = mb.findcount("member", "");
            PageCurrent pg = new PageCurrent();
            pageBox = pg.page_list("?page=", pagesize, recordcount);
            
        }
Exemplo n.º 9
0
 public bool register(string username,string nickname, string password)
 {
     MemberDal bal = new MemberDal();
     if (bal.isreg(username))
     {
         bal.register(username, nickname, password);
         login(username, password);
         return true;
     }
     else
     {
         login(username, password);
         return false;
     }
 }