public bool IsDutyTypeSaved(Model.DutyType entity) { using (var db = new SCMSEntities()) { SessionData.CurrentSession.DutyTypeList = null; db.DutyTypes.Add(entity); return(db.SaveChanges() > 0 ? true : false); } }
public bool IsDutyTypeEdited(Model.DutyType entity) { using (var db = new SCMSEntities()) { SessionData.CurrentSession.DutyTypeList = null; db.DutyTypes.Attach(entity); ((IObjectContextAdapter)db).ObjectContext.ObjectStateManager.ChangeObjectState(entity, System.Data.EntityState.Modified); return(db.SaveChanges() > 0 ? true : false); } }