/// <summary>
        /// Método que serializa una List<ULTIMO_MOVIMIENTO> a Json
        /// </summary>
        /// <returns>Regresa un String en formato Json de ULTIMO_MOVIMIENTO</returns>
        /// <returns>Si no hay datos regresa null</returns>
        public string GetJsonUltimoMovimiento()
        {
            string res = null;
            List <ULTIMO_MOVIMIENTO> listUltimoMovimiento = new List <ULTIMO_MOVIMIENTO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.ULTIMO_MOVIMIENTO
                 where p.IS_MODIFIED == true
                 select p).ToList().ForEach(row =>
                {
                    listUltimoMovimiento.Add(new ULTIMO_MOVIMIENTO
                    {
                        UNID_ITEM               = row.UNID_ITEM,
                        UNID_ALMACEN            = row.UNID_ALMACEN,
                        UNID_CLIENTE            = row.UNID_CLIENTE,
                        UNID_PROVEEDOR          = row.UNID_PROVEEDOR,
                        UNID_MOVIMIENTO_DETALLE = row.UNID_MOVIMIENTO_DETALLE,
                        IS_MODIFIED             = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE      = row.LAST_MODIFIED_DATE,
                        IS_ACTIVE               = row.IS_ACTIVE,
                        UNID_INFRAESTRUCTURA    = row.UNID_INFRAESTRUCTURA,
                        CANTIDAD = row.CANTIDAD,
                        UNID_ULTIMO_MOVIMIENTO = row.UNID_ULTIMO_MOVIMIENTO,
                        UNID_ITEM_STATUS       = row.UNID_ITEM_STATUS
                    });
                });
                if (listUltimoMovimiento.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listUltimoMovimiento);
                }
                return(res);
            }
        }
Exemple #2
0
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            base.OnActionExecuting(context);
            Microsoft.Extensions.Primitives.StringValues token = context.HttpContext.Request.Headers["AccessToken"];
            if (!string.IsNullOrWhiteSpace(token))
            {
                //存在AccessToken值,进行验证
                RedisCacheTicket authBase   = new RedisCacheTicket(token);
                TicketEntity     userTicket = authBase.CurrentUserTicket;
                if (userTicket != null && userTicket.MemberID > 0)
                {
                    CurrentUserTicket = userTicket;
                    return;
                }
            }

            //直接输出结果,不经过Controller
            ResponseResult result = new ResponseResult()
            {
                errno  = 30,
                errmsg = "请重新登录",
            };

            context.Result = new ContentResult()
            {
                Content = SerializerJson.SerializeObject(result), StatusCode = 200
            };
        }
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            base.OnActionExecuting(context);
            this.Ip = GetHostAddress();
            bool   a  = context.HttpContext.Request.Cookies.ContainsKey("AccessToken");
            bool   b  = context.HttpContext.Request.Cookies.TryGetValue("AccessToken", out string token);
            string cb = string.Empty;;
            bool   c  = context.HttpContext.Request.Cookies.TryGetValue("CabinetCode", out cb);

            CabinetCode = cb;
            if (b)
            {
                this.OpenId = token;
            }
            else
            {
                context.Result = new ContentResult()
                {
                    Content = SerializerJson.SerializeObject(new
                    {
                        code = 30,
                        msg  = "请重新登录",
                    }),
                    StatusCode = 200
                };
            }
        }
        /// <summary>
        /// Método que serializa una List<ALMACEN_TECNICO> a Json
        /// </summary>
        /// <returns>Regresa un String en formato Json de ALMACEN_TECNICO</returns>
        /// <returns>Si no hay datos regresa null</returns>
        public string GetJsonAlmacenTecnico()
        {
            string res = null;
            List <ALMACEN_TECNICO> listAlmacenTecnico = new List <ALMACEN_TECNICO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.ALMACEN_TECNICO
                 where p.IS_MODIFIED == true
                 select p).ToList().ForEach(row =>
                {
                    listAlmacenTecnico.Add(new ALMACEN_TECNICO
                    {
                        UNID_ALMACEN       = row.UNID_ALMACEN,
                        UNID_TECNICO       = row.UNID_TECNICO,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listAlmacenTecnico.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listAlmacenTecnico);
                }
                return(res);
            }
        }
        public string GetJsonMaxMin(long?Last_Modified_Date)
        {
            string         res        = null;
            List <MAX_MIN> listMaxMin = new List <MAX_MIN>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.MAX_MIN
                 where p.LAST_MODIFIED_DATE > Last_Modified_Date
                 select p).ToList().ForEach(row =>
                {
                    listMaxMin.Add(new MAX_MIN
                    {
                        UNID_ALMACEN       = row.UNID_ALMACEN,
                        UNID_ARTICULO      = row.UNID_ARTICULO,
                        UNID_MAX_MIN       = row.UNID_MAX_MIN,
                        MAX                = row.MAX,
                        MIN                = row.MIN,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listMaxMin.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listMaxMin);
                }
                return(res);
            }
        }
        public string GetJsonReciboStatus(long?LastModifiedDate)
        {
            string res = null;
            List <RECIBO_STATUS> listReciboStatus = new List <RECIBO_STATUS>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.RECIBO_STATUS
                 where p.LAST_MODIFIED_DATE > LastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listReciboStatus.Add(new RECIBO_STATUS
                    {
                        UNID_RECIBO_STATUS = row.UNID_RECIBO_STATUS,
                        RECIBO_STATUS_NAME = row.RECIBO_STATUS_NAME,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listReciboStatus.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listReciboStatus);
                }
                return(res);
            }
        }
