public static List <DTO.Menu> GetMenuListByTable(int id) { List <DTO.Menu> menus = new List <DTO.Menu>(); string sql = "select mon.TenMon, cthd.SoLuong, mon.GiaTien, cthd.SoLuong*GiaTien as TongTien from CHITIETHOADON cthd, HOADON hd, MONAN mon where cthd.idHoaDon = hd.id and cthd.idMonAn = mon.id and hd.TrangThaiHoaDon=0 and hd.idTable= " + id; DataTable data = KetNoiCSDL.Query(sql); foreach (DataRow row in data.Rows) { DTO.Menu menu = new DTO.Menu(row); menus.Add(menu); } return(menus); }
public List <DTO.Menu> GetListMenuByTableID(int id) { List <DTO.Menu> listMenu = new List <DTO.Menu>(); string query = "SELECT f.name,bi.count,f.price,f.price*bi.count AS TotalPrice FROM dbo.BillInfo AS bi,dbo.Bill AS b,dbo.Food AS f WHERE bi.idBill = b.id AND bi.idFood = f.id AND b.status = 0 AND b.idTable = " + id; DataTable data = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow item in data.Rows) { DTO.Menu menu = new DTO.Menu(item); listMenu.Add(menu); } return(listMenu); }
public List <DTO.Menu> GetListMenuByTable(int id) { List <DTO.Menu> listMenu = new List <DTO.Menu>(); string query = "SELECT f.NAME, bi.count, f.prire, f.prire*bi.count as toltalPrice FROM dbo.BILLINFO as bi, dbo.BILL as b, dbo.FOOD as f WHERE bi.idBill = b.ID and b.status = 0 and bi.idFood = f.ID and b.idTable =" + id; DataTable data = DAO.DataProvider.Instance.ExecuteQuery(query); foreach (DataRow item in data.Rows) { DTO.Menu menu = new DTO.Menu(item); listMenu.Add(menu); } return(listMenu); }