Exemplo n.º 1
0
 private void chksADmin()
 {
     if (TxtUserName.Text == "" && TxtPassword.Text == "")
     {
         Alert.AlertAndRedirect("请输入账号密码!", "Login.aspx");
     }
     else
     {
         dr = data.GetDataReader("select * from  superadmin where name='" + TxtUserName.Text.Trim() + "'and password='******'");
         if (dr.Read())
         {
             Session["superadminid"] = dr["id"].ToString();
             Session["superadmin"]   = dr["name"].ToString();
             Response.Redirect("superadmin/main.html");
         }
         else
         {
             Alert.AlertAndRedirect("账号或密码错误,请重新登录!", "Login.aspx");
         }
     }
 }
Exemplo n.º 2
0
    private void chkADmin()
    {
        if (TxtUserName.Text == "" && TxtPassword.Text == "")
        {
            Alert.AlertAndRedirect("没有输入账号和密码!", "Login.aspx");
        }
        else
        {
            dr = data.GetDataReader("select * from  admin where admin='" + TxtUserName.Text.Trim() + "'and password='******'    ");
            if (dr.Read())
            {
                Session["admin"] = dr["admin"].ToString();

                Response.Redirect("index.html");
            }
            else
            {
                Alert.AlertAndRedirect("管理员的账号或者密码不对请重新登陆!", "login.aspx");
            }
        }
    }
 private void chkTeacUser()
 {
     if (UserName.Text == "" && PassWord.Text == "")
     {
         Alert.AlertAndRedirect("没有输入账号和密码!", "Login.aspx");
     }
     else
     {
         dr = data.GetDataReader("select * from  [Teachter] where Name='" + UserName.Text.Trim() + "'and Pwd='" + PassWord.Text.Trim() + "'");
         if (dr.Read())
         {
             Session["User"]   = dr["Name"].ToString();
             Session["UserId"] = dr["id"].ToString();
             Response.Redirect("Teachter/Default.aspx");
         }
         else
         {
             Alert.AlertAndRedirect("账号或者密码不对请重新登陆!", "Login.aspx");
         }
     }
 }
Exemplo n.º 4
0
 private void chkADmin()
 {
     if (TxtUserName.Text == "" && TxtPassword.Text == "")
     {
         Alert.AlertAndRedirect("没有输入账号和密码!", "Login.aspx");
     }
     else
     {
         dr = data.GetDataReader("select * from  admin where name='" + TxtUserName.Text.Trim() + "'and Pwd='" + TxtPassword.Text.Trim() + "'");
         if (dr.Read())
         {
             Session["adminid"] = dr["id"].ToString();
             Session["admin"]   = dr["name"].ToString();
             Response.Redirect("Admin/main.html");
         }
         else
         {
             Alert.AlertAndRedirect("管理员的账号或者密码不对请重新登陆!", "Login.aspx");
         }
     }
 }
Exemplo n.º 5
0
    protected void buyNow_Click(object sender, EventArgs e)
    {
        if (float.Parse(Label5.Text) < float.Parse(sellCount.Text))
        {
            Alert.AlertAndRedirect("对不起您购买的商品不能大于库存数量", "ShowShangPin.aspx?id=" + Request.QueryString["id"].ToString());
            return;
        }
        int       i;
        Hashtable Hash;

        //如果用户没有购物车,新生成一个
        if (Session["ShoppingCar"] == null)
        {
            Hash = new Hashtable();
        }
        else
        {
            //若用户已有购物车,则获取购物车对象
            Hash = (Hashtable)Session["ShoppingCar"];
        }
        string tb = sellCount.Text;
        string lb = Request.QueryString["id"].ToString();

        if (Int32.Parse(tb) > 0)
        {
            //如果购物车没有此商品,则新添加一个项
            if (!Hash.ContainsKey(lb))
            {
                //MyHashTable.add(index,object) index为hash表的关键字,Object为具体的内容
                Hash.Add(lb, Int32.Parse(tb));
            }
            //若购车车已存在该商品,则该商品数量+1
            else
            {
                Hash[lb] = (int)Hash[lb] + Convert.ToInt32(tb);
            }
        }
        Session["ShoppingCar"] = Hash;
        Response.Redirect("ByNow.aspx");
    }
