Ejemplo n.º 1
0
 public void Delete(int registerId)
 {
     using (DocumentManagementDB db = new DocumentManagementDB())
     {
         NotaryCompany newNotary = new NotaryCompany()
         {
             Id = registerId, Deleted = true
         };
         db.NotaryCompanies.Attach(newNotary);
         db.Entry(newNotary).Property(x => x.Deleted).IsModified = true;
         db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public RegisterdNotaryCompany Update(UpdateNotaryCompany registroParaActualizar)
 {
     using (DocumentManagementDB db = new DocumentManagementDB())
     {
         NotaryCompany notaryToUpdate = Mapper.Map <NotaryCompany>(registroParaActualizar);
         db.NotaryCompanies.Attach(notaryToUpdate);
         db.Entry(notaryToUpdate).Property(x => x.Email).IsModified      = true;
         db.Entry(notaryToUpdate).Property(x => x.Address).IsModified    = true;
         db.Entry(notaryToUpdate).Property(x => x.Phone).IsModified      = true;
         db.Entry(notaryToUpdate).Property(x => x.Department).IsModified = true;
         db.Entry(notaryToUpdate).Property(x => x.District).IsModified   = true;
         db.Entry(notaryToUpdate).Property(x => x.Province).IsModified   = true;
         db.SaveChanges();
         return(Mapper.Map <RegisterdNotaryCompany>(notaryToUpdate));
     }
 }