Exemple #1
0
        /*Get bill by status =2 and status =0 */
        public List <Bill> GetBillbyStatus()/*Lấy hóa đơn theo trạng thái */
        {
            List <Bill> bill      = billDAL.GetBillbyStatus();
            string      desStatus = null;
            var         tab       = new ConsoleTable("Mã thẻ", "Ngày tạo", "Ngày thanh toán", "Trạng thái");

            if (bill != null)
            {
                foreach (Bill item in bill)
                {
                    if (item.Status_Bill == 2)
                    {
                        desStatus = item.Status_Bill.ToString("Chờ thanh toán");
                    }
                    if (item.Status_Bill == 0)
                    {
                        desStatus = item.Status_Bill.ToString("Chưa thanh toán");
                    }



                    tab.AddRow(item.Id_Table, item.CheckIn, item.CheckOut, desStatus);
                }


                tab.Write();

                return(bill);
            }
            else
            {
                Console.WriteLine("Không có hóa đơn cần thanh toán !");
                return(null);
            }
        }