Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                QPS.NEW.BLL.Users    user = new QPS.NEW.BLL.Users();
                QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral();
                if (Session["username"] != null)
                {
                    //获取Uid
                    string  uname  = Session["username"].ToString();
                    DataSet dsUser = user.GetList(uname);
                    int     uid    = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
                    DataSet dsInt  = Bint.GetListlocalize("UserID='" + uid + "'");
                    GridView1.DataSource = dsInt;
                    GridView1.DataBind();
                    // === modified by jeffery
                    DataTable dt = Bint.GetSum(uid).Tables[0];

                    if (dt == null || dt.Rows.Count <= 0 || dt.Rows[0][0].ToString().Trim() == "")
                    {
                        lblSum.Text = " 0";
                    }
                    else
                    {
                        lblSum.Text = Bint.GetSum(uid).Tables[0].Rows[0][0].ToString();
                    }
                    // ===
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.Calendar1.SelectedDate = DateTime.Now;
                this.Calendar2.SelectedDate = DateTime.Now;

                roomid = Int32.Parse(Request.QueryString["id"].Trim());
                StringBuilder sb = new StringBuilder();
                sb.Append("Id=");
                sb.Append(roomid);
                ds = room.GetList(sb.ToString());
                DataList1.DataSource = ds;
                DataList1.DataBind();
                if (Session["username"] != null)
                {
                    string uname = Session["username"].ToString();
                    txbOrderPersonInfo.Text = uname;
                    DataSet dsUser = user.GetList(uname);
                    if (dsUser.Tables[0].Rows[0]["Phone"].ToString() != "")
                    {
                        txbPhone.Text = dsUser.Tables[0].Rows[0]["Phone"].ToString();
                    }

                    userid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
                }
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users();
                QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral();
                if (Session["username"] != null)
                {
                    //获取Uid
                    string uname = Session["username"].ToString();
                    DataSet dsUser = user.GetList(uname);
                    int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
                    DataSet dsInt = Bint.GetListlocalize("UserID='" + uid + "'");
                    GridView1.DataSource = dsInt;
                    GridView1.DataBind();
                    // === modified by jeffery 
                    DataTable dt = Bint.GetSum(uid).Tables[0];

                    if (dt == null || dt.Rows.Count <= 0 || dt.Rows[0][0].ToString().Trim() == "")
                    {
                        lblSum.Text = " 0";
                    }
                    else
                    {
                        lblSum.Text = Bint.GetSum(uid).Tables[0].Rows[0][0].ToString();
                    }
                    // ===
                }
            }
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["username"] != null)
     {
         string uname = Session["username"].ToString();
         dsUser       = user.GetList(uname);
         txbname.Text = dsUser.Tables[0].Rows[0]["NickName"].ToString();
         userid       = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
     }
 }
Beispiel #5
0
        public void BindShow()
        {
            DataSet dse = new DataSet();
            QPS.NEW.BLL.Users Bus = new QPS.NEW.BLL.Users();
            dse = Bus.GetList(tempID);

            this.txtId.Text = tempID.ToString();
            this.txtName.Text = dse.Tables[0].Rows[0]["UserName"].ToString();
            this.txtPhone.Text = dse.Tables[0].Rows[0]["Phone"].ToString();

        }
Beispiel #6
0
        public void BindShow()
        {
            DataSet dse = new DataSet();

            QPS.NEW.BLL.Users Bus = new QPS.NEW.BLL.Users();
            dse = Bus.GetList(tempID);

            this.txtId.Text    = tempID.ToString();
            this.txtName.Text  = dse.Tables[0].Rows[0]["UserName"].ToString();
            this.txtPhone.Text = dse.Tables[0].Rows[0]["Phone"].ToString();
        }
Beispiel #7
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            string name = this.txlinkman.Text;
            string xingm = this.txlogin.Text;
            QPS.NEW.BLL.Users user =new QPS.NEW.BLL.Users ();
            ds = user.GetList(name,xingm);
            dgExamProj.DataSource = ds;
            dgExamProj.DataBind();

            //AboutBox方法,Refresh方法,SetFocus方法。
        }
Beispiel #8
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            string name  = this.txlinkman.Text;
            string xingm = this.txlogin.Text;

            QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users();
            ds = user.GetList(name, xingm);
            dgExamProj.DataSource = ds;
            dgExamProj.DataBind();

            //AboutBox方法,Refresh方法,SetFocus方法。
        }
Beispiel #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["username"] != null)
         {
             string  uname  = Session["username"].ToString();
             DataSet dsUser = user.GetList(uname);
             userid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
         }
         else
         {
             Response.Write("<script>alert('请先登录')</script>");
             return;
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["username"] != null)
         {
             string uname = Session["username"].ToString();
             txfUserName.Value = uname;
             DataSet dsUser = user.GetList(uname);
             txfPhone.Value    = dsUser.Tables[0].Rows[0]["Phone"].ToString();
             txfEmail.Value    = dsUser.Tables[0].Rows[0]["Email"].ToString();
             txfNickName.Value = dsUser.Tables[0].Rows[0]["NickName"].ToString();
             txfAddress.Value  = dsUser.Tables[0].Rows[0]["Address"].ToString();
             userid            = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
         }
     }
 }
