public ActionResult Delete(int id, TipoServicio tiposervicio) { var biz = new TipoServicioProcess(); var bizprecio = new PrecioProcess(); var bizcita = new CitaProcess(); foreach (var item in bizcita.ListarTodos()) { if (item.TipoServicioId == tiposervicio.Id) { bizcita.Delete(item.Id); } } foreach (var item in bizprecio.ListarTodos()) { if (item.TipoServicioId == tiposervicio.Id) { item.Id = item.TipoServicioId; bizprecio.Delete(item); } } bool result = biz.Delete(tiposervicio.Id); if (result) { return(RedirectToAction("Index")); } else { return(View()); } }
public ActionResult Delete(int id, Precio precio, DateTime fechah, DateTime fechad) { var biz = new PrecioProcess(); precio.Id = id; precio.FechaDesde = fechad; precio.FechaHasta = fechah; bool result = biz.Delete(precio); if (result) { return(RedirectToAction("Index")); } else { return(View()); } }