Exemple #7
0
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="queue">队列名称</param>
        /// <param name="isProperties"></param>
        /// <param name="handler">消费处理</param>
        /// <param name="isDeadLetter"></param>
        public void Subscribe <T>(Action <T> handler) where T : class
        {
            //每次消费的消息数
            _channel.BasicQos(0, 1, false);

            RabbitMessageQueueOptions queueOptions = RabbitQueueOptionsUtil.ReaderByQueue(_queueName);

            _channel.ExchangeDeclare(queueOptions.ExchangeName, ExchangeType.Direct);
            _channel.QueueDeclare(_queueName, true, false, false, null);
            _channel.QueueBind(_queueName, queueOptions.ExchangeName, queueOptions.RoutingKeys);

            var consumer = new EventingBasicConsumer(_channel);

            consumer.Received += (model, ea) =>
            {
                var    body      = ea.Body;
                var    msgStr    = body.StreamToStr();
                var    msg       = SerializerJson.DeserializeObject <T>(msgStr);
                string messageId = ea.BasicProperties.MessageId;//消息Id
                try
                {
                    handler(msg);
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"队列:{_queueName},MessageId:{messageId}", ex);
                }
                finally
                {
                    _channel.BasicAck(ea.DeliveryTag, false);
                }
            };
            _channel.BasicConsume(_queueName, false, consumer);
        }
        public string GetJsonTecnico(long?LMD)
        {
            string         res         = null;
            List <TECNICO> listTecnico = new List <TECNICO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.TECNICOes
                 where p.LAST_MODIFIED_DATE > LMD
                 select p).ToList().ForEach(row =>
                {
                    listTecnico.Add(new TECNICO
                    {
                        UNID_TECNICO       = row.UNID_TECNICO,
                        TECNICO_NAME       = row.TECNICO_NAME,
                        MAIL               = row.MAIL,
                        UNID_CIUDAD        = row.UNID_CIUDAD,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listTecnico.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listTecnico);
                }
                return(res);
            }
        }
Exemple #9
0
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="queue">队列名称</param>
        /// <param name="isProperties"></param>
        /// <param name="handler">消费处理</param>
        /// <param name="isDeadLetter"></param>
        public void Subscribe <T>(string queue, bool isProperties, Action <T> handler, bool isDeadLetter) where T : class
        {
            //队列声明
            var channel = GetModel(queue, isProperties);

            var consumer = new EventingBasicConsumer(channel);

            consumer.Received += (model, ea) =>
            {
                var body   = ea.Body;
                var msgStr = body.StreamToStr();
                var msg    = SerializerJson.DeserializeObject <T>(msgStr);
                try
                {
                    handler(msg);
                }
                catch (Exception ex)
                {
                    //ex.GetInnestException().WriteToFile("队列接收消息", "RabbitMq");
                    if (!isDeadLetter)
                    {
                        PublishToDead <DeadLetterQueue>(queue, msgStr, ex);
                    }
                }
                finally
                {
                    channel.BasicAck(ea.DeliveryTag, false);
                }
            };
            channel.BasicConsume(queue, false, consumer);
        }
        /// <summary>
        /// 赋值Session
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public static void SetSession(string key, string value)
        {
            string json = SerializerJson.SerializeObject(value);

            byte[] serializedResult = System.Text.Encoding.UTF8.GetBytes(json);
            Compatible.HttpContext.Current.Session.Set(key, serializedResult);
        }
