public IHttpActionResult PutGastosContaduria(int id, GastosContaduria gastosContaduria) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != gastosContaduria.Id) { return(BadRequest()); } db.Entry(gastosContaduria).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!GastosContaduriaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { GastosContaduria gastosContaduria = db.GastosContaduria.Find(id); db.GastosContaduria.Remove(gastosContaduria); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { GastosContaduria gastosContaduria = db.GastosContaduria.Find(id); int?idc = gastosContaduria.Id_Corretaje; db.GastosContaduria.Remove(gastosContaduria); db.SaveChanges(); return(Redirect("/GastosContadurias/Index/" + idc)); }
public ActionResult Edit([Bind(Include = "Id,GstCon_Mensualidad,GstCon_Vigilancia,GstCon_Otros,Id_Corretaje")] GastosContaduria gastosContaduria) { if (ModelState.IsValid) { db.Entry(gastosContaduria).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_Corretaje = new SelectList(db.Corretaje, "Id", "Crt_Status", gastosContaduria.Id_Corretaje); return(View(gastosContaduria)); }
public IHttpActionResult GetGastosContaduria(int id) { GastosContaduria gastosContaduria = db.GastosContaduria.Find(id); if (gastosContaduria == null) { return(NotFound()); } return(Ok(gastosContaduria)); }
public ActionResult Edit([Bind(Include = "Id,GstCon_Concepto,GstCon_Monto,GstCon_Descripcion,GstCon_Fecha,Id_Corretaje,Id_Usuario")] GastosContaduria gastosContaduria) { if (ModelState.IsValid) { db.Entry(gastosContaduria).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } //ViewBag.Id_Corretaje = new SelectList(db.Corretaje, "Id", "Crt_Status", gastosContaduria.Id_Corretaje); <--------------------------------------------Abiel Aqui Mero return(View(gastosContaduria)); }
public IHttpActionResult PostGastosContaduria(GastosContaduria gastosContaduria) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.GastosContaduria.Add(gastosContaduria); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = gastosContaduria.Id }, gastosContaduria)); }
public ActionResult Create([Bind(Include = "Id,GstCon_Concepto,GstCon_Monto,GstCon_Descripcion,GstCon_Fecha,Id_Corretaje,Id_Usuario")] GastosContaduria gastosContaduria) { if (ModelState.IsValid) { db.GastosContaduria.Add(gastosContaduria); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_Corretaje = new SelectList(db.Corretaje, "Id", "Crt_Status", gastosContaduria.Id_Corretaje); ViewBag.Id_Usuario = new SelectList(db.Usuario, "Id", "usu_username", gastosContaduria.Id_Usuario); return(View(gastosContaduria)); }
// GET: GastosContadurias/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GastosContaduria gastosContaduria = db.GastosContaduria.Find(id); if (gastosContaduria == null) { return(HttpNotFound()); } return(View(gastosContaduria)); }
public IHttpActionResult DeleteGastosContaduria(int id) { GastosContaduria gastosContaduria = db.GastosContaduria.Find(id); if (gastosContaduria == null) { return(NotFound()); } db.GastosContaduria.Remove(gastosContaduria); db.SaveChanges(); return(Ok(gastosContaduria)); }
// GET: GastosContadurias/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GastosContaduria gastosContaduria = db.GastosContaduria.Find(id); if (gastosContaduria == null) { return(HttpNotFound()); } ViewBag.Id_Corretaje = new SelectList(db.Corretaje, "Id", "Crt_Status", gastosContaduria.Id_Corretaje); return(View(gastosContaduria)); }
public ActionResult Create([Bind(Include = "Id,GstCon_Concepto,GstCon_Monto,GstCon_Descripcion,GstCon_Fecha,Id_Corretaje,Id_Usuario")] GastosContaduria gastosContaduria) { //Selectlist conceptos de Corretaje var listaCorr = new SelectList(new[] { new { value = "No seleccionado", text = "Seleccione un concepto...." }, new { value = "CESPT", text = "CESPT" }, new { value = "CFE", text = "CFE" }, }, "value", "text", 0); //Selectlist conceptos de Gestion var listaGest = new SelectList(new[] { new { value = "No seleccionado", text = "Seleccione un concepto...." }, new { value = "CESPT", text = "CESPT" }, new { value = "CFE", text = "CFE" }, }, "value", "text", 0); //Selectlist conceptos de Contaduria var listaCont = new SelectList(new[] { new { value = "No seleccionado", text = "Seleccione un concepto...." }, new { value = "CESPT", text = "CESPT" }, new { value = "CFE", text = "CFE" }, }, "value", "text", 0); if (ModelState.IsValid) { //Guardar campos automaticps gastosContaduria.Id_Usuario = int.Parse(Session["UsuarioID"].ToString()); gastosContaduria.GstCon_Fecha = DateTime.Now; db.GastosContaduria.Add(gastosContaduria); db.SaveChanges(); return(Redirect("/GastosContadurias/Index/" + gastosContaduria.Id_Corretaje)); } ViewData["Corretaje"] = listaCorr; ViewData["Gestion"] = listaGest; ViewData["Contador"] = listaCont; //ViewBag.Id_Corretaje = new SelectList(db.Corretaje, "Id", "Crt_Status", gastosContaduria.Id_Corretaje); <--------------------------------------------Abiel Aqui Mero return(View(gastosContaduria)); }