private void PostItris(ItrisPlanillaEntity model)
        {
            log.Info("- Ingreso -");
            string usuarioItris = this.ObtenerUsuarioItris();

            ItrisAuthenticateEntity authenticateEntity =
                new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO, ITRIS_CLASE, usuarioItris, ITRIS_PASS, ITRIS_DATABASE);

            try
            {
                //Inserts itris
                ServiceRelevamientoBusiness serviceRelevamientoBusiness =
                    new ServiceRelevamientoBusiness(authenticateEntity);

                log.Info("Ejecuta serviceRelevamientoBusiness.Post(model): " + JsonConvert.SerializeObject(model));
                serviceRelevamientoBusiness.Post(model);
                log.Info("Respuesta serviceRelevamientoBusiness.Post(model): " + JsonConvert.SerializeObject(model));
            }
            catch (Exception ex)
            {
                log.Error("Mensaje de Error: " + ex.Message);
                if (ex.InnerException != null)
                {
                    log.Error("Inner exception: " + ex.InnerException.Message);
                }
                throw ex;
            }
            log.Info("- Salio -");
        }
 public ServiceRelevamientoBusiness(ItrisAuthenticateEntity itrisAuthenticateEntity)
 {
     _itrisRelevamientoBusiness            = new ItrisRelevamientoBusiness(itrisAuthenticateEntity);
     _itrisComercioBusiness                = new ItrisComercioBusiness(itrisAuthenticateEntity);
     _itrisRelevamientoArticuloBusiness    = new ItrisRelevamientoArticuloBusiness(itrisAuthenticateEntity);
     _itrisEstadoEmailRelevamientoBusiness = new ItrisEstadoEmailRelevamientoBusiness(itrisAuthenticateEntity);
 }
        public ServiceSyncTipComEntity SynchronizeTipComDACS(ItrisAuthenticateEntity authenticateEntity)
        {
            //Listas CUD en DB_DACS
            ServiceSyncTipComEntity serviceSyncTipComEntity = new ServiceSyncTipComEntity();

            serviceSyncTipComEntity.ListaCreate = new List <TIP_COM>();
            serviceSyncTipComEntity.ListaUpdate = new List <TIP_COM>();
            serviceSyncTipComEntity.ListaDelete = new List <TIP_COM>();

            try
            {
                List <TIP_COM> listaTipComItris = new List <TIP_COM>();

                ItrisTipoDeComercioBusiness itrisTipoDeComercioBusiness = new ItrisTipoDeComercioBusiness(authenticateEntity);
                ItrisTipoDeComercioResponse itrisTipoDeComercioResponse =
                    Task.Run(async() => await itrisTipoDeComercioBusiness.Get()).GetAwaiter().GetResult();

                List <TIP_COM> listaServiceTipCom = this.Read() as List <TIP_COM>;

                //Comparo elemento por elemento para chequear los insert y actualizaciones
                foreach (var objItris in itrisTipoDeComercioResponse.data)
                {
                    var tipCom = listaServiceTipCom.Where(a => a.ID == objItris.ID).SingleOrDefault();
                    if (tipCom != null)
                    {
                        if (!TipoComercioIguales(tipCom, objItris))
                        {
                            ActualizoTipCom(tipCom, objItris);
                            serviceSyncTipComEntity.ListaUpdate.Add(tipCom);
                        }
                    }
                    else
                    {
                        serviceSyncTipComEntity.ListaCreate.Add(CreoNuevoTipCom(objItris));
                    }
                }

                //Obtengo los elementos que tengo que eliminar en la bd DACS
                foreach (var objService in listaServiceTipCom)
                {
                    var objDelete = itrisTipoDeComercioResponse.data.Where(a => a.ID == objService.ID).SingleOrDefault();
                    if (objDelete == null)
                    {
                        serviceSyncTipComEntity.ListaDelete.Add(objService);
                    }
                }

                PersistirListas(serviceSyncTipComEntity);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(serviceSyncTipComEntity);
        }
Beispiel #4
0
        public ServiceSyncErpAsesoresEntity SynchronizeErpAsesoresDACS(ItrisAuthenticateEntity authenticateEntity, string lastUpdate)
        {
            //Listas CUD en DB_DACS
            ServiceSyncErpAsesoresEntity serviceSyncErpAsesoresEntity = new ServiceSyncErpAsesoresEntity();

            serviceSyncErpAsesoresEntity.ListaCreate = new List <ERP_ASESORES>();
            serviceSyncErpAsesoresEntity.ListaUpdate = new List <ERP_ASESORES>();
            serviceSyncErpAsesoresEntity.ListaDelete = new List <ERP_ASESORES>();

            try
            {
                List <ERP_ASESORES> listaAsesoresItris = new List <ERP_ASESORES>();

                ItrisErpAsesoresBusiness itrisErpAsesoresBusiness = new ItrisErpAsesoresBusiness(authenticateEntity);
                ItrisErpAsesoresResponse itrisErpAsesoresResponse =
                    Task.Run(async() => await itrisErpAsesoresBusiness.GetLastUpdate(lastUpdate)).GetAwaiter().GetResult();

                List <ERP_ASESORES> listaServiceAsesores = this.Read() as List <ERP_ASESORES>;

                //Comparo elemento por elemento para chequear los insert y actualizaciones
                foreach (var objItris in itrisErpAsesoresResponse.data)
                {
                    var asesor = listaServiceAsesores.Where(a => a.ID == objItris.ID).SingleOrDefault();
                    if (asesor != null)
                    {
                        if (!AsesoresIguales(asesor, objItris))
                        {
                            ActualizoAsesor(asesor, objItris);
                            serviceSyncErpAsesoresEntity.ListaUpdate.Add(asesor);
                        }
                    }
                    else
                    {
                        serviceSyncErpAsesoresEntity.ListaCreate.Add(CreoNuevoAsesor(objItris));
                    }
                }

                //No elimino mas porque solo cuento con los ultimos por fecha de actualización
                //Obtengo los elementos que tengo que eliminar en la bd DACS
                //foreach (var objService in listaServiceAsesores)
                //{
                //	var objDelete = itrisErpAsesoresResponse.data.Where(a => a.ID == objService.ID).SingleOrDefault();
                //	if (objDelete == null)
                //		serviceSyncErpAsesoresEntity.ListaDelete.Add(objService);
                //}

                PersistirListas(serviceSyncErpAsesoresEntity);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(serviceSyncErpAsesoresEntity);
        }
        public ServiceSyncErpEmpresasEntity SynchronizeErpEmpresasDACS(ItrisAuthenticateEntity authenticateEntity, string lastUpdate)
        {
            //Listas CUD en DB_DACS
            ServiceSyncErpEmpresasEntity serviceSyncErpEmpresasEntity = new ServiceSyncErpEmpresasEntity();

            serviceSyncErpEmpresasEntity.ListaCreate = new List <ERP_EMPRESAS>();
            serviceSyncErpEmpresasEntity.ListaUpdate = new List <ERP_EMPRESAS>();
            serviceSyncErpEmpresasEntity.ListaDelete = new List <ERP_EMPRESAS>();

            try
            {
                List <ERP_EMPRESAS> listaEmpresasItris = new List <ERP_EMPRESAS>();

                ItrisErpEmpresasBusiness itrisErpEmpresasBusiness = new ItrisErpEmpresasBusiness(authenticateEntity);
                ItrisErpEmpresasResponse itrisErpEmpresasResponse =
                    Task.Run(async() => await itrisErpEmpresasBusiness.GetLastUpdate(lastUpdate)).GetAwaiter().GetResult();

                List <ERP_EMPRESAS> listaServiceEmpresas = this.Read() as List <ERP_EMPRESAS>;

                //Comparo elemento por elemento para chequear los insert y actualizaciones
                foreach (var objItris in itrisErpEmpresasResponse.data)
                {
                    var empresa = listaServiceEmpresas.Where(a => a.ID == objItris.ID).SingleOrDefault();
                    if (empresa != null)
                    {
                        if (!EmpresasIguales(empresa, objItris))
                        {
                            ActualizoEmpresa(empresa, objItris);
                            serviceSyncErpEmpresasEntity.ListaUpdate.Add(empresa);
                        }
                    }
                    else
                    {
                        serviceSyncErpEmpresasEntity.ListaCreate.Add(CreoNuevaEmpresa(objItris));
                    }
                }

                //Obtengo los elementos que tengo que eliminar en la bd DACS
                //foreach (var objService in listaServiceEmpresas)
                //{
                //	var objDelete = itrisErpEmpresasResponse.data.Where(a => a.ID == objService.ID).SingleOrDefault();
                //	if (objDelete == null)
                //		serviceSyncErpEmpresasEntity.ListaDelete.Add(objService);
                //}

                PersistirListas(serviceSyncErpEmpresasEntity);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(serviceSyncErpEmpresasEntity);
        }
Beispiel #6
0
        public ServiceSyncArticuloEntity SynchronizeArticuloDACS(ItrisAuthenticateEntity authenticateEntity, string lastUpdate)
        {
            //Listas CUD en DB_DACS
            ServiceSyncArticuloEntity serviceArticuloEntity = new ServiceSyncArticuloEntity();

            serviceArticuloEntity.ListaCreate = new List <ARTICULO>();
            serviceArticuloEntity.ListaUpdate = new List <ARTICULO>();
            serviceArticuloEntity.ListaDelete = new List <ARTICULO>();

            try
            {
                List <ARTICULO> listaArticulosItris = new List <ARTICULO>();

                ItrisArticuloBusiness itrisArticuloBusiness = new ItrisArticuloBusiness(authenticateEntity);
                ItrisArticuloResponse itrisArticuloResponse =
                    Task.Run(async() => await itrisArticuloBusiness.GetLastUpdate(lastUpdate)).GetAwaiter().GetResult();

                List <ARTICULO> listaServiceArticulo = this.Read() as List <ARTICULO>;

                //Comparo elemento por elemento para chequear los insert y actualizaciones
                foreach (var objItris in itrisArticuloResponse.data)
                {
                    var articulo = listaServiceArticulo.Where(a => a.ID == objItris.ID).SingleOrDefault();
                    if (articulo != null)
                    {
                        if (!ArticulosIguales(articulo, objItris))
                        {
                            ActualizoArticulo(articulo, objItris);
                            serviceArticuloEntity.ListaUpdate.Add(articulo);
                        }
                    }
                    else
                    {
                        serviceArticuloEntity.ListaCreate.Add(CreoNuevoArticulo(objItris));
                    }
                }

                //Obtengo los elementos que tengo que eliminar en la bd DACS
                //foreach (var objService in listaServiceArticulo)
                //{
                //    var objDelete = itrisArticuloResponse.data.Where(a => a.ID == objService.ID).SingleOrDefault();
                //    if (objDelete == null)
                //        serviceArticuloEntity.ListaDelete.Add(objService);
                //}

                PersistirListas(serviceArticuloEntity);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(serviceArticuloEntity);
        }
Beispiel #7
0
        public async Task <HttpResponseMessage> Get()
        {
            log.Info("Ingreso");
            HttpResponseMessage response = new HttpResponseMessage();

            //CLASS
            string ITRIS_SERVER = ConfigurationManager.AppSettings["ITRIS_SERVER"];
            string ITRIS_PUERTO = ConfigurationManager.AppSettings["ITRIS_PUERTO"];
            string ITRIS_CLASE  = ConfigurationManager.AppSettings["ITRIS_CLASE_TIPO_ARTICULO"];

            //AUTHENTICATE
            string ITRIS_USER     = ConfigurationManager.AppSettings["ITRIS_USER"];
            string ITRIS_PASS     = ConfigurationManager.AppSettings["ITRIS_PASS"];
            string ITRIS_DATABASE = ConfigurationManager.AppSettings["ITRIS_DATABASE"];

            ItrisTipoDeArticuloResponse responseItris;

            try
            {
                ItrisAuthenticateEntity authenticateEntity =
                    new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO, ITRIS_CLASE, ITRIS_USER, ITRIS_PASS, ITRIS_DATABASE);

                ItrisTipoDeArticuloBusiness itrisTipoDeArticuloBusiness = new ItrisTipoDeArticuloBusiness(authenticateEntity);

                //REQUEST GENERARNDO LA SESSION DESDE EL BUSINESS
                log.Info("Ejecuta itrisTipoDeArticuloBusiness.Get():");
                string session = itrisTipoDeArticuloBusiness.SessionString;
                responseItris = await itrisTipoDeArticuloBusiness.Get(session);

                string mensaje = itrisTipoDeArticuloBusiness.CloseSession(session);
                log.Info("Respuesta itrisTipoDeArticuloBusiness.Get(): " + JsonConvert.SerializeObject(responseItris));

                //REQUEST DELEGANDO EL MANEJO DE SESION EN EL REPOSITORY BASE. ABRE Y CIERRA EN EL MISMO REQUEST
                //log.Info("Ejecuta itrisTipoDeArticuloBusiness.Get():");
                //responseItris = await itrisTipoDeArticuloBusiness.Get();
                //log.Info("Respuesta itrisTipoDeArticuloBusiness.Get(): " + JsonConvert.SerializeObject(responseItris));

                response = Request.CreateResponse(HttpStatusCode.Created, responseItris.data);
            }
            catch (Exception ex)
            {
                log.Error("Mensaje de Error: " + ex.Message);
                if (ex.InnerException != null)
                {
                    log.Error("Inner exception: " + ex.InnerException.Message);
                }

                response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
            }

            log.Info("Salio");
            return(response);
        }
        public async Task <HttpResponseMessage> Get()
        {
            log.Info("Ingreso");
            HttpResponseMessage response = new HttpResponseMessage();

            //CLASS
            string ITRIS_SERVER = ConfigurationManager.AppSettings["ITRIS_SERVER"];
            string ITRIS_PUERTO = ConfigurationManager.AppSettings["ITRIS_PUERTO"];
            string ITRIS_CLASE  = ConfigurationManager.AppSettings["ITRIS_CLASE_ARTICULO"];

            //AUTHENTICATE
            string ITRIS_USER     = ConfigurationManager.AppSettings["ITRIS_USER"];
            string ITRIS_PASS     = ConfigurationManager.AppSettings["ITRIS_PASS"];
            string ITRIS_DATABASE = ConfigurationManager.AppSettings["ITRIS_DATABASE"];

            ItrisArticuloResponse responseItris;

            try
            {
                ItrisAuthenticateEntity authenticateEntity =
                    new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO, ITRIS_CLASE, ITRIS_USER, ITRIS_PASS, ITRIS_DATABASE);

                ItrisArticuloBusiness itrisArticuloBusiness = new ItrisArticuloBusiness(authenticateEntity);

                log.Info("Ejecuta itrisArticuloBusiness.Get():");
                responseItris = await itrisArticuloBusiness.Get();

                log.Info("Respuesta itrisArticuloBusiness.Get(): " + JsonConvert.SerializeObject(responseItris));

                response = Request.CreateResponse(HttpStatusCode.Created, responseItris.data);
            }
            catch (Exception ex)
            {
                log.Error("Mensaje de Error: " + ex.Message);
                if (ex.InnerException != null)
                {
                    log.Error("Inner exception: " + ex.InnerException.Message);
                }

                response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
            }

            log.Info("Salio");
            return(response);
        }
 public ItrisArticuloRepository(ItrisAuthenticateEntity itrisAuthenticateEntity)
     : base(itrisAuthenticateEntity)
 {
 }
 public ItrisTipoDeComercioRepository(ItrisAuthenticateEntity authenticateEntity)
     : base(authenticateEntity)
 {
 }
 public ItrisTipoDeArticuloBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     _itrisAuthenticateEntity  = authenticateEntity;
     _tipoDeArticuloRepository = new ItrisTipoDeArticuloRepository(authenticateEntity);
 }
Beispiel #12
0
 public ItrisErpLocalidadesBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     itrisAuthenticateEntity       = authenticateEntity;
     itrisErpLocalidadesRepository = new ItrisErpLocalidadesRepository(authenticateEntity);
 }
 public ItrisTipoDeArticuloRepository(ItrisAuthenticateEntity authenticateEntity)
     : base(authenticateEntity)
 {
 }
