public List <IdentityError> ModeloEditarEstante(int Ancho, int Largo, string Ubicacion, int Evento, int Planta, int id) { List <IdentityError> ListaEditar = new List <IdentityError>(); IdentityError regresa = new IdentityError(); var estante = new Estantes { Ancho = Ancho, Largo = Largo, Ubicacion = Ubicacion, EventoId = Evento, PlantaId = Planta, EstantesId = id }; try { _contexo.Estantes.Update(estante); _contexo.SaveChanges(); regresa = new IdentityError { Code = "save", Description = "save" }; } catch (Exception ex) { regresa = new IdentityError { Code = ex.Message, Description = ex.Message }; } ListaEditar.Add(regresa); return(ListaEditar); }
public List <IdentityError> ClaseGurdarEstantes(int Ancho, int Largo, string Ubicacion, int Evento, int Planta) { List <IdentityError> lista = new List <IdentityError>(); IdentityError dato = new IdentityError(); var objetoestante = new Estantes { Ancho = Ancho, Largo = Largo, Ubicacion = Ubicacion, EventoId = Evento, PlantaId = Planta }; try { _contexo.Estantes.Add(objetoestante); _contexo.SaveChanges(); dato = new IdentityError { Code = "save", Description = "save" }; } catch (Exception ex) { dato = new IdentityError { Code = ex.Message, Description = ex.Message }; } lista.Add(dato); return(lista); }