// // GET: /CuentaGastosDetalle/Create/1 public ActionResult Create(int id) { if (id > 0) { CuentaGastos cg = new CuentaGastos() { IdCuentaGastos = id }; CuentaGastosDetalle cgd = new CuentaGastosDetalle(); ViewBag.Model = cg.verCuentaGastos(); ConceptosServiceModel cs = new ConceptosServiceModel(); List <ConceptosServiceModel> lis = new List <ConceptosServiceModel>(); // lis.Add(new ConceptosServiceModel { IdConcepto = 0, Nombre = "Selecciona una opcion" }); foreach (ConceptosServiceModel concepto in cs.GetListCuentaGastos()) { lis.Add(new ConceptosServiceModel { IdConcepto = concepto.IdConcepto, Nombre = concepto.Nombre }); } SelectList lista = new SelectList(lis, "IdConcepto", "Nombre", 0); ViewBag.Lista = lista; return(View()); } else { return(RedirectToAction("Index", new { id = id })); } }
// // GET: /CuentaGasto/Delete/5 public ActionResult Delete(int id) { CuentaGastos cg = new CuentaGastos() { IdCuentaGastos = id }; return(View(cg.verCuentaGastos())); }
// // GET: /CuentaGasto/Edit/5 public ActionResult Edit(int id) { CuentaGastos cg = new CuentaGastos() { IdCuentaGastos = id }; UserServiceModel us = new UserServiceModel(); var lis = us.getUsersList(); SelectList lista = new SelectList(lis, "CodigoAcreditacion", "Nombre", 0); ViewBag.Lista = lista; return(View(cg.verCuentaGastos())); }
// // GET: /CuentaGasto/Details/5 public ActionResult Details(int id) { if (id > 0) { CuentaGastos cg = new CuentaGastos(); CuentaGastosDetalle cgd = new CuentaGastosDetalle(); cg.IdCuentaGastos = id; ViewBag.Model = cg.verCuentaGastos(); return(View()); } else { return(RedirectToAction("Index")); } }