public JsonResult JsInsert(CondPagamento condPagamento) { var condPag = new CondPagamentoDAO(); condPag.InsertCondPagamento(condPagamento); var result = new { type = "success", field = "", message = "Registro adicionado com sucesso!", model = condPagamento }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult Create(CondPagamentoVM condPagamento) { if (!ModelState.IsValid) { try { var bean = condPagamento.GetPagamento(new CondPagamento()); var dao = new CondPagamentoDAO(); bean.dtCadastro = DateTime.Now; dao.InsertCondPagamento(bean); this.AddFlashMessage("Registro Salvo com sucesso!"); return(RedirectToAction("index")); } catch { return(View(condPagamento)); } } return(View(condPagamento)); }