public ActionResult Edit(LoteIngresoViewModels datos) { DBLote dblote = new DBLote(); Lote lote = new Lote(dblote); lote.Update(datos); return(RedirectToAction("Index", "Lote")); }
public ActionResult Create(LoteIngresoViewModels datos) { ViewBag.Title = "Ingresar Lote"; DBLote dbLote = new DBLote(); Lote lote = new Lote(dbLote); lote.Save(datos); return(RedirectToAction("Index", "Lote")); }
public ActionResult CuotasVenta(VentaViewModels datos) { var venta = new VentaViewModels(); Lote lt = new Lote(new DBLote()); venta.Lote = lt.SelectForId(datos.LoteId); lote = venta.Lote; venta.Cliente = cliente; venta.Empleado = empleado; return(View(venta)); }
public ActionResult Create() { ViewBag.Title = "Ingresar Lote"; DBLotificadora dblotificadora = new DBLotificadora(); Lotificadora lotifi = new Lotificadora(dblotificadora); DBManzana dbmanzana = new DBManzana(); Manzana manzana = new Manzana(dbmanzana); DBEstadoLote dbestado = new DBEstadoLote(); EstadoLote estado = new EstadoLote(dbestado); LoteIngresoViewModels lote = new LoteIngresoViewModels(); lote.lotificadoras = lotifi.SelectAll(); lote.manzanas = manzana.SelectAll(); lote.estados = estado.SelectAll(); return(View(lote)); }
public ActionResult Edit(int id) { DBLote dblote = new DBLote(); Lote lote = new Lote(dblote); DBLotificadora dblotificadora = new DBLotificadora(); Lotificadora lotifi = new Lotificadora(dblotificadora); DBManzana dbmanzana = new DBManzana(); Manzana manzana = new Manzana(dbmanzana); DBEstadoLote dbestado = new DBEstadoLote(); EstadoLote estado = new EstadoLote(dbestado); LoteIngresoViewModels lote2 = new LoteIngresoViewModels(); lote2 = lote.SelectForId(id); lote2.lotificadoras = lotifi.SelectAll(); lote2.manzanas = manzana.SelectAll(); lote2.estados = estado.SelectAll(); return(View(lote2)); }
public object FindForId(int id) { var lotify = new LoteIngresoViewModels(); string query = "SELECT id, no_lote, largo, ancho, mts_cuadrados, precio_lote, manzana_id, lotificadora_id, estado_id FROM lote WHERE id = @id"; using (var connection = PostConnection.Connection()) { using (var command = db.Command(query)) { try { connection.Open(); command.Connection = connection; command.Parameters.AddWithValue("@id", id); using (var reader = command.ExecuteReader()) { while (reader.Read()) { lotify.id = Convert.ToInt32(reader["id"]); lotify.numero = Convert.ToInt32(reader["no_lote"]); lotify.largo = Convert.ToDouble(reader["largo"]); lotify.ancho = Convert.ToDouble(reader["ancho"]); lotify.mts_cuadrados = Convert.ToDouble(reader["mts_cuadrados"]); lotify.precio_lote = Convert.ToDouble(reader["precio_lote"]); lotify.manzana_id = Convert.ToInt32(reader["manzana_id"]); lotify.lotificadora_id = Convert.ToInt32(reader["lotificadora_id"]); lotify.estado_id = Convert.ToInt32(reader["estado_id"]); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } } } return(lotify); }
public int Update(LoteIngresoViewModels datos) { return(persistence.Update(datos)); }
public int Save(LoteIngresoViewModels datos) { return(persistence.Save(datos)); }