Exemplo n.º 6
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["Type"].ToString() == "单选题")
        {
            string Title   = content1.Value;
            string AnswerA = txtAnswerA.Text;
            string AnswerB = txtAnswerB.Text;
            string AnswerC = txtAnswerC.Text;
            string AnswerD = txtAnswerD.Text;
            string Answer  = ddlAnswer.SelectedItem.Text;
            TD6.Visible = false;

            TD1.Visible = true;
            TD2.Visible = true;
            TD3.Visible = true;
            TD4.Visible = true;
            TD5.Visible = true;

            mydata.RunSql("update TiMu set Title='" + Title + "',AnswerA='" + AnswerA + "',AnswerB='" + AnswerB + "',AnswerC='" + AnswerC + "',AnswerD='" + AnswerD + "',Answer='" + Answer + "',Mark='" + txtScore.Text + "'  where id=" + Request.QueryString["id"].ToString());

            Alert.AlertAndRedirect("修改成功!", "TiMuLists.aspx");
        }
        else
        {
            string Title = content1.Value;


            TD6.Visible = true;

            TD1.Visible = false;
            TD2.Visible = false;
            TD3.Visible = false;
            TD4.Visible = false;
            TD5.Visible = false;
            mydata.RunSql("update TiMu set Title='" + Title + "',Answer='" + TextBox1.Text + "',Mark='" + txtScore.Text + "'  where id=" + Request.QueryString["id"].ToString());

            Alert.AlertAndRedirect("修改成功!", "TiMuLists.aspx");
        }
    }
Exemplo n.º 7
0
 protected void btnShop_Click(object sender, EventArgs e)
 {
     if (float.Parse(Label5.Text) < float.Parse(TextBox1.Text))
     {
         Alert.AlertAndRedirect("对不起您购买的服装不能大于库存数量", "ShowShangPin.aspx?id=" + Request.QueryString["id"].ToString());
     }
     else
     {
         string Orderid;
         if (Session["UserName"] == null)
         {
             Alert.AlertAndRedirect("您还没有登录,请登录后再购买,谢谢合作!", "Default.aspx");
         }
         else
         {
             SqlDataReader dr = data.GetDataReader("select top 1 * from ZhuDingDan where IsCheckout='否' and  Ordeuser='******' order by id desc  ");
             if (dr.Read())
             {
                 Orderid = dr["Orderid"].ToString();
             }
             else
             {
                 Orderid = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString();
                 string sqlOrder = "insert into ZhuDingDan(Orderid,Ordeuser,OrderStite,ShangPinId,shuliang)values('" + Orderid + "','" + Session["UserName"].ToString() + "','未发货','" + Request.QueryString["id"].ToString() + "','" + TextBox1.Text + "')";
                 data.RunSql(sqlOrder);
             }
             sqlconn.Open();
             string strid     = Page.Request.QueryString["ShangPinID"];
             float  Newdanjia = float.Parse(Label4.Text) * (float.Parse(Session["ZheKou"].ToString()) / 100);
             string sqlstr    = "insert into XiaShouDD"
                                + "(OrderID,OrderMember,ShangPinID,ShangPinName,ShangPinTypeID,ShangPinTypeName,ShangPinPrice,IsCheckout,shuliang)"
                                + " values('" + Orderid + "','" + Session["UserName"].ToString() + "','" + Request.QueryString["id"].ToString() + "','"
                                + Label2.Text + "','" + Hidden1.Value + "','" + Label3.Text
                                + "','" + Newdanjia + "','否','" + TextBox1.Text + "')";
             data.RunSql(sqlstr);
             Response.Redirect("Shopping.aspx");
         }
     }
 }
Exemplo n.º 8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataReader dr = data.GetDataReader("select * from Users where UserName='******' ");

        if (dr.Read())
        {
            Label2.Text = "账号已经存在";
            return;
        }
        SqlDataReader dr1 = data.GetDataReader("select * from Users where emal='" + txtemal.Text + "' ");

        if (dr1.Read())
        {
            Label2.Text = "注册邮箱已经存在"; return;
        }
        else
        {
            data.RunSql("insert into Users(emal,UserName,Sex,Age,Ds,pwd,UserType,XueXiao,XingMing,Photo,Tel)values('" + txtemal.Text + "','" + txtname.Text + "','" + DropDownList1.SelectedItem.Text + "','" + Age.Text + "','" + txtds.Text + "','" + TextBox1.Text + "','学生','" + XueXiao.Text + "','" + XingMing.Text + "','" + pic.Text + "','" + Tel.Text + "')");

            Alert.AlertAndRedirect("注册成功!", "Default.aspx");
        }
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Title = "网上购物平台";
        if (!IsPostBack)
        {
            if (Session["UserName"].ToString() == "")
            {
                Alert.AlertAndRedirect("您没有登陆不能充值", "Default.aspx");
            }
            else
            {
                SqlDataReader dr;
                dr = data.GetDataReader("select * from  Users  where id='" + Session["UserId"].ToString() + "'");
                if (dr.Read())
                {
                    Label1.Text = dr["MemberMoney"].ToString();

                    Label2.Text = dr["JiFen"].ToString();
                }
            }
        }
    }