Beispiel #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         QPS.NEW.BLL.Users     user   = new QPS.NEW.BLL.Users();
         QPS.NEW.BLL.Leaveword Bleave = new QPS.NEW.BLL.Leaveword();
         if (Session["username"] != null)
         {
             //获取Uid
             string  uname  = Session["username"].ToString();
             DataSet dsUser = user.GetList(uname);
             int     uid    = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
             DataSet dsInt  = Bleave.GetListLocalise("UserID='" + uid + "'");
             GridView1.DataSource = dsInt;
             GridView1.DataBind();
         }
     }
 }
Beispiel #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users();
         QPS.NEW.BLL.Leaveword  Bleave= new QPS.NEW.BLL.Leaveword();
         if (Session["username"] != null)
         {
             //获取Uid
             string uname = Session["username"].ToString();
             DataSet dsUser = user.GetList(uname);
             int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
             DataSet dsInt = Bleave.GetListLocalise("UserID='" + uid + "'");
             GridView1.DataSource = dsInt;
             GridView1.DataBind();
         }
     }
 }
Beispiel #13
0
 public void databind(GridView  gdv)
 {
     QPS.NEW.BLL.Users user = new QPS.NEW.BLL.Users();
     QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room();
     QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room();
     QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform();
     List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>();
     if (Session["username"] != null)
     {
         string uname = Session["username"].ToString();
         DataSet dsUser = user.GetList(uname);
         int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
         List<QPS.NEW.Model.Orderform> orderlist = Border.GetModelList("Userid='" + uid + "'");
         foreach (QPS.NEW.Model.Orderform o in orderlist)
         {
             int roomid = (int)o.Roomid;
             
             roomList.Add(Broom.GetModel(roomid));
         }
     }
     gdv.DataSource = Gettable(roomList);
     gdv.DataBind();
 }
Beispiel #14
0
        public void databind(GridView gdv)
        {
            QPS.NEW.BLL.Users         user     = new QPS.NEW.BLL.Users();
            QPS.NEW.Model.Room        Mroom    = new QPS.NEW.Model.Room();
            QPS.NEW.BLL.Room          Broom    = new QPS.NEW.BLL.Room();
            QPS.NEW.BLL.Orderform     Border   = new QPS.NEW.BLL.Orderform();
            List <QPS.NEW.Model.Room> roomList = new List <QPS.NEW.Model.Room>();

            if (Session["username"] != null)
            {
                string  uname  = Session["username"].ToString();
                DataSet dsUser = user.GetList(uname);
                int     uid    = Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"]);
                List <QPS.NEW.Model.Orderform> orderlist = Border.GetModelList("Userid='" + uid + "'");
                foreach (QPS.NEW.Model.Orderform o in orderlist)
                {
                    int roomid = (int)o.Roomid;

                    roomList.Add(Broom.GetModel(roomid));
                }
            }
            gdv.DataSource = Gettable(roomList);
            gdv.DataBind();
        }
Beispiel #15
0
        public string getResult(string action)
        {
            switch (action)
            {
            case "register":
                if (validate("register"))
                {
                    Muser.Username = ht["username"].ToString();
                    Muser.Nickname = ht["nickname"].ToString();
                    Muser.Password = ht["password"].ToString();
                    Muser.Sign     = "";
                    Muser.Usertype = 0;
                    if (Buser.Add(Muser) > 0)
                    {
                        return("true");
                    }
                    else
                    {
                        return("false");
                    }
                }
                else
                {
                    return("false");
                }

            case "login":
                if (validate("login"))
                {
                    if (Buser.Denglu(ht["username"].ToString(), ht["password"].ToString()))
                    {
                        Session["username"] = ht["username"].ToString();
                        return("true");
                    }
                    else
                    {
                        return("false");
                    }
                }
                else
                {
                    return("false");
                }

            case "score":
                if (validate("score"))
                {
                    string  uname  = ht["username"].ToString();
                    DataSet dsUser = Buser.GetList("Username='******'");
                    userid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]);
                    QPS.NEW.Model.Integral u = BInt.GetModel(userid);

                    if (u.TotalMoney == (int)ht["originalscore"])
                    {
                        u.TotalMoney = +(int)ht["score"];
                        if (BInt.Update(u))
                        {
                            return("true");
                        }
                        else
                        {
                            return("fales");
                        }
                    }
                    else
                    {
                        return("false");
                    }
                }
                else
                {
                    return("false");
                }

            case "editpwd":
                if (validate("editpwd"))
                {
                    string  uname  = ht["username"].ToString();
                    DataSet dsUser = Buser.GetList("Username='******'");
                    userid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]);
                    QPS.NEW.Model.Users u = Buser.GetModel(userid);
                    u.Password = ht["newpassword"].ToString();
                    if (Buser.Update(u))
                    {
                        return("true");
                    }
                    else
                    {
                        return("false");
                    }
                }
                else
                {
                    return("false");
                }

            case "logout":
                if (validate("logout"))
                {
                    if (Session["username"] != null)
                    {
                        Session.Remove("username");
                        return("true");
                    }
                    else
                    {
                        return("false");
                    }
                }
                else
                {
                    return("false");
                }

            default: return("false");
            }
        }