//// POST: Compra/Edit/5 //[HttpPost] //public ActionResult Edit(int id, FormCollection collection) //{ // try // { // // TODO: Add update logic here // return RedirectToAction("Index"); // } // catch // { // return View(); // } //} // GET: Cotizacion/Delete/5 public ActionResult Deshabilitar(int id) { if (Session["ROLES"].Equals("Admin")) { string message = "¿Desea deshabilitar este elemento?"; string title = "Deshabilitar elemento."; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result = MessageBox.Show(message, title, buttons); if (result == DialogResult.Yes) { clsCompra ObjCompra = new clsCompra(); ObjCompra.DeshabilitarCompra(id); return(RedirectToAction("Index")); } else { return(RedirectToAction("Index")); } } else { TempData["alertaMensaje"] = "El usuario con el que ha ingresado no tiene permiso para realizar esta operación."; return(RedirectToAction("Index")); } }
// GET: Cotizacion/Delete/5 public ActionResult Deshabilitar(int id) { if (Session["ROLES"].Equals("Admin")) { clsCompra ObjCompra = new clsCompra(); ObjCompra.DeshabilitarCompra(id); return(RedirectToAction("Index")); } TempData["alertaMensaje"] = "El usuario con el que ha ingresado no tiene permiso para realizar esta operación."; return(RedirectToAction("Index")); }