Example #1
0
 public bool IsInsuranceTypeSaved(Model.InsuranceType entity)
 {
     using (var db = new SCMSEntities())
     {
         SessionData.CurrentSession.InsuranceTypeList = null;
         db.InsuranceTypes.Add(entity);
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Example #2
0
 public bool IsInsuranceTypeEdited(Model.InsuranceType entity)
 {
     using (var db = new SCMSEntities())
     {
         SessionData.CurrentSession.InsuranceTypeList = null;
         db.InsuranceTypes.Attach(entity);
         ((IObjectContextAdapter)db).ObjectContext.ObjectStateManager.ChangeObjectState(entity, System.Data.EntityState.Modified);
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Example #3
0
 public bool IsInsuranceTypeDeleted(Guid makeId)
 {
     using (var db = new SCMSEntities())
     {
         SessionData.CurrentSession.InsuranceTypeList = null;
         var insuretype = new Model.InsuranceType {
             Id = makeId
         };
         db.InsuranceTypes.Attach(insuretype);
         ((IObjectContextAdapter)db).ObjectContext.ObjectStateManager.ChangeObjectState(insuretype, System.Data.EntityState.Deleted);
         return(db.SaveChanges() > 0 ? true : false);
     }
 }