Example #1
0
        public DataTable databind()
        {
            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.BLL.Room               BRoom     = new QPS.NEW.BLL.Room();
            QPS.NEW.Model.Room             Mroom     = new QPS.NEW.Model.Room();
            QPS.NEW.BLL.Orderform          Border    = new QPS.NEW.BLL.Orderform();
            List <QPS.NEW.Model.Room>      roomList  = new List <QPS.NEW.Model.Room>();
            List <QPS.NEW.Model.Orderform> orderList = new List <QPS.NEW.Model.Orderform>();
            List <QPS.NEW.Model.Users>     userList  = new List <QPS.NEW.Model.Users>();
            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(float));
            DataColumn dc4 = dt.Columns.Add("是否有效", typeof(string));

            dc0.ReadOnly = true;
            dc1.ReadOnly = true;
            dc2.ReadOnly = true;

            DataSet dsUser = user.GetList("Username='******'");

            uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]);
            //获取RoomID
            DataSet dsRoom = BRoom.GetList("OwnerID='" + uid + "' ");

            for (int i = 0; i < dsRoom.Tables[0].Rows.Count; i++)
            {
                int roomid                 = Convert.ToInt32(dsRoom.Tables[0].Rows[i]["Id"]);
                QPS.NEW.Model.Room r       = BRoom.GetModel(roomid);
                DataSet            dsOrder = Border.GetList("Roomid='" + roomid + "' and IsDelete=0");
                if (dsOrder.Tables[0].Rows.Count == 0)
                {
                    continue;
                }
                for (int j = 0; j < dsOrder.Tables[0].Rows.Count; j++)
                {
                    DataRow dr = dt.NewRow();
                    dr[1] = r.Name;
                    //订单ID
                    int orderid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Id"]);
                    dr[0] = orderid;
                    int    userid   = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Userid"]);
                    string username = u.GetModel(userid).Username;
                    dr[2] = username;
                    dr[3] = dsOrder.Tables[0].Rows[j]["Beveragecost"];
                    dr[4] = dsOrder.Tables[0].Rows[j]["RoomType"];
                    dt.Rows.Add(dr);
                }
            }
            return(dt);
        }
Example #2
0
        public DataTable databind()
        {
          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.BLL.Room BRoom = new QPS.NEW.BLL.Room();
        QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room();
        QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform();
        List<QPS.NEW.Model.Room> roomList = new List<QPS.NEW.Model.Room>();
        List<QPS.NEW.Model.Orderform> orderList = new List<QPS.NEW.Model.Orderform>();
        List<QPS.NEW.Model.Users> userList = new List<QPS.NEW.Model.Users>();
         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(float));
        DataColumn dc4 = dt.Columns.Add("是否有效",typeof(string));
          dc0.ReadOnly = true;
        dc1.ReadOnly = true;
        dc2.ReadOnly = true;
       
         DataSet dsUser = user.GetList("Username='******'");
              uid = Convert.ToInt32(dsUser.Tables[0].Rows[0]["Id"]);
                //获取RoomID
                DataSet dsRoom = BRoom.GetList("OwnerID='"+uid+"' ");
                for (int i = 0; i < dsRoom.Tables[0].Rows.Count; i++)
                {
                    int  roomid =Convert.ToInt32(dsRoom.Tables[0].Rows[i]["Id"]);
                    QPS.NEW.Model.Room r = BRoom.GetModel(roomid);
                    DataSet dsOrder = Border.GetList("Roomid='" + roomid + "' and IsDelete=0");
                    if (dsOrder.Tables[0].Rows.Count == 0)
                        continue;
                    for (int j = 0; j < dsOrder.Tables[0].Rows.Count; j++)
                    {   
                        DataRow dr = dt.NewRow();
                        dr[1] = r.Name;
                        //订单ID
                        int orderid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Id"]);
                        dr[0] = orderid;
                        int userid = Convert.ToInt32(dsOrder.Tables[0].Rows[j]["Userid"]);
                        string username=  u.GetModel(userid).Username;
                        dr[2]=username;
                        dr[3] = dsOrder.Tables[0].Rows[j]["Beveragecost"]; 
                        dr[4]=dsOrder.Tables[0].Rows[j]["RoomType"];
                        dt.Rows.Add(dr);
                    }                  
        }
            return dt;
        }
Example #3
0
 protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     //得到单位编号
     string rowToDelete = this.gdvRoom.DataKeys[e.RowIndex].Values[0].ToString();
     //转换为整数
     int ID = Convert.ToInt32(rowToDelete);
     QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform();
     QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room();
     if (Broom.GetModel(ID).RoomState == 1)//说明此房间被预定需要从订单中删除
     {
         DataSet dsOrder = Border.GetList("Roomid='" + ID + "'");
         int Oid = Convert.ToInt32(dsOrder.Tables[0].Rows[0]["Id"]);
         Border.Delete(Oid);
     }
     Broom.Delete(ID);
     databind(gdvRoom);
 }
Example #4
0
       protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e)
       {
          //得到单位编号
           string rowToDelete = gdvPersonnalOrder.DataKeys[e.RowIndex].Values[0].ToString();
         //转换为整数
          int ID=Convert.ToInt32(rowToDelete);
          QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform();
          QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room();
 
          DataSet dsorder= Border.GetList("Roomid ='" + ID + "'");
          int Oid = Convert.ToInt32(dsorder.Tables[0].Rows[0]["Id"]);
          Border.Delete(Oid);
          QPS.NEW.Model.Room r = Broom.GetModel(ID);
          r.RoomState = 0;
          Broom.Update(r);
          databind(gdvPersonnalOrder);
       }
Example #5
0
        protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            //得到单位编号
            string rowToDelete = this.gdvRoom.DataKeys[e.RowIndex].Values[0].ToString();
            //转换为整数
            int ID = Convert.ToInt32(rowToDelete);

            QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform();
            QPS.NEW.BLL.Room      Broom  = new QPS.NEW.BLL.Room();
            if (Broom.GetModel(ID).RoomState == 1)//说明此房间被预定需要从订单中删除
            {
                DataSet dsOrder = Border.GetList("Roomid='" + ID + "'");
                int     Oid     = Convert.ToInt32(dsOrder.Tables[0].Rows[0]["Id"]);
                Border.Delete(Oid);
            }
            Broom.Delete(ID);
            databind(gdvRoom);
        }
Example #6
0
        protected void gdvPersonnalOrder_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            //得到单位编号
            string rowToDelete = gdvPersonnalOrder.DataKeys[e.RowIndex].Values[0].ToString();
            //转换为整数
            int ID = Convert.ToInt32(rowToDelete);

            QPS.NEW.BLL.Orderform Border = new QPS.NEW.BLL.Orderform();
            QPS.NEW.BLL.Room      Broom  = new QPS.NEW.BLL.Room();

            DataSet dsorder = Border.GetList("Roomid ='" + ID + "'");
            int     Oid     = Convert.ToInt32(dsorder.Tables[0].Rows[0]["Id"]);

            Border.Delete(Oid);
            QPS.NEW.Model.Room r = Broom.GetModel(ID);
            r.RoomState = 0;
            Broom.Update(r);
            databind(gdvPersonnalOrder);
        }