Exemplo n.º 10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (int.Parse(txtSL.Text) < int.Parse(TextBox1.Text))
        {
            alert.Alertjs("数量不能大于库存数量!");
        }
        else
        {
            SqlDataReader dr;
            dr = data.GetDataReader("select   *  from YaoPinKucun where YaoPinId='" + DropDownList2.SelectedValue + "'  ");
            if (dr.Read())
            {
                string sql = "update YaoPinKucun set shuliang=shuliang-" + float.Parse(TextBox1.Text) + " where YaoPinId=" + DropDownList2.SelectedValue;
                data.RunSql(sql);
            }

            data.RunSql("insert into dbo.XiaoShou(GoodID,ShuLiang,UserID,YuanYin,CManger,XiaoShouJia,JinHuoJia)values('" + DropDownList2.SelectedValue + "','" + TextBox1.Text + "','" + Session["adminid"].ToString() + "','" + TextBox3.Text.Trim() + "','" + TextBox2.Text + "','" + Label1.Text + "','" + Label2.Text + "')");


            Alert.AlertAndRedirect("操作成功!", "XiaoShouManger.aspx");
        }
    }
Exemplo n.º 11
0
    private void chkstudent()
    {
        if (TxtUserName.Text == "" && TxtPassword.Text == "")
        {
            Alert.AlertAndRedirect("没有输入账号和密码!", "Login.aspx");
        }
        else
        {
            dr = data.GetDataReader("select * from  [StudentInfo] where xuehao='" + TxtUserName.Text.Trim() + "'and Pwd='" + TxtPassword.Text.Trim() + "'");
            if (dr.Read())
            {
                Session["user"] = dr["name"].ToString();

                Session["userid"] = dr["id"].ToString();
                Response.Redirect("Guest/main.html");
            }
            else
            {
                Alert.AlertAndRedirect("账号或者密码不对请重新登陆!", "Login.aspx");
            }
        }
    }
Exemplo n.º 12
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        SqlHelper data = new SqlHelper();

        SqlDataReader dr;

        dr = data.GetDataReader("select * from  [huiyuan] where username='******'and password='******'");
        if (dr.Read())
        {
            Session["username"] = dr["username"].ToString();

            Session["userid"] = dr["id"].ToString();



            Response.Redirect("Default.aspx");
        }
        else
        {
            Alert.AlertAndRedirect("UserName and Password don't match,try again!", "Login.aspx");
        }
    }
Exemplo n.º 13
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedValue == "单选题")
        {
            TD6.Visible = false;

            TD1.Visible = true;
            TD2.Visible = true;
            TD3.Visible = true;
            TD4.Visible = true;
            TD5.Visible = true;
            string Title   = content1.Value;
            string AnswerA = txtAnswerA.Text;
            string AnswerB = txtAnswerB.Text;
            string AnswerC = txtAnswerC.Text;
            string AnswerD = txtAnswerD.Text;
            string Answer  = ddlAnswer.SelectedItem.Text;

            mydata.RunSql("insert into TiMu(Title,AnswerA,AnswerB,AnswerC,AnswerD,Answer,Mark,Type)values('" + content1.Value + "','" + txtAnswerA.Text + "','" + txtAnswerB.Text + "','" + txtAnswerC.Text + "','" + txtAnswerD.Text + "','" + ddlAnswer.SelectedItem.Text + "','" + txtScore.Text + "','" + DropDownList1.SelectedValue + "')");
            Alert.AlertAndRedirect("添加成功!", "TiMuLists.aspx");
        }
        else
        {
            TD6.Visible = true;

            TD1.Visible = false;
            TD2.Visible = false;
            TD3.Visible = false;
            TD4.Visible = false;
            TD5.Visible = false;
            string Title = content1.Value;

            string Answer = TextBox1.Text;

            mydata.RunSql("insert into TiMu(Title,Answer,Mark,Type)values('" + content1.Value + "','" + Answer + "','" + txtScore.Text + "','" + DropDownList1.SelectedValue + "')");
            Alert.AlertAndRedirect("添加成功!", "TiMuLists.aspx");
        }
    }
