public bool Insert(DM_DON_VI entity) { try { db.DM_DON_VI.Add(entity); db.SaveChanges(); return(true); } catch (Exception e) { return(false); } }
public bool Update(DM_DON_VI entity) { try { var dv = db.DM_DON_VI.Find(entity.DV_ID); dv.DV_MA = entity.DV_MA; dv.DV_TEN = entity.DV_TEN; dv.DV_GHI_CHU = entity.DV_GHI_CHU; db.SaveChanges(); return(true); } catch (Exception e) { return(false); } }