示例#1
0
        public JsonResult Post(Notum nota)
        {
            db.Nota.Add(nota);
            db.SaveChanges();

            SGCAController sgca = new SGCAController(_configuration);

            _hub.Clients.All.SendAsync("transfercaixadata", sgca.GetSignalStatus());
            return(new JsonResult("added successfully"));
        }
示例#2
0
        public JsonResult Put(Notum nota)
        {
            var existingNota = db.Nota.Where(x => x.NotaId == nota.NotaId).FirstOrDefault();

            if (existingNota != null)
            {
                existingNota.NotaQuantidade = nota.NotaQuantidade;
                existingNota.NotaValor      = nota.NotaValor;
                //existingNota.CaixaID = nota.CaixaID;
                db.SaveChanges();
            }

            SGCAController sgca = new SGCAController(_configuration);

            _hub.Clients.All.SendAsync("transfercaixadata", sgca.GetSignalStatus());

            return(new JsonResult("Updated successfully"));
        }