Beispiel #1
0
        public static List <Opciones> getEstructura(string codUsuario)
        {
            List <Opciones> oListaEstructura = new List <Opciones>();
            int             respuesta = 0; string mensaje = string.Empty;
            //SEC_Perfiles oDataPerfil = null;

            RepositorioService  serviceObj = new RepositorioService();
            HttpResponseMessage response   = serviceObj.GetResponse("Menu/OpcionesPerfil");

            response.EnsureSuccessStatusCode();
            //oListaEstructura = response.Content.ReadAsAsync<List<Opciones>>().Result;
            var resultado = response.Content.ReadAsAsync <List <Opciones> >().Result;

            //oListaEstructura = new GestionOpcionesNegocio().ListarOpcionesSistemaPerfil(codUsuario, out oDataPerfil, out respuesta, out mensaje);
            if (resultado.Count() > 0)
            {
                //PageBase.setCodigoPuesto(oListaEstructura[0].PAUSRCodigoPuesto);
                //PageBase.setCodigoCDR(oListaEstructura[0].PACDRUsuario);
                //PageBase.setCodigoEmpresa(oListaEstructura[0].PAEmpresa);

                /*
                 * if (oDataPerfil != null)
                 * {
                 *  PageBase.setClavesPerfiles(oDataPerfil.PAClave);
                 *  if (oDataPerfil.PAFlagEditar == true) { PageBase.setEditar(true); }
                 *  if (oDataPerfil.PAFlagEliminar == true) { PageBase.setEliminar(true); }
                 *  if (oDataPerfil.PAFlagExportar == true) { PageBase.setExportar(true); }
                 *  if (oDataPerfil.PAFlagGrabar == true) { PageBase.setGrabar(true); }
                 *  if (oDataPerfil.PAFlagReasignar == true) { PageBase.setReasignar(true); }
                 * }*/
            }
            return(resultado);
        }
 public HttpResponseMessage Get(string cpfStore, string service, string status)
 {
     try
     {
         if (ModelState.IsValid)
         {
             RepositorioService repService = new RepositorioService();
             return(Request.CreateResponse(HttpStatusCode.OK, repService.Get(cpfStore, service, status), new HttpConfiguration()));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.NotAcceptable, "Falta de informações na requisição.", new HttpConfiguration()));
         }
     }
     catch (HttpRequestException ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }
 public HttpResponseMessage Put([FromBody] Service service)
 {
     try
     {
         if (ModelState.IsValid)
         {
             RepositorioService repService = new RepositorioService();
             return(Request.CreateResponse(HttpStatusCode.OK, repService.Update(service), new HttpConfiguration()));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.NotAcceptable, "Falta de informações na requisição.", new HttpConfiguration()));
         }
     }
     catch (HttpRequestException ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex));
     }
 }
Beispiel #4
0
        private List <EngineeringItems> capturarItensEngenhariaPlant3d()
        {
            List <EngineeringItems> listaResult;

            var repoSQLiteService = new RepositorioService <EngineeringItems>();
            var dominioService    = new DominioService <EngineeringItems>(repoSQLiteService);


            //using (var dominioService = DIContainer.Instance.AppContainer.Resolve<DominioService<EngineeringItems>>(_conexao))
            ///{
            dominioService.Start(Storage.ConnectionString);

            listaResult = (List <EngineeringItems>)dominioService.GetAll();

            dominioService.Dispose();
            //}

            return(listaResult);
        }