Пример #1
0
 private ActionResult GetView(string modelo, string serie, int numero, int codFornecedor)
 {
     try
     {
         var daoCompra = new DAOCompras();
         var model     = daoCompra.GetCompra(null, modelo, serie, numero, codFornecedor);
         return(View(model));
     }
     catch (Exception ex)
     {
         this.AddFlashMessage(ex.Message, FlashMessage.ERROR);
         return(View());
     }
 }
Пример #2
0
 public ActionResult CancelarCompra(string modelo, string serie, int numero, int codFornecedor, Models.Compras model)
 {
     try
     {
         daoCompra = new DAOCompras();
         daoCompra.CancelarCompra(modelo, serie, numero, codFornecedor);
         this.AddFlashMessage("Registro cancelado com sucesso!");
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         this.AddFlashMessage(ex.Message, FlashMessage.ERROR);
         model = daoCompra.GetCompra(null, modelo, serie, numero, codFornecedor);
         return(View(model));
     }
 }