Beispiel #14
0
        public HttpResponseMessage Synchronize([FromBody] TablasItris tablasItris)
        {
            log.Info("Ingreso Synchronize");
            string usuarioItris = this.ObtenerUsuarioItris();

            string[]                arregloTablasItris = tablasItris.NombreTablas.Select(x => x.ToUpper()).ToArray();
            MiddlewareModel         model              = new MiddlewareModel();
            HttpResponseMessage     response           = new HttpResponseMessage();
            ItrisAuthenticateEntity authenticateEntity = null;

            ServiceConfigurationBusiness serviceConfigurationBusiness = new ServiceConfigurationBusiness();
            string lastUpdate = string.Empty;

            try
            {
                if (arregloTablasItris.Contains(ITRIS_CLASE_EMPRESAS))
                {
                    //Obtengo fecha ultima actualizacion de la tabla de configuraciones
                    Func <tbConfiguration, bool> predicado = x => x.con_code == LAST_SYNC_EMPRESAS;
                    var listRead = (List <tbConfiguration>)serviceConfigurationBusiness.Read(predicado);
                    var conf     = listRead.FirstOrDefault();

                    authenticateEntity = new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO_API3, ITRIS_CLASE_EMPRESAS,
                                                                     ITRIS_API3_APP, ITRIS_API3_CONFIG, ITRIS_API3_USER, ITRIS_API3_PASS);
                    ServiceErpEmpresasBusiness serviceErpEmpresasBusiness = new ServiceErpEmpresasBusiness();

                    //Actualizo base de datos local respecto de las modificaciones en la base de itris
                    log.Info("Ejecuta serviceErpEmpresasBusiness.SynchronizeErpEmpresasDACS(authenticateEntity)");
                    model.resultDACSEmpresas =
                        serviceErpEmpresasBusiness.SynchronizeErpEmpresasDACS(authenticateEntity, conf.con_value);
                    log.Info("Respuesta serviceErpEmpresasBusiness.SynchronizeErpEmpresasDACS(authenticateEntity): " + JsonConvert.SerializeObject(model.resultDACSEmpresas));

                    //Actualizo la fecha de ultima actualizacion con del dia que es la ultima actualizacion
                    conf.con_value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    serviceConfigurationBusiness.Update(conf);
                }

                if (arregloTablasItris.Contains(ITRIS_CLASE_ASESORES))
                {
                    //Obtengo fecha ultima actualizacion de la tabla de configuraciones
                    Func <tbConfiguration, bool> predicado = x => x.con_code == LAST_SYNC_ASESORES;
                    var listRead = (List <tbConfiguration>)serviceConfigurationBusiness.Read(predicado);
                    var conf     = listRead.FirstOrDefault();

                    authenticateEntity = new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO_API3, ITRIS_CLASE_ASESORES,
                                                                     ITRIS_API3_APP, ITRIS_API3_CONFIG, ITRIS_API3_USER, ITRIS_API3_PASS);
                    ServiceErpAsesoresBusiness serviceErpAsesoresBusiness = new ServiceErpAsesoresBusiness();

                    //Actualizo base de datos local respecto de las modificaciones en la base de itris
                    log.Info("Ejecuta serviceErpAsesoresBusiness.SynchronizeErpAsesoresDACS(authenticateEntity)");
                    model.resultDACSAsesores = serviceErpAsesoresBusiness.SynchronizeErpAsesoresDACS(authenticateEntity, conf.con_value);
                    log.Info("Respuesta serviceErpAsesoresBusiness.SynchronizeErpAsesoresDACS(authenticateEntity): " + JsonConvert.SerializeObject(model.resultDACSAsesores));

                    //Actualizo la fecha de ultima actualizacion con del dia que es la ultima actualizacion
                    conf.con_value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    serviceConfigurationBusiness.Update(conf);
                }

                if (arregloTablasItris.Contains(ITRIS_CLASE_LOCALIDADES))
                {
                    //Obtengo fecha ultima actualizacion de la tabla de configuraciones
                    Func <tbConfiguration, bool> predicado = x => x.con_code == LAST_SYNC_LOCALIDADES;
                    var listRead = (List <tbConfiguration>)serviceConfigurationBusiness.Read(predicado);
                    var conf     = listRead.FirstOrDefault();

                    authenticateEntity = new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO_API3, ITRIS_CLASE_LOCALIDADES,
                                                                     ITRIS_API3_APP, ITRIS_API3_CONFIG, ITRIS_API3_USER, ITRIS_API3_PASS);
                    ServiceErpLocalidadesBusiness serviceErpLocalidadesBusiness = new ServiceErpLocalidadesBusiness();

                    //Actualizo base de datos local respecto de las modificaciones en la base de itris
                    log.Info("Ejecuta serviceErpLocalidadesBusiness.SynchronizeErpLocalidadesDACS(authenticateEntity)");
                    model.resultDACSLocalidades = serviceErpLocalidadesBusiness.SynchronizeErpLocalidadesDACS(authenticateEntity, conf.con_value);
                    log.Info("Respuesta serviceErpLocalidadesBusiness.SynchronizeErpLocalidadesDACS(authenticateEntity): " + JsonConvert.SerializeObject(model.resultDACSLocalidades));

                    //Actualizo la fecha de ultima actualizacion con del dia que es la ultima actualizacion
                    conf.con_value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    serviceConfigurationBusiness.Update(conf);
                }

                if (arregloTablasItris.Contains(ITRIS_CLASE_ARTICULOS))
                {
                    //Obtengo fecha ultima actualizacion de la tabla de configuraciones
                    Func <tbConfiguration, bool> predicado = x => x.con_code == LAST_SYNC_ARTICULO;
                    var listRead = (List <tbConfiguration>)serviceConfigurationBusiness.Read(predicado);
                    var conf     = listRead.FirstOrDefault();

                    authenticateEntity = new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO_API3, ITRIS_CLASE_ARTICULOS,
                                                                     ITRIS_API3_APP, ITRIS_API3_CONFIG, ITRIS_API3_USER, ITRIS_API3_PASS);
                    ServiceArticuloBusiness serviceArticuloBusiness = new ServiceArticuloBusiness();

                    //Actualizo base de datos local respecto de las modificaciones en la base de itris
                    log.Info("Ejecuta serviceArticuloBusiness.SynchronizeArticuloDACS(authenticateEntity)");
                    model.resultDACSArticulos = serviceArticuloBusiness.SynchronizeArticuloDACS(authenticateEntity, conf.con_value);
                    log.Info("Respuesta serviceArticuloBusiness.SynchronizeArticuloDACS(authenticateEntity): " + JsonConvert.SerializeObject(model.resultDACSArticulos));

                    //Actualizo la fecha de ultima actualizacion con del dia que es la ultima actualizacion
                    conf.con_value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    serviceConfigurationBusiness.Update(conf);
                }

                response = Request.CreateResponse(HttpStatusCode.Created, model);
            }
            catch (Exception ex)
            {
                log.Error("Mensaje de Error: " + ex.Message);
                if (ex.InnerException != null)
                {
                    log.Error("Inner exception: " + ex.InnerException.Message);
                }

                response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
            }

            log.Info("Salio Synchronize");
            return(response);
        }
 public ItrisTipoDeComercioBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     itrisAuthenticateEntity  = authenticateEntity;
     tipoDeComercioRepository = new ItrisTipoDeComercioRepository(authenticateEntity);
 }
