Exemplo n.º 1
0
        public DataTable List(string search)
        {
            var dt = model.List(search);

            if (dt == null)
            {
                view.Message = "Resource not found!. null";
                return(null);
            }

            var tb = new DataTable();

            tb.Columns.Add("ID");
            tb.Columns.Add("ID_phong");
            tb.Columns.Add("TenPhong");
            tb.Columns.Add("NgayGioLap");
            tb.Columns.Add("TenKH");
            tb.Columns.Add("TongTien");
            foreach (var item in dt)
            {
                var phong = modelphong.GetOne(item.ID_Phong);
                if (phong != null)
                {
                    tb.Rows.Add(item.ID,
                                item.ID_Phong,
                                phong.Ten,
                                item.NgayGioLap,
                                item.TenKH,
                                item.TongTien);
                }
            }
            return(tb);
        }
Exemplo n.º 2
0
 public PHONG GetOne(int ID)
 {
     return(model.GetOne(ID));
 }