Exemplo n.º 14
0
    private void chkADmin()
    {
        if (accounts.Value == "" && pwd.Value == "")
        {
            Alert.AlertAndRedirect("没有输入账号和密码!", "Login.aspx");
        }
        else
        {
            dr = data.GetDataReader("select * from  UsersInfo where Name='" + accounts.Value.Trim() + "'and Password='******'     and Roule='" + DropDownList1.SelectedValue + "'");
            if (dr.Read())
            {
                Session["adminid"] = dr["id"].ToString();

                Session["admin"]    = dr["name"].ToString();
                Session["UserName"] = dr["TName"].ToString();

                Session["Roule"] = dr["Roule"].ToString();

                Session["Bumen"] = dr["Bumen"].ToString();

                if (Session["Roule"].ToString() == "系统管理员")
                {
                    Response.Redirect("Admin/index.html");
                }



                if (Session["Roule"].ToString() == "员工")
                {
                    Response.Redirect("YaoPinManger/index.html");
                }
            }
            else
            {
                Alert.AlertAndRedirect("用户的账号或者密码不对请重新登陆!", "login.aspx");
            }
        }
    }
Exemplo n.º 15
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     if (DropDownList1.SelectedValue == "管理员")
     {
         chkADmin();
     }
     else
     {
         SqlDataReader dr = data.GetDataReader("select * from  [UserInfo] where zhigonghao='" + TxtUserName.Text.Trim() + "'and Pwd='" + TxtPassword.Text.Trim() + "'  ");
         if (dr.Read())
         {
             Session["user"]     = dr["zhigonghao"].ToString();
             Session["username"] = dr["UserTruename"].ToString();
             Session["hetong"]   = dr["hetong"].ToString();
             //Session["userid"] = dr["Userid"].ToString();
             Response.Redirect("UserManger/Default.aspx");
         }
         else
         {
             Alert.AlertAndRedirect("账号或者密码不对请重新登录!", "Login.aspx");
         }
     }
 }
Exemplo n.º 16
0
    protected void Submit1_ServerClick(object sender, EventArgs e)
    {
        if (lblyanzheng.Text != txtyan.Text)
        {
            js.Alertjs("验证码错误");
            return;
        }
        else
        {
            SqlDataReader sdr1;
            sdr1 = data.GetDataReader("select * from Admin where name='" + this.txtUserID.Text.Trim() + "' and pwd='" + this.txtPwd.Text.Trim() + "'");

            if (sdr1.Read())
            {
                Session["admin"] = sdr1["name"].ToString();
                Alert.AlertAndRedirect("恭喜您登录成功!", "index.htm");
            }
            else
            {
                Alert.AlertAndRedirect("登录失败!", "login.aspx");
            }
        }
    }
Exemplo n.º 17
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (int.Parse(txtSL.Text) < int.Parse(TextBox1.Text))
        {
            alert.Alertjs("数量不能大于库存数量!");
        }
        else
        {
            SqlDataReader dr;
            dr = data.GetDataReader("select   *  from YaoPinKucun where YaoPinId='" + DropDownList2.SelectedValue + "'  ");
            if (dr.Read())
            {
                data.RunSql("update YaoPinKucun set shuliang=shuliang-" + float.Parse(TextBox1.Text) + " where YaoPinId='" + DropDownList2.SelectedValue + "'");

                data.RunSql("insert into YaoPinChuKu(shuliang,CManger,YaoPinId,YuanYin)values(" + TextBox1.Text.Trim() + ",'" + Session["UserName"].ToString() + "','" + DropDownList2.SelectedValue + "','" + TextBox3.Text + "')");
                Alert.AlertAndRedirect("出库成功!", "ChuKuList.aspx");
            }
            else
            {
                Alert.AlertAndRedirect("当前库存不存在不能申请出库!", "ChuKuList.aspx");
            }
        }
    }
