Exemple #1
0
 public void Add()
 {
     using (var db = new WXDBContext())
     {
         db.RefundmentInfo.Add(this);
         db.SaveChanges();
     }
 }
Exemple #2
0
 public void Add()
 {
     using (var db = new WXDBContext())
     {
         db.PayNotifyInfo.Add(this);
         db.SaveChanges();
     }
 }
Exemple #3
0
 public void Modify()
 {
     using (var db = new WXDBContext())
     {
         db.PayNotifyInfo.Attach(this);
         db.Entry(this).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemple #4
0
 public void SaveChange()
 {
     try
     {
         _context.SaveChanges();
     }
     catch (DbEntityValidationException dbEx)
     {
         foreach (var validationErrors in dbEx.EntityValidationErrors)
         {
             foreach (var validationError in validationErrors.ValidationErrors)
             {
                 Trace.TraceInformation("Property: {0} Error: {1}",
                                        validationError.PropertyName,
                                        validationError.ErrorMessage);
             }
         }
     }
 }