Beispiel #16
0
 public ItrisErpEmpresasRepository(ItrisAuthenticateEntity authenticateEntity)
     : base(authenticateEntity)
 {
 }
 public ItrisArticuloBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     itrisAuthenticateEntity = authenticateEntity;
     itrisArticuloRepository = new ItrisArticuloRepository(authenticateEntity);
 }
Beispiel #18
0
 public ItrisRelevamientoBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     _itrisAuthenticateEntity     = authenticateEntity;
     _itrisRelevamientoRepository = new ItrisRelevamientoRepository(authenticateEntity);
 }
 public ItrisBaseRepository(ItrisAuthenticateEntity itrisAuthenticateEntity)
 {
     _authenticateEntity = itrisAuthenticateEntity;
 }
 public ItrisComercioBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     _itrisAuthenticateEntity = authenticateEntity;
     _itrisComercioRepository = new ItrisComercioRepository(authenticateEntity);
 }
 public ItrisErpEmpresasBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     itrisAuthenticateEntity    = authenticateEntity;
     itrisErpEmpresasRepository = new ItrisErpEmpresasRepository(authenticateEntity);
 }
Beispiel #22
0
 public ItrisBaseBusiness(ItrisAuthenticateEntity authenticateEntity)
 {
     itrisAuthenticateEntity = authenticateEntity;
     repo = Activator.CreateInstance(typeof(REPOSITORY), new object[] { authenticateEntity }) as REPOSITORY;
     //repo = new REPOSITORY(authenticateEntity);
 }