Exemplo n.º 18
0
 protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
 {
     //判断用户是否已登录,若未登录,则跳转到登录页面
     if (Session["UserName"] == null)
     {
         Alert.AlertAndRedirect("您还没有登录,请登录后再购买,谢谢合作!", "UserLogin.aspx");
     }
     //已登录,把商品信息持久化到ShoppingCart数据表中
     else
     {
         Label         ShangPinID = (Label)e.Item.FindControl("ShangPinID");
         SqlDataReader dr         = sqloperate.GetDataReader("select * from ShoppingCart where  pid='" + Convert.ToInt32(ShangPinID.Text) + "'and userid='" + Convert.ToInt32(Session["UserId"]) + "'");
         int           shuliang;
         string        mysql;
         int           n;
         //判断该商品是否已经存在于ShopingCart数据中
         if (dr.Read())
         {
             //已存在,原来的数量+1
             shuliang = Convert.ToInt32(dr["shuliang"].ToString());
             shuliang = shuliang + 1;
             mysql    = "update  ShoppingCart set shoutime='" + System.DateTime.Now + "',shuliang='" + shuliang + "'where pid ='" + Convert.ToInt32(ShangPinID.Text) + "'";
         }
         else
         {
             //未存在,新插入商品信息
             shuliang = 1;
             mysql    = "insert into ShoppingCart(pid,userid,shoutime,shuliang)values('" + Convert.ToInt32(ShangPinID.Text) + "','" + Convert.ToInt32(Session["UserId"]) + "','" + System.DateTime.Now + "','" + shuliang + "')";
         }
         n = SqlHelper.exexu(mysql);
         //操作完成,输出提示信息
         if (n > 0)
         {
             Page.RegisterClientScriptBlock("e", "<script>alert('加入购物车成功!')</script>");
         }
     }
 }
Exemplo n.º 19
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            DataSet ds_UserRegister = bll_UserRegister.GetList("UserName = '******'");

            if (txt_Username.Text == "" || txt_Password.Text == "")
            {
                Alert.AlertAndRedirect("用户名或密码不能为空!", "Login.aspx");
            }
            try
            {
                if (ds_UserRegister.Tables[0].Rows[0]["UserPassword"].ToString() == txt_Password.Text)
                {
                    Session["admin_id"] = ds_UserRegister.Tables[0].Rows[0]["UserID"].ToString();
                    Session["Type"]     = ds_UserRegister.Tables[0].Rows[0]["UserType"].ToString();
                    if (Session["type"].Equals("1"))
                    {
                        Alert.AlertAndRedirect("登录成功!", "OldMan.aspx");
                    }
                    if (Session["type"].Equals("2"))
                    {
                        Alert.AlertAndRedirect("登录成功!", "Doctor.aspx");
                    }
                    if (Session["type"].Equals("3"))
                    {
                        Alert.AlertAndRedirect("登录成功!", "Announcement.aspx");
                    }
                }
                else
                {
                    Alert.AlertAndRedirect("登录失败,用户名或密码错误!", "Login.aspx");
                }
            }
            catch (Exception)
            {
                Alert.AlertAndRedirect("登录失败,用户名或密码错误!", "Login.aspx");
            }
        }
Exemplo n.º 20
0
    protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (Session["UserName"] == null)
        {
            Alert.AlertAndRedirect("您还没有登录,请登录后再购买,谢谢合作!", "UserLogin.aspx");
        }

        else
        {
            int       i;
            Hashtable Hash;

            if (Session["ShoppingCar"] == null)
            {
                //如果用户没有分配购物车 新生成一个购物车
                Hash = new Hashtable();
            }
            else
            {
                //用户已有购物车
                Hash = (Hashtable)Session["ShoppingCar"];
            }
            //如果购物车已经有此宠物,宠物数量加1
            if (!Hash.Contains(e.CommandArgument))
            {
                Hash.Add(e.CommandArgument, 1);
            }
            else
            {
                int addBefore = Convert.ToInt32(Hash[e.CommandArgument].ToString()); //得到宠物数量
                Hash[e.CommandArgument] = (addBefore + 1);                           //宠物数量加1
            }

            Session["ShoppingCar"] = Hash;
        }
    }
Exemplo n.º 21
0
 //验证用户登录
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (TxtUserName.Text == "" && TxtPassword.Text == "")
     {
         Alert.AlertAndRedirect("没有输入账号和密码!", "Default.aspx");
     }
     else
     {
         SqlDataReader dr;
         dr = SystemMgr.BLL.Common.GetDataReader("select * from  Users where UserName='******'and pwd='" + TxtPassword.Text.Trim() + "' ");
         if (dr.Read())
         {
             Session["UserId"]   = dr["id"].ToString();
             Session["UserName"] = dr["UserName"].ToString();
             Session["XingMing"] = dr["XingMing"].ToString();
             Session["roule"]    = dr["UserType"].ToString();
             Response.Redirect("Default.aspx");
         }
         else
         {
             Alert.AlertAndRedirect("账号或者密码不对请重新登陆!", "Default.aspx");
         }
     }
 }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        int    id    = int.Parse(Request.QueryString["id"].ToString());
        string Sname = txtTitle.Text;

        string SPath   = pic.Text;
        string Student = Session["User"].ToString();

        //int Skemu = int.Parse(Label5.Text);



        int    SClassId   = int.Parse(Label6.Text);
        string SClassName = Label4.Text;

        //string SkemuName = Label3.Text;
        string sds = txtDs.Text;


        DateTime Saddtime = DateTime.Now;

        data.RunSql("insert into TJzuoye(id,SClassId,Sname,SClassName,SPath,Student,Saddtime,SDs) values(" + id + "," + SClassId + ",'" + Sname + "','" + SClassName + "','" + SPath + "','" + Student + "','" + Saddtime + "','" + sds + "')");
        Alert.AlertAndRedirect("提交作业成功!", "Mychenji.aspx");
    }
Exemplo n.º 23
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int sucCount   = 0; //成功删除数量
            int errorCount = 0; //删除出错数量


            for (int i = 0; i < rptList.Items.Count; i++)
            {
                long     id = long.Parse(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            Alert.AlertAndRedirect("删除成功!", Utils.CombUrlTxt("HealthDetails.aspx", "keywords={0}", this.keywords));
        }
Exemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Title = "充值中心";
     if (Session["UserName"] == null)
     {
         Response.Redirect("ssnotice.aspx");
     }
     if (!IsPostBack)
     {
         if (Session["UserName"].ToString() == "")
         {
             Alert.AlertAndRedirect("您没有登陆不能充值", "UserLogin.aspx");
         }
         else
         {
             SqlDataReader dr;
             dr = data.GetDataReader("select * from  Users  where id='" + Session["UserId"].ToString() + "'");
             if (dr.Read())
             {
                 Label1.Text = dr["MemberMoney"].ToString();
             }
         }
     }
 }
Exemplo n.º 25
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (lblyanzheng.Text != txtyan.Text)
        {
            Response.Write("<script>alert('验证码错误!');history.go(-1);</script>");
            return;
        }

        else
        {
            SqlDataReader dr = data.GetDataReader("select * from Users where  UserName='******'");
            if (dr.Read())
            {
                Label1.Text = "已经存在账号了";
            }
            else
            {
                //data.RunSql("insert into Users(emal,UserName,Sex,pwd,XingMing,Tel,Address,ShengRi)values('" + txtemal.Text + "','" + txtname.Text + "','" + DropDownList1.SelectedItem.Text + "','" + PwdEncrypt.MD5Encrypt64(TextBox1.Text) + "','" + XingMing.Text + "','" + Tel.Text + "','" + Address.Text + "','" + txttime.Value + "')");
                data.RunSql("insert into Users(UserName,pwd,Tel)values('" + txtname.Text + "','" + PwdEncrypt.MD5Encrypt64(TextBox1.Text) + "','" + Tel.Text + "')");

                Alert.AlertAndRedirect("注册成功!", "UserLogin.aspx");
            }
        }
    }
Exemplo n.º 26
0
 protected void ImageButtonSave_Click(object sender, ImageClickEventArgs e)
 {
     data.RunSql("insert into admin(name,pwd)values('" + txtname.Text + "','" + TextBox1.Text + "')");
     Alert.AlertAndRedirect("添加成功", "admin.aspx");
     InitData();
 }
Exemplo n.º 27
0
 protected void LinkButton1_Click(object sender, EventArgs e)
 {
     data.RunSql("update News set  Name='" + txtname.Text + "', Contents='" + txtcontents.Value + "'   where id=" + Request.QueryString["id"].ToString());
     Alert.AlertAndRedirect("修改成功", "NewsManger.aspx");
 }
 protected void btn_Submit_Click(object sender, EventArgs e)
 {
     data.RunSql("insert into  HostelInfo(Bid,BName,Num,Floor,Sex,Ds,RenShu,FeiYong,Kong)values('" + DropDownList1.SelectedValue + "','" + DropDownList1.SelectedItem.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + DropDownList2.SelectedValue + "','" + this.TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox4.Text + "')");
     Alert.AlertAndRedirect("AddSuccess", "AddHostelInfo.aspx");
 }
