Пример #1
0
        public DataTable  Gettable()
        {
            DataTable dt = new DataTable();

            QPS.NEW.BLL.Enterprise         user      = new QPS.NEW.BLL.Enterprise();
            QPS.NEW.BLL.Users              u         = 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();
            QPS.NEW.BLL.Integral           Bint      = new QPS.NEW.BLL.Integral();
            List <QPS.NEW.Model.Room>      roomList  = new List <QPS.NEW.Model.Room>();
            List <QPS.NEW.Model.Orderform> orderlist = new List <QPS.NEW.Model.Orderform>();
            //创建新列

            //DataColumn dc0 = dt.Columns.Add("积分编号", typeof(int));
            DataColumn dc1 = dt.Columns.Add("用户名称", typeof(string));
            //DataColumn dc2 = dt.Columns.Add("棋牌室名称", typeof(string));
            DataColumn dc3 = dt.Columns.Add("积分", typeof(string));

            //DataColumn dc4 = dt.Columns.Add("消费时间", typeof(string));
            if (Session["username"] != null)
            {
                //获取Uid
                string  uname  = Session["username"].ToString();
                DataSet dsUser = user.GetList("Username='******'");
                int     uid    = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]);



                QPS.NEW.Model.Integral mInt = new NEW.Model.Integral();
                mInt = Bint.GetModel(uid);
                if (mInt != null)
                {
                    DataRow dr = dt.NewRow();
                    dr[0] = uname;
                    dr[1] = mInt.TotalMoney.ToString();
                    dt.Rows.Add(dr);
                }
            }
            return(dt);
        }
Пример #2
0
        public DataTable  Gettable()
        {   
            DataTable dt = new DataTable();
            QPS.NEW.BLL.Enterprise user = new QPS.NEW.BLL.Enterprise();
            QPS.NEW.BLL.Users u = 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();
            QPS.NEW.BLL.Integral Bint = new QPS.NEW.BLL.Integral();
            List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>();
            List<QPS.NEW.Model.Orderform> orderlist = new List<QPS.NEW.Model.Orderform>();
            //创建新列

            //DataColumn dc0 = dt.Columns.Add("积分编号", typeof(int));
            DataColumn dc1 = dt.Columns.Add("用户名称", typeof(string));
            //DataColumn dc2 = dt.Columns.Add("棋牌室名称", typeof(string));
            DataColumn dc3 = dt.Columns.Add("积分", typeof(string));
            //DataColumn dc4 = dt.Columns.Add("消费时间", typeof(string));
            if (Session["username"] != null)
            {
                //获取Uid
                string uname = Session["username"].ToString();
                DataSet dsUser = user.GetList("Username='******'");
                int uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]);



                QPS.NEW.Model.Integral mInt = new NEW.Model.Integral();
                mInt = Bint.GetModel(uid);
                if (mInt != null)
                {
                    DataRow dr = dt.NewRow();
                    dr[0] = uname;
                    dr[1] = mInt.TotalMoney.ToString();
                    dt.Rows.Add(dr);
                }

           }
                    return dt;
        }
Пример #3
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");
            }
        }