public List <BillDetailDTO> LoadBillList()
        {
            List <BillDetailDTO> BillList = new List <BillDetailDTO>();
            DataTable            data     = BillDAL.Instance.GetListBill();

            foreach (DataRow item in data.Rows)
            {
                BillDetailDTO ib = new BillDetailDTO(item);
                BillList.Add(ib);
            }
            return(BillList);
        }
        public List <BillDetailDTO> GetListBillDetail(int id_Bill)
        {
            List <BillDetailDTO> listBillInfo = new List <BillDetailDTO>();

            DataTable data = BillDetailDAL.Instance.GetListBillDetail(id_Bill);

            foreach (DataRow item in data.Rows)
            {
                BillDetailDTO info = new BillDetailDTO(item);
                listBillInfo.Add(info);
            }
            return(listBillInfo);
        }
        public static List <BillDetailDTO> GetViewBillDetail(string Sector_Name, string Room_ID, string Month, string Year)
        {
            string               query       = string.Format("SELECT * FROM dbo.UFN_ReturnForViewBillDetail(N'{0}', '{1}', {2}, {3})", Sector_Name, Room_ID, Month, Year);
            DataTable            dataTable   = DataProvider.ExcuteQuery(query);
            List <BillDetailDTO> ListService = new List <BillDetailDTO>();

            foreach (DataRow item in dataTable.Rows)
            {
                BillDetailDTO temp = new BillDetailDTO(item);
                ListService.Add(temp);
            }
            return(ListService);
        }
Beispiel #4
0
        public BillDetail AddBillDetail(BillDetailDTO billDetail)
        {
            var menuItem = _unitOfWork.MenuItems.Get(billDetail.MenuItemId);

            if (menuItem == null)
            {
                throw new Exception(
                          string.Format("Could not find menu item with id: ${0}", billDetail.MenuItemId)
                          );
            }

            return(new BillDetail()
            {
                Id = billDetail.Id,
                ItemName = menuItem.Name,
                Price = menuItem.Price,
                Quantity = billDetail.Quantity
            });
        }