Exemple #11
0
        public string GetJsonPropiedad(long?LastModifiedDate)
        {
            string           res           = null;
            List <PROPIEDAD> listPropiedad = new List <PROPIEDAD>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.PROPIEDADs
                 where p.LAST_MODIFIED_DATE > LastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listPropiedad.Add(new PROPIEDAD
                    {
                        UNID_PROPIEDAD     = row.UNID_PROPIEDAD,
                        PROPIEDAD1         = row.PROPIEDAD1,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listPropiedad.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listPropiedad);
                }
                return(res);
            }
        }
Exemple #12
0
        public string GetJsonTransporte(long?LMD)
        {
            string            res            = null;
            List <TRANSPORTE> listTransporte = new List <TRANSPORTE>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.TRANSPORTEs
                 where p.LAST_MODIFIED_DATE > LMD
                 select p).ToList().ForEach(row =>
                {
                    listTransporte.Add(new TRANSPORTE
                    {
                        UNID_TRANSPORTE    = row.UNID_TRANSPORTE,
                        TRANSPORTE_NAME    = row.TRANSPORTE_NAME,
                        UNID_TIPO_EMPRESA  = row.UNID_TIPO_EMPRESA,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listTransporte.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listTransporte);
                }
                return(res);
            }
        }
        public string GetJsonBanco(long?Last_Modified_Date)
        {
            string       res       = null;
            List <BANCO> listBanco = new List <BANCO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.BANCOes
                 where p.LAST_MODIFIED_DATE > Last_Modified_Date
                 select p).ToList().ForEach(row =>
                {
                    listBanco.Add(new BANCO
                    {
                        BANCO_NAME         = row.BANCO_NAME,
                        UNID_BANCO         = row.UNID_BANCO,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listBanco.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listBanco);
                }
                return(res);
            }
        }
        public string GetJsonFactura(long?LMD)
        {
            string         res         = null;
            List <FACTURA> listFactura = new List <FACTURA>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.FACTURAs
                 where p.LAST_MODIFIED_DATE > LMD
                 select p).ToList().ForEach(row =>
                {
                    listFactura.Add(new FACTURA
                    {
                        UNID_FACTURA       = row.UNID_FACTURA,
                        UNID_LOTE          = row.UNID_LOTE,
                        FACTURA_NUMERO     = row.FACTURA_NUMERO,
                        FECHA_FACTURA      = row.FECHA_FACTURA,
                        UNID_PROVEEDOR     = row.UNID_PROVEEDOR,
                        UNID_MONEDA        = row.UNID_MONEDA,
                        NUMERO_PEDIMENTO   = row.NUMERO_PEDIMENTO,
                        IVA_POR            = row.IVA_POR,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE,
                        TC = row.TC,
                        UNID_TIPO_PEDIMENTO = row.UNID_TIPO_PEDIMENTO
                    });
                });
                if (listFactura.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listFactura);
                }
                return(res);
            }
        }
        public string GetJsonMenu(long?LastModifiedDate)
        {
            string      res      = null;
            List <MENU> listMenu = new List <MENU>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.MENUs
                 where p.LAST_MODIFIED_DATE > LastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listMenu.Add(new MENU
                    {
                        UNID_MENU          = row.UNID_MENU,
                        UNID_MENU_PARENT   = row.UNID_MENU_PARENT,
                        MENU_NAME          = row.MENU_NAME,
                        IS_LEAF            = row.IS_LEAF,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listMenu.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listMenu);
                }
                return(res);
            }
        }
