public void SuaDonvi(Donvi dv) { Donvi l = ql.Donvis.SingleOrDefault(t => t.Stt == dv.Stt); l.Madonvi = dv.Madonvi; l.Ten = dv.Ten; l.SttLoai = dv.SttLoai; l.Diachi = dv.Diachi; l.Dienthoai = dv.Dienthoai; l.Namthanhlap = dv.Namthanhlap; l.Chucnang = dv.Chucnang; ql.Entry(l).State = System.Data.Entity.EntityState.Modified; ql.SaveChanges(); }
public void ThemDonvi(Donvi dv) { ql.Donvis.Add(dv); ql.SaveChanges(); }