Beispiel #1
0
        public void AddKM(string s, DateTime t1, DateTime t2)
        {
            PBL3 db = new PBL3();
            //KhuyenMai kl = GetKMLast();
            KhuyenMai k = new KhuyenMai();

            //k.MaKM = kl.MaKM + 1;
            k.TenKM     = s;
            k.TGBatDau  = t1.Date;
            k.TGKetThuc = t2.Date;
            db.KhuyenMai.Add(k);
            db.SaveChanges();
        }
Beispiel #2
0
        public void EditSach(Sach s)
        {
            PBL3 db    = new PBL3();
            Sach sedit = db.Sach.Find(s.MaSach);

            sedit.TenSach    = s.TenSach;
            sedit.MaMH       = s.MaMH;
            sedit.MaNSX      = s.MaNSX;
            sedit.DonGia     = s.DonGia;
            sedit.GiaNhap    = s.GiaNhap;
            sedit.DVT        = s.DVT;
            sedit.SoLuongTon = s.SoLuongTon;
            sedit.MoTa       = s.MoTa;
            db.SaveChanges();
        }