Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string Code     = txtCode.Text.Trim();
            string UserName = txtUserName.Text.Trim();
            string pwd      = txtpwd.Text.Trim();
            string TureName = txtTureName.Text.Trim();
            string UserTel  = txtUserTel.Text.Trim();
            string UserQQ   = txtUserQQ.Text.Trim();

            if (Code.ToLower() != (Session["DtCode"].ToString()).ToLower())
            {
                Response.Write("<script>alert('您输入的验证码与系统的不一致!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(UserName))
            {
                Response.Write("<script>alert('请输入会员名!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(pwd))
            {
                Response.Write("<script>alert('请输入密码!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(TureName))
            {
                Response.Write("<script>alert('请输入姓名!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(UserTel))
            {
                Response.Write("<script>alert('请输入联系电话!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(UserQQ))
            {
                Response.Write("<script>alert('请输入在线QQ!');</script>");
                return;
            }

            DtCms.Model.Member member = new DtCms.Model.Member();
            member.Username = UserName;
            member.Pwd      = pwd;
            member.Turename = TureName;
            member.Usertel  = UserTel;
            member.Userqq   = UserQQ;

            DtCms.BLL.Member bll = new DtCms.BLL.Member();
            bll.Add(member);
            Session["Member"] = UserName;
            Response.Write("<script>alert('注册成功!');window.location.href='index.aspx'</script>");
        }
Exemplo n.º 2
0
 protected void lbtnDel_Click(object sender, EventArgs e)
 {
     DtCms.BLL.Member bll = new DtCms.BLL.Member();
     //批量删除
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int      id = Convert.ToInt32(((Label)rptList.Items[i].FindControl("lb_id")).Text);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("cb_id");
         if (cb.Checked)
         {
             //删除记录
             bll.Delete(id);
         }
     }
     JscriptPrint("批量删除成功啦!", "List.aspx?" + CombUrlTxt(this.keywords, this.property) + "page=0", "Success");
 }
Exemplo n.º 3
0
 private void RptBind(string strWhere)
 {
     DtCms.BLL.Member bll = new DtCms.BLL.Member();
     //获得总条数
     this.pcount = bll.GetCount(strWhere);
     if (this.pcount > 0)
     {
         this.lbtnDel.Enabled = true;
     }
     else
     {
         this.lbtnDel.Enabled = false;
     }
     this.rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, "AddTime desc");
     this.rptList.DataBind();
 }
Exemplo n.º 4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string Code     = txtCode.Text.Trim();
            string UserName = txtUserName.Text.Trim();
            string pwd      = txtpwd.Text.Trim();

            if (Code.ToLower() != (Session["DtCode"].ToString()).ToLower())
            {
                Response.Write("<script>alert('您输入的验证码与系统的不一致!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(UserName))
            {
                Response.Write("<script>alert('请输入会员名!');</script>");
                return;
            }
            if (string.IsNullOrEmpty(pwd))
            {
                Response.Write("<script>alert('请输入密码!');</script>");
                return;
            }


            DtCms.Model.Member member = new DtCms.Model.Member();
            member.Username = UserName;
            member.Pwd      = pwd;

            DtCms.BLL.Member bll = new DtCms.BLL.Member();
            if (bll.GetCount(" Username='******' and Pwd='" + pwd + "' ") > 0)
            {
                Session["Member"] = UserName;
                Response.Write("<script>alert('登录成功!');window.location.href='index.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('登录失败,会员名或密码输入错误!');</script>");
            }
        }