public ActionResult DeleteConfirmed(int id) { Detalle_venta detalle_venta = db.Detalle_venta.Find(id); db.Detalle_venta.Remove(detalle_venta); db.SaveChanges(); return(RedirectToAction("Index")); }
public void DetalleVentaGetUW() { Detalle_venta result = null; using (var unitofwork = new ElDoradoUnitOfWork()) { result = unitofwork.DetalleVentaRepository.GetById <int>(1); } Assert.IsNotNull(result); }
public ActionResult Edit([Bind(Include = "idVenta,nombreProducto,cantidad,precio,descripcion,idUser")] Detalle_venta detalle_venta) { if (ModelState.IsValid) { db.Entry(detalle_venta).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(detalle_venta)); }
public ActionResult Create([Bind(Include = "idVenta,nombreProducto,cantidad,precio,descripcion,idUser")] Detalle_venta detalle_venta) { if (ModelState.IsValid) { db.Detalle_venta.Add(detalle_venta); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(detalle_venta)); }
public void DetalleVentaDeleteUW() { int result = 0; using (var unitofwork = new ElDoradoUnitOfWork()) { var entity = new Detalle_venta(); entity.Ite_det_ven = 5; unitofwork.DetalleVentaRepository.Remove(entity); result = unitofwork.Complete(); } Assert.IsTrue(result > 0); }
// GET: Detalle_venta/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Detalle_venta detalle_venta = db.Detalle_venta.Find(id); if (detalle_venta == null) { return(HttpNotFound()); } return(View(detalle_venta)); }
public void DetalleVentaInsertUW() { int result = 0; using (var unitofwork = new ElDoradoUnitOfWork()) { var entity = new Detalle_venta(); entity.Cod_ven = 2; entity.Cod_hab = 2; entity.Cant_dia_det_ven = 3; entity.Hor_ing_det_ven = "11:30"; entity.Hor_sal_det_ven = "20"; unitofwork.DetalleVentaRepository.Add(entity); result = unitofwork.Complete(); } Assert.IsTrue(result > 0); }
public bool SaveDetalleVenta(Detalle_venta entity) { IDetalleVentaDomain domain = new DetalleVentaDomain(); return(domain.SaveDetalleVenta(entity)); }