Exemplo n.º 29
0
 protected void ImageButtonSave_Click(object sender, ImageClickEventArgs e)
 {
     data.RunSql("insert into  TeachterInfo(xuehao,name,nianling,sex,jiguan,tel,Emal)values('" + txtxuehao.Text + "','" + txtUser.Text + "','" + txtnianling.Text + "','" + drsex.SelectedItem.Text + "','" + txtjg.Text + "','" + txttel.Text + "','" + txtEmal.Text + "')");
     Alert.AlertAndRedirect("添加成功请继续添加", "Addteachter2.aspx");
 }
Exemplo n.º 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        dr = data.GetDataReader("select * from  [pic] where upload='是'");
        if (dr.Read())
        {
            using (SqlConnection con = new SqlConnection("Data Source=qds164713652.my3w.com;Initial Catalog=qds164713652_db;Persist Security Info=True;User ID=qds164713652;Password=zhangwujun666"))
            {
                //根据输入的名称去匹配获取数据
                string         strSQL = "select hp from pic where name='" + Session["danwei"].ToString() + "'";
                SqlDataAdapter da     = new SqlDataAdapter(strSQL, con);
                DataSet        ds     = new DataSet();
                da.Fill(ds);
                //将取得的路径设置到Image控件的ImageUrl属性中去
                this.Image1.ImageUrl = "../" + ds.Tables[0].Rows[0]["hp"].ToString();
                this.demo.Text       = "../" + ds.Tables[0].Rows[0]["hp"].ToString();
            }



            using (SqlConnection con = new SqlConnection("Data Source=qds164713652.my3w.com;Initial Catalog=qds164713652_db;Persist Security Info=True;User ID=qds164713652;Password=zhangwujun666"))
            {
                //根据输入的名称去匹配获取数据
                string         strSQL = "select zz from pic where name='" + Session["danwei"].ToString() + "'";
                SqlDataAdapter da     = new SqlDataAdapter(strSQL, con);
                DataSet        ds     = new DataSet();
                da.Fill(ds);
                //将取得的路径设置到Image控件的ImageUrl属性中去
                this.Image2.ImageUrl = "../" + ds.Tables[0].Rows[0]["zz"].ToString();
                this.demo2.Text      = "../" + ds.Tables[0].Rows[0]["zz"].ToString();
            }



            using (SqlConnection con = new SqlConnection("Data Source=qds164713652.my3w.com;Initial Catalog=qds164713652_db;Persist Security Info=True;User ID=qds164713652;Password=zhangwujun666"))
            {
                //根据输入的名称去匹配获取数据
                string         strSQL = "select zs from pic where name='" + Session["danwei"].ToString() + "'";
                SqlDataAdapter da     = new SqlDataAdapter(strSQL, con);
                DataSet        ds     = new DataSet();
                da.Fill(ds);
                //将取得的路径设置到Image控件的ImageUrl属性中去
                this.Image3.ImageUrl = "../" + ds.Tables[0].Rows[0]["zs"].ToString();
                this.demo3.Text      = "../" + ds.Tables[0].Rows[0]["zs"].ToString();
            }

            using (SqlConnection con = new SqlConnection("Data Source=qds164713652.my3w.com;Initial Catalog=qds164713652_db;Persist Security Info=True;User ID=qds164713652;Password=zhangwujun666"))
            {
                //根据输入的名称去匹配获取数据
                string         strSQL = "select zl from pic where name='" + Session["danwei"].ToString() + "'";
                SqlDataAdapter da     = new SqlDataAdapter(strSQL, con);
                DataSet        ds     = new DataSet();
                da.Fill(ds);
                //将取得的路径设置到Image控件的ImageUrl属性中去
                this.Image4.ImageUrl = "../" + ds.Tables[0].Rows[0]["zl"].ToString();
                this.demo4.Text      = "../" + ds.Tables[0].Rows[0]["zl"].ToString();
            }
        }
        else
        {
            Alert.AlertAndRedirect("您还没有上传您的公司证件信息,请上传!", "pic.aspx");
        }
    }