コード例 #1
0
        public JsonResult MantemHoraProjetoAtalho(int id, int projetoId, int subFaseProjetoId, string obs, string atalho)
        {
            try
            {
                int usuarioId = Convert.ToInt32(Session["IDUSUARIO"]);

                var AtalhoExistente = this.dataInterface.BuscaHorasProjetoAtalho().FirstOrDefault(x => x.hpoa_usrId != null && x.hpoa_usrId == usuarioId && x.hpoa_Atalho.TrimEnd() == atalho);

                if (AtalhoExistente != null)
                {
                    id = AtalhoExistente.hpoa_Id;
                }

                var retorno = "";

                var obj = new Indigo_HorasProjetoAtalho
                {
                    hpoa_Id         = id,
                    hpoa_prjId      = projetoId,
                    hpoa_sfpId      = subFaseProjetoId,
                    hpoa_usrId      = usuarioId,
                    hpoa_Observacao = obs,
                    hpoa_Atalho     = atalho
                };

                retorno = this.dataInterface.SalvaAtalho(obj);

                return(base.Json(new { Result = retorno }, 0));
            }
            catch (Exception ex)
            {
                log(ex.Message + " -- " + ex.StackTrace);
                return(base.Json(new { Result = ex.Message + " -- " + ex.StackTrace }, 0));
            }
        }
コード例 #2
0
        public string SalvaAtalho(Indigo_HorasProjetoAtalho horasProjeto)
        {
            try
            {
                var context = new Indigo_Controle_Licenca();
                context.Indigo_HorasProjetoAtalho.AddOrUpdate(horasProjeto);
                context.SaveChanges();

                return("Atalho registrado com sucesso");
            }
            catch (Exception ex)
            {
                return(String.Format(ex.Message + "\r\n" + ex.StackTrace));
            }
        }