/**
  * Método para actualizar el registro
  */
 public static void update(decimal id, String name, decimal state, decimal?boss, decimal?enterprise_id)
 {
     using (var conn = new db_entities()) {
         try {
             var entity = conn.units.Where(x => x.id == id).FirstOrDefault();
             if (entity == null)
             {
                 throw new NotExistsException();
             }
             else
             {
                 conn.SP_UNIT_UPDATE(id, name, DateTime.Now, state, boss, enterprise_id);
             }
         } catch (Exception e) {
             throw e;
         }
     }
 }