Beispiel #23
0
        //public async Task<List<ItrisTipoDeComercioEntity>> Get()
        public async Task <HttpResponseMessage> Get()
        {
            log.Info("Ingreso");
            HttpResponseMessage response = new HttpResponseMessage();

            //CLASS
            string ITRIS_SERVER = ConfigurationManager.AppSettings["ITRIS_SERVER"];
            string ITRIS_PUERTO = ConfigurationManager.AppSettings["ITRIS_PUERTO"];
            string ITRIS_CLASE  = ConfigurationManager.AppSettings["ITRIS_CLASE_TIPO_COMERCIO"];

            //AUTHENTICATE
            string ITRIS_USER     = ConfigurationManager.AppSettings["ITRIS_USER"];
            string ITRIS_PASS     = ConfigurationManager.AppSettings["ITRIS_PASS"];
            string ITRIS_DATABASE = ConfigurationManager.AppSettings["ITRIS_DATABASE"];

            ItrisTipoDeComercioResponse responseItris         = null;
            ItrisComercioResponse       itrisComercioResponse = null;

            try
            {
                ItrisAuthenticateEntity authenticateEntity =
                    new ItrisAuthenticateEntity(ITRIS_SERVER, ITRIS_PUERTO, ITRIS_CLASE, ITRIS_USER, ITRIS_PASS, ITRIS_DATABASE);

                #region ----------- POST COMERCIO (OK)-------------
                ItrisComercioEntity itrisComercioEntity = new ItrisComercioEntity()
                {
                    FK_TIP_COM         = 1,
                    NOMBRE             = "Quique",
                    CALLE              = "Nogoya",
                    NUMERO             = "1023",
                    FK_ERP_LOCALIDADES = 3,
                    FK_ERP_PROVINCIAS  = 1,
                    LATITUD            = "555555.666666",
                    LONGITUD           = "777777.8888888"
                };

                List <ItrisComercioEntity> listaComercio = new List <ItrisComercioEntity>();
                listaComercio.Add(itrisComercioEntity);

                ItrisComercioRequest itrisComercioRequest = new ItrisComercioRequest()
                {
                    @class = "_COMERCIO",
                    data   = listaComercio
                };

                ItrisComercioBusiness itrisComercioBusiness = new ItrisComercioBusiness(authenticateEntity);
                //itrisComercioResponse = await itrisComercioBusiness.Post(itrisComercioRequest);
                #endregion

                #region ----------- POST RELEVAMIENTO (OK)-------------
                ItrisRelevamientoEntity itrisRelevamientoEntity = new ItrisRelevamientoEntity()
                {
                    FK_ERP_EMPRESAS = "1",
                    FK_ERP_ASESORES = 1,
                    FECHA           = "12/12/2012",
                    CODIGO          = "ASD123ASD"
                };
                List <ItrisRelevamientoEntity> listaRelevamiento = new List <ItrisRelevamientoEntity>();
                listaRelevamiento.Add(itrisRelevamientoEntity);

                ItrisRelevamientoRequest itrisRelevamientoRequest = new ItrisRelevamientoRequest()
                {
                    @class = "_RELEVAMIENTO",
                    data   = listaRelevamiento
                };

                ItrisRelevamientoBusiness itrisRelevamientoBusiness = new ItrisRelevamientoBusiness(authenticateEntity);
                //var itrisRelevamientoResponse = await itrisRelevamientoBusiness.Post(itrisRelevamientoEntity);

                #endregion

                #region ----------------- POST RELEVAMIENTO-ARTICULO -------------------
                ItrisRelevamientoArticuloEntity itrisRelevamientoArticuloEntity = new ItrisRelevamientoArticuloEntity()
                {
                    FK_RELEVAMIENTO = 1,
                    FK_COMERCIO     = 1,
                    FK_ARTICULOS    = 1,
                    EXISTE          = true,
                    PRECIO          = 1.4
                };

                List <ItrisRelevamientoArticuloEntity> listaRelevamientoArticulo =
                    new List <ItrisRelevamientoArticuloEntity>();
                listaRelevamientoArticulo.Add(itrisRelevamientoArticuloEntity);

                ItrisRelevamientoArticuloRequest itrisRelevamientoArticuloRequest =
                    new ItrisRelevamientoArticuloRequest()
                {
                    @class = "_REL_ART",
                    data   = listaRelevamientoArticulo
                };

                ItrisRelevamientoArticuloBusiness itrisRelevamientoArticuloBuesiness
                    = new ItrisRelevamientoArticuloBusiness(authenticateEntity);
                //var itrisRelevamientoArticuloResponse =
                //	itrisRelevamientoArticuloBuesiness.Post(itrisRelevamientoArticuloRequest);

                #endregion

                ItrisTipoDeComercioBusiness itrisTipoDeComercioBusiness = new ItrisTipoDeComercioBusiness(authenticateEntity);

                log.Info("itrisTipoDeComercioBusiness.Get()");
                responseItris = await itrisTipoDeComercioBusiness.Get();

                log.Info("Respuesta itrisTipoDeComercioBusiness.Get(): " + JsonConvert.SerializeObject(responseItris));

                response = Request.CreateResponse(HttpStatusCode.Created, responseItris.data);
            }
            catch (Exception ex)
            {
                log.Error("Mensaje de Error: " + ex.Message);
                if (ex.InnerException != null)
                {
                    log.Error("Inner exception: " + ex.InnerException.Message);
                }

                response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
            }

            log.Info("Salio");
            return(response);
        }
 public ItrisRelevamientoRepository(ItrisAuthenticateEntity authenticateEntity)
     : base(authenticateEntity)
 {
 }
 public ItrisErpAsesoresRepository(ItrisAuthenticateEntity authenticateEntity)
     : base(authenticateEntity)
 {
 }
 public ItrisErpLocalidadesRepository(ItrisAuthenticateEntity authenticateEntity)
     : base(authenticateEntity)
 {
 }