Exemple #16
0
        /// <summary>
        /// 获取消息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="exchange"></param>
        /// <param name="queue"></param>
        /// <param name="routingKey"></param>
        /// <param name="handler">消费处理</param>
        private void Pull <T>(string exchange, string queue, string routingKey, Action <T> handler) where T : class
        {
            var channel = GetModel(exchange, queue, routingKey);

            var result = channel.BasicGet(queue, false);

            if (result.IsNullOrEmpty())
            {
                return;
            }

            var msg = SerializerJson.DeserializeObject <T>(result.Body.StreamToStr());

            try
            {
                handler(msg);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                channel.BasicAck(result.DeliveryTag, false);
            }
        }
        public string GetJsonMedioEnvio(long?Last_Modified_Date)
        {
            string             res            = null;
            List <MEDIO_ENVIO> listMedioEnvio = new List <MEDIO_ENVIO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.MEDIO_ENVIO
                 where p.LAST_MODIFIED_DATE > Last_Modified_Date
                 select p).ToList().ForEach(row =>
                {
                    listMedioEnvio.Add(new MEDIO_ENVIO
                    {
                        UNID_MEDIO_ENVIO   = row.UNID_MEDIO_ENVIO,
                        MEDIO_ENVIO_NAME   = row.MEDIO_ENVIO_NAME,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listMedioEnvio.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listMedioEnvio);
                }
                return(res);
            }
        }
Exemple #18
0
        /// <summary>
        /// RPC服务端
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="exchange"></param>
        /// <param name="queue"></param>
        /// <param name="isProperties"></param>
        /// <param name="handler"></param>
        /// <param name="isDeadLetter"></param>
        public void RpcService <T>(string exchange, string queue, bool isProperties, Func <T, T> handler, bool isDeadLetter)
        {
            //队列声明
            var channel = GetModel(queue, isProperties);

            var consumer = new EventingBasicConsumer(channel);

            consumer.Received += (model, ea) =>
            {
                var body   = ea.Body;
                var msgStr = body.StreamToStr();
                var msg    = SerializerJson.DeserializeObject <T>(msgStr);

                var props      = ea.BasicProperties;
                var replyProps = channel.CreateBasicProperties();
                replyProps.CorrelationId = props.CorrelationId;

                try
                {
                    msg = handler(msg);
                }
                catch (Exception ex)
                {
                    //ex.GetInnestException().WriteToFile("队列接收消息", "RabbitMq");
                }
                finally
                {
                    channel.BasicPublish(exchange, props.ReplyTo, replyProps, SerializerJson.SerializeObject(msg).StrToByte());
                    channel.BasicAck(ea.DeliveryTag, false);
                }
            };
            channel.BasicConsume(queue, false, consumer);
        }
Exemple #19
0
        /// <summary>
        /// Método que serializa un POCO UPLOAD_LOG a Json
        /// </summary>
        /// <returns>Regresa un String en formato Json de UPLOAD_LOG</returns>
        /// <returns>Si no hay datos regresa null</returns>
        public string GetJsonUpLoadLog(UPLOAD_LOG upLoadLog)
        {
            string res = null;

            res = SerializerJson.SerializeParametros(upLoadLog);
            return(res);
        }
        public string GetJsonTipoCotizacion(long?LMD)
        {
            string res = null;
            List <TIPO_COTIZACION> listTipoCotizacion = new List <TIPO_COTIZACION>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.TIPO_COTIZACION
                 where p.LAST_MODIFIED_DATE > LMD
                 select p).ToList().ForEach(row =>
                {
                    listTipoCotizacion.Add(new TIPO_COTIZACION
                    {
                        UNID_TIPO_COTIZACION = row.UNID_TIPO_COTIZACION,
                        TIPO_COTIZACION_NAME = row.TIPO_COTIZACION_NAME,
                        IS_ACTIVE            = row.IS_ACTIVE,
                        IS_MODIFIED          = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE   = row.LAST_MODIFIED_DATE
                    });
                });
                if (listTipoCotizacion.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listTipoCotizacion);
                }
                return(res);
            }
        }
        public string GetJsonUnidad(long?LMD)
        {
            string        res        = null;
            List <UNIDAD> listUnidad = new List <UNIDAD>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.UNIDADs
                 where p.LAST_MODIFIED_DATE > LMD
                 select p).ToList().ForEach(row =>
                {
                    listUnidad.Add(new UNIDAD
                    {
                        UNID_UNIDAD        = row.UNID_UNIDAD,
                        UNIDAD1            = row.UNIDAD1,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listUnidad.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listUnidad);
                }
                return(res);
            }
        }
        /// <summary>
        /// Método que serializa una List<INFRAESTRUCTURA> a Json
        /// </summary>
        /// <returns>Regresa un String en formato Json de INFRAESTRUCTURA</returns>
        /// <returns>Si no hay datos regresa null</returns>
        public string GetJsonInfraestructura()
        {
            string res = null;
            List <INFRAESTRUCTURA> listInfraestructura = new List <INFRAESTRUCTURA>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.INFRAESTRUCTURAs
                 where p.IS_MODIFIED == true
                 select p).ToList().ForEach(row =>
                {
                    listInfraestructura.Add(new INFRAESTRUCTURA
                    {
                        UNID_INFRAESTRUCTURA = row.UNID_INFRAESTRUCTURA,
                        INFRAESTRUCTURA_NAME = row.INFRAESTRUCTURA_NAME,
                        IS_ACTIVE            = row.IS_ACTIVE,
                        IS_MODIFIED          = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE   = row.LAST_MODIFIED_DATE
                    });
                });
                if (listInfraestructura.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listInfraestructura);
                }
                return(res);
            }
        }
