コード例 #1
0
        public string Delete(int id)
        {
            var desenvolvedor = desenvolvedorBusiness.GetAllById(id);

            if (desenvolvedor != null)
            {
                desenvolvedorBusiness.Delete(desenvolvedor);
                var lsLancamento = lancamentoBusiness.GetAll().Where(x => x.IdDesenvolvedor == desenvolvedor.Id);
                foreach (var item in lsLancamento)
                {
                    lancamentoBusiness.Delete(item);
                }

                return("Sucesso");
            }
            return("Falha");
        }
コード例 #2
0
        public string Get()
        {
            var Lancamento = lancamentoBusiness.GetAll();
            var model      = new List <LancamentoModel>();

            foreach (var l in Lancamento)
            {
                var newL = new LancamentoModel();
                newL.Id              = l.Id;
                newL.DataFim         = l.DataFim;
                newL.DataInicio      = l.DataInicio;
                newL.IdDesenvolvedor = l.IdDesenvolvedor;

                model.Add(newL);
            }

            var json = JsonSerializer.Serialize(model);

            return(json);
        }
コード例 #3
0
 // GET api/lancamento
 public HttpResponseMessage Get()
 {
     return(Request.CreateResponse(HttpStatusCode.OK, bus.GetAll()));
 }