コード例 #1
0
 public bool Delete(Ariochoob1.Models.DomainModels.SaleFactor entity, bool autoSave = true)
 {
     try
     {
         db.Entry(entity).State = System.Data.EntityState.Deleted;
         if (autoSave)
         {
             return(Convert.ToBoolean(db.SaveChanges()));
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
コード例 #2
0
 public bool Add(Ariochoob1.Models.DomainModels.SaleFactor entity, bool autoSave = true)
 {
     try
     {
         db.SaleFactors.Add(entity);
         if (autoSave)
         {
             return(Convert.ToBoolean(db.SaveChanges()));
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }