コード例 #1
0
        public ActionResult Show(int bId, int pageIndex = 1, string bNamelike = "", string proId = "", string isPaid = "")
        {
            Bill     bill     = dbContext.Bill.Find(bId);
            BillShow billShow = new BillShow(bill);

            ViewData["pageIndex"] = pageIndex;   // 1
            ViewData["bNamelike"] = bNamelike;
            ViewData["proId"]     = proId;
            ViewData["isPaid"]    = isPaid;
            //ViewData["uNamelike"] = uNamelike;
            ViewData.Model = billShow;
            return(View());
        }
コード例 #2
0
        public ActionResult Show(int bId, int pageIndex = 1, string bNamelike = "", string proId = "", string isPaid = "")
        {
            //Bill bill = dbContext.Bill.Find(bId);
            Bill     bill     = billService.GetEntities(b => b.Id == bId).FirstOrDefault();
            BillShow billShow = new BillShow(bill);

            ViewData["pageIndex"] = pageIndex;   // 1
            ViewData["bNamelike"] = bNamelike;
            ViewData["proId"]     = proId;
            ViewData["isPaid"]    = isPaid;
            //ViewData["uNamelike"] = uNamelike;
            ViewData.Model = billShow;
            return(View());
        }
コード例 #3
0
        public List <BillShow> GetBillShowByRoom(int id)
        {
            List <BillShow> billShow = new List <BillShow>();
            string          query    = "SELECT dv.tenDV,bi.soLuong,dv.giaDV,bi.soLuong*dv.giaDV AS thanhTien  FROM dbo.Bill AS b,dbo.BillInfo AS bi,dbo.DichVu AS dv WHERE b.maBill=bi.maBill AND bi.maDV=dv.maDV AND b.status=0 and b.maPhong=" + id;
            //string query = "SELECT f.foodName,hd.soLuong,f.price,f.price*hd.soLuong AS N'thanhTien' FROM dbo.Bill AS b,dbo.ChitietHD AS hd,dbo.Food AS f WHERE hd.billID = b.billID AND hd.foodID = f.foodID AND b.stat=0 AND b.IDtable = " + id;
            DataTable dtTable = DataProvider.Instance.ExecuteQuery(query);

            foreach (DataRow item in dtTable.Rows)
            {
                BillShow bShow = new BillShow(item);
                billShow.Add(bShow);
            }
            return(billShow);
        }