public ActionResult Delete(Pedido_c element) { try { _gPedidoC.Delete(element); _gPedidoC.Save(); } catch (Exception ex) { throw new Exception("Error al intentar eliminar el contacto." + ex); } return(RedirectToAction("Index")); }
public ActionResult Create(Pedido_c element) { try { if (!ModelState.IsValid) { var model = Mapper.Map <Pedido_c, mPedidoCCreate>(element); model.FormasPago = new SelectList(_gPaymentType.GetAll().ToList(), "IdPago", "Nombre"); model.ClientList = new SelectList(_gClient.GetAll().ToList(), "IdCliente", "Razon_Social"); model.Estados = new SelectList(_gOrderStatus.GetAll().ToList(), "idEstados", "Nombre"); return(View(model)); } _gPedidoC.Add(element); _gPedidoC.Save(); } catch (Exception ex) { throw new Exception("Error al intentar modificar el contacto. " + ex); } return(RedirectToAction("Index")); }