Beispiel #1
0
        public void xoa_maybay(string id)
        {
            MAYBAY x = layOnemaybay(id);

            db.MAYBAYs.Remove(x);
            db.SaveChanges();
        }
Beispiel #2
0
        public void them_maybay(MAYBAY mb)
        {
            string idmaybay = Content.RandomString(8);

            mb.idMayBay = idmaybay;
            string[] idhang = mb.idHang.Split(' ');
            mb.idHang = idhang[0];
            db.MAYBAYs.Add(mb);
            db.SaveChanges();
        }
Beispiel #3
0
        public void sua_maybay(MAYBAY mb)
        {
            string[] idhang = mb.idHang.Split(' ');

            MAYBAY x = layOnemaybay(mb.idMayBay);

            x.TenMayBay    = mb.TenMayBay;
            x.idHang       = idhang[0];
            x.SoLuongKhach = mb.SoLuongKhach;
            db.SaveChanges();
        }