public ActionResult GastosPessoaGrafico() { int id = Convert.ToInt32(Session["user"].ToString()); List <Object> datas = new RepositorioGastos().GraficoGastosMensais(id); return(Content(JsonConvert.SerializeObject(new { data = datas }, Formatting.Indented))); }
public async Task <ActionResult> CadastroGastosModalPessoas(Gastos gasto) { int id = Convert.ToInt32(Session["user"].ToString()); int deuCerto = new RepositorioGastos().CadastrarGastos(gasto, id); var options = new PusherOptions { Cluster = "us2", Encrypted = true }; var pusher = new Pusher( "604342", "3d2e47e4a257a668b2cc", "65922eb9b246a4faa9a5", options); var result = await pusher.TriggerAsync( "my-channel", "cadastroGastos", new { message = "hello world" }); return(Content(JsonConvert.SerializeObject(new { gasto }))); }
public ActionResult TabelaGastos() { //fazer um vetor para pesquisa por coluna string[] colunasNomes = new string[3]; colunasNomes[0] = "car.conta "; colunasNomes[1] = "cat.nome "; colunasNomes[2] = "gas.valor "; string start = Request.QueryString["start"]; string length = Request.QueryString["length"]; string draw = Request.QueryString["draw"]; string search = '%' + Request.QueryString["search[value]"] + '%'; string orderColumn = Request.QueryString["order[0][column]"]; string orderDir = Request.QueryString["order[0][dir]"]; orderColumn = colunasNomes[Convert.ToInt32(orderColumn)]; int id = Convert.ToInt32(Session["user"].ToString()); RepositorioGastos repositorio = new RepositorioGastos(); List <Gastos> gastos = repositorio.ObterTodosParaJson(start, length, search, orderColumn, orderDir, id); int countGastos = repositorio.ContabilizarGastos(); int countFilter = repositorio.ContabilizarGastosFiltrados(search); return(Content(JsonConvert.SerializeObject(new { data = gastos, draw = draw, recordsTotal = countGastos, recordsFiltered = countFilter }))); }
public ActionResult PreencherFullCalendar() { int id = Convert.ToInt32(Session["user"].ToString()); List <Object> gastos = new RepositorioGastos().FullCalendarGastos(id); return(Content(JsonConvert.SerializeObject(new { events = gastos }, Formatting.Indented))); }
public ActionResult CadastroModalGastos(Gastos gastos) { int id = Convert.ToInt32(Session["user"].ToString()); int ids = new RepositorioGastos().CadastrarGastos(gastos, id); return(Content(JsonConvert.SerializeObject(new { id = ids }))); }
public ActionResult Index() { List <Gastos> gastos = new RepositorioGastos().ObterTodosGastos(); ViewBag.Gastos = gastos; ViewBag.TituloPagina = "Gastos"; return(View()); }
public async Task <ActionResult> ExcluirGastos(int id) { bool apagado = new RepositorioGastos().ExcluirGastos(id); var options = new PusherOptions { Cluster = "us2", Encrypted = true }; var pusher = new Pusher( "604342", "3d2e47e4a257a668b2cc", "65922eb9b246a4faa9a5", options); var result = await pusher.TriggerAsync( "my-channel", "ExcluiGastos", new { message = "hello world" }); return(Content(JsonConvert.SerializeObject(new { apagado }))); }
public ActionResult UpdateGastos(Gastos gastos) { bool alterado = new RepositorioGastos().AlterarGastos(gastos); return(Content(JsonConvert.SerializeObject(new { alterado }))); }
public ActionResult EditarGastos(int id) { Gastos gastos = new RepositorioGastos().ObterPeloIdGastos(id); return(Content(JsonConvert.SerializeObject(new { gastos }))); }
public ActionResult ObterTodosJson() { List <Gastos> gastos = new RepositorioGastos().ObterTodosGastos(); return(Content(JsonConvert.SerializeObject(new { data = gastos }))); }
public ActionResult Update(Gastos gastos) { bool alterado = new RepositorioGastos().AlterarGastos(gastos); return(null); }
public ActionResult ExcluirGastos(int id) { bool apagado = new RepositorioGastos().ExcluirGastos(id); return(View()); }