Exemple #23
0
        public string GetJsonProgramado(long?Last_Modified_Date)
        {
            string            res            = null;
            List <PROGRAMADO> listProgramado = new List <PROGRAMADO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.PROGRAMADOes
                 where p.LAST_MODIFIED_DATE > Last_Modified_Date
                 select p).ToList().ForEach(row =>
                {
                    listProgramado.Add(new PROGRAMADO
                    {
                        UNID_ALMACEN       = row.UNID_ALMACEN,
                        UNID_ARTICULO      = row.UNID_ARTICULO,
                        UNID_PROGRAMADO    = row.UNID_PROGRAMADO,
                        PROGRAMADO1        = row.PROGRAMADO1,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listProgramado.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listProgramado);
                }
                return(res);
            }
        }
Exemple #24
0
        public string GetJsonPais(long?LastModifiedDate)
        {
            string     res      = null;
            List <PAI> listPais = new List <PAI>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.PAIS
                 where p.LAST_MODIFIED_DATE > LastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listPais.Add(new PAI
                    {
                        UNID_PAIS          = row.UNID_PAIS,
                        PAIS               = row.PAIS,
                        ISO                = row.ISO,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listPais.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listPais);
                }
                return(res);
            }
        }
Exemple #25
0
        public string GetJsonMovimientoDetalle(long?lastModifiedDate)
        {
            string res = null;
            List <MOVIMIENTO_DETALLE> listMovimientoDetalle = new List <MOVIMIENTO_DETALLE>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.MOVIMIENTO_DETALLE
                 where p.LAST_MODIFIED_DATE > lastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listMovimientoDetalle.Add(new MOVIMIENTO_DETALLE
                    {
                        UNID_MOVIMIENTO_DETALLE = row.UNID_MOVIMIENTO_DETALLE,
                        UNID_ITEM          = row.UNID_ITEM,
                        UNID_MOVIMIENTO    = row.UNID_MOVIMIENTO,
                        OBSERVACIONES      = row.OBSERVACIONES,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE,
                        CANTIDAD           = row.CANTIDAD,
                        UNID_ITEM_STATUS   = row.UNID_ITEM_STATUS
                    });
                });
                if (listMovimientoDetalle.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listMovimientoDetalle);
                }
                return(res);
            }
        }
        public string GetJsonPomArticulo(long?LastModifiedDate)
        {
            string res = null;
            List <POM_ARTICULO> listPomArticulo = new List <POM_ARTICULO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.POM_ARTICULO
                 where p.LAST_MODIFIED_DATE > LastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listPomArticulo.Add(new POM_ARTICULO
                    {
                        UNID_POM          = row.UNID_POM,
                        UNID_POM_ARTICULO = row.UNID_POM_ARTICULO,
                        UNID_ARTICULO     = row.UNID_ARTICULO,
                        CANTIDAD          = row.CANTIDAD,
                        COSTO_UNITARIO    = row.COSTO_UNITARIO,
                        IVA                = row.IVA,
                        TC                 = row.TC,
                        DESCUENTO          = row.DESCUENTO,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listPomArticulo.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listPomArticulo);
                }
                return(res);
            }
        }
Exemple #27
0
        public string GetJsonPom(long?LastModifiedDate)
        {
            string     res     = null;
            List <POM> listPom = new List <POM>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.POMs
                 where p.LAST_MODIFIED_DATE > LastModifiedDate
                 select p).ToList().ForEach(row =>
                {
                    listPom.Add(new POM
                    {
                        UNID_POM           = row.UNID_POM,
                        FECHA_POM          = row.FECHA_POM,
                        UNID_COTIZACION    = row.UNID_COTIZACION,
                        DIAS_ENTREGA       = row.DIAS_ENTREGA,
                        FECHA_ENTREGA      = row.FECHA_ENTREGA,
                        FECHA_ENTREGA_REAL = row.FECHA_ENTREGA_REAL,
                        UNID_EMPRESA       = row.UNID_EMPRESA,
                        IS_ACTIVE          = row.IS_ACTIVE,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE
                    });
                });
                if (listPom.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listPom);
                }
                return(res);
            }
        }
        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public static bool SendMesssage(string mobile, string Content)
        {
            string url = string.Format("{0}:{1}/inter/sendSingleSMS", EMayConfig.Host, EMayConfig.Port);

            SingMessage entity = new SingMessage()
            {
                content            = Content,
                mobile             = mobile,
                customsmsid        = DateTime.Now.ToString("yyyyMMddHHmmsss"),
                extendedcode       = "",
                requesttime        = DateTime.Now.Ticks,
                timertime          = "",
                requestvalidperiod = EMayConfig.ValidPeriod
            };
            HttpWebResponse response = null;
            string          json     = SerializerJson.SerializeObject(entity);

            byte[] byteArray = EMayConfig.IsCompress ? AESHelper.AESEncrypt(GzipHelper.GZipCompressString(json), EMayConfig.SecretKey) : AESHelper.AESEncrypt(json, EMayConfig.SecretKey);
            byte[] result    = HttpHelper.SendRequestData(url, byteArray, ref response);

            string code = response.GetResponseHeader("result").ToString();

            if (code == "SUCCESS")
            {
                string res = AESHelper.AESDecryptString(result, EMayConfig.SecretKey);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// Método que serializa una List<USUARIO_ROL> a Json
        /// </summary>
        /// <returns>Regresa un String en formato Json de USUARIO_ROL</returns>
        /// <returns>Si no hay datos regresa null</returns>
        public string GetJsonUsuarioRol()
        {
            string             res            = null;
            List <USUARIO_ROL> listUsuarioRol = new List <USUARIO_ROL>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.USUARIO_ROL
                 where p.IS_MODIFIED == true
                 select p).ToList().ForEach(row =>
                {
                    listUsuarioRol.Add(new USUARIO_ROL
                    {
                        UNID_ROL           = row.UNID_ROL,
                        UNID_USUARIO       = row.UNID_USUARIO,
                        IS_MODIFIED        = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE = row.LAST_MODIFIED_DATE,
                        IS_ACTIVE          = row.IS_ACTIVE
                    });
                });
                if (listUsuarioRol.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listUsuarioRol);
                }
                return(res);
            }
        }
Exemple #30
0
        public string GetJsonTipoMovimiento(long?LMD)
        {
            string res = null;
            List <TIPO_MOVIMIENTO> listTipoMovimiento = new List <TIPO_MOVIMIENTO>();

            using (var Entity = new TAE2Entities())
            {
                (from p in Entity.TIPO_MOVIMIENTO
                 where p.LAST_MODIFIED_DATE > LMD
                 select p).ToList().ForEach(row =>
                {
                    listTipoMovimiento.Add(new TIPO_MOVIMIENTO
                    {
                        UNID_TIPO_MOVIMIENTO = row.UNID_TIPO_MOVIMIENTO,
                        TIPO_MOVIMIENTO_NAME = row.TIPO_MOVIMIENTO_NAME,
                        SIGNO_MOVIMIENTO     = row.SIGNO_MOVIMIENTO,
                        IS_ACTIVE            = row.IS_ACTIVE,
                        IS_MODIFIED          = row.IS_MODIFIED,
                        LAST_MODIFIED_DATE   = row.LAST_MODIFIED_DATE
                    });
                });
                if (listTipoMovimiento.Count > 0)
                {
                    res = SerializerJson.SerializeParametros(listTipoMovimiento);
                }
                return(res);
            }
        }