Exemple #1
0
        private List <int> ObtenerListadoOrdenes(DateTime Star, DateTime End)
        {
            #region ObtenerListadoOrdenes
            List <int> ListaOrdenIdentification = new List <int>();

            try
            {
                var ExtClient = new TicketCarFacadeServicesClient("BasicHttpsBinding_ITicketCarFacadeServices");
                ExtClient.ClientCredentials.UserName.UserName = ConfigurationTicketCar.EXTERNAL_VALID_USER_ID;
                ExtClient.ClientCredentials.UserName.Password = ConfigurationTicketCar.EXTERNAL_VALID_PASSWORD;

                var request = new OrderDTORequest();
                request.Security = new SecurityDTO {
                    Token = ConfigurationTicketCar.PROVIDED_TOKEN, Ip = ConfigurationTicketCar.CLIENT_IP
                };
                request.Paging = new PagingDTO {
                    All = ConfigurationTicketCar.GET_ALL_RECORDS, PageNumber = ConfigurationTicketCar.PAG_NUMBER, PageRecords = ConfigurationTicketCar.PAGE_RECORDS
                };
                request.Item = new OrderDTO()
                {
                    OrderDateStart          = Star,
                    OrderDateEnd            = End,
                    OrderTypeIdentification = OrderType.NoteVoucher19
                };

                OrderListDTOResponse response = new OrderListDTOResponse();
                response = ExtClient.OrderGetFilteredList(request);

                if (response.Success)
                {
                    foreach (var item in response.List)
                    {
                        ListaOrdenIdentification.Add(Convert.ToInt32(item.OrderNumber));
                    }
                }
                else if (response.ErrorList != null && response.ErrorList.Any())
                {
                    EnviarCorreoError("Error: " + response.ErrorList.Select(s => s.Message).FirstOrDefault() + " Codigo: " + response.ErrorList.Select(s => s.Code).FirstOrDefault(), "Obtener Listados de Ordenes de Ticket Car");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ListaOrdenIdentification);

            #endregion
        }
Exemple #2
0
        private Tuple <int, int> ObtenerEstatusOrdenNotaVale(int OrderNumber)
        {
            #region ObtenerOrdenEstatusNotaVale
            Tuple <int, int> NotaValeEstatus = new Tuple <int, int>(0, 0);
            try
            {
                var ExtClient = new TicketCarFacadeServicesClient("BasicHttpsBinding_ITicketCarFacadeServices");
                ExtClient.ClientCredentials.UserName.UserName = ConfigurationTicketCar.EXTERNAL_VALID_USER_ID;
                ExtClient.ClientCredentials.UserName.Password = ConfigurationTicketCar.EXTERNAL_VALID_PASSWORD;

                var request = new OrderDTORequest();
                request.Security = new SecurityDTO {
                    Token = ConfigurationTicketCar.PROVIDED_TOKEN, Ip = ConfigurationTicketCar.CLIENT_IP
                };
                request.Paging = new PagingDTO {
                    All = ConfigurationTicketCar.GET_ALL_RECORDS, PageNumber = ConfigurationTicketCar.PAG_NUMBER, PageRecords = ConfigurationTicketCar.PAGE_RECORDS
                };
                request.Item = new OrderDTO()
                {
                    OrderNumber             = Convert.ToUInt32(OrderNumber),
                    OrderTypeIdentification = OrderType.NoteVoucher19
                };

                OrdeItemDTOResponse response = new OrdeItemDTOResponse();
                response = ExtClient.OrderGetItem(request);

                if (response.Success)
                {
                    NotaValeEstatus = new Tuple <int, int>(Convert.ToInt32(response.Item.DetailList.Select(s => s.PreAuthorizationStatusIdentification).FirstOrDefault()), Convert.ToInt32(response.Item.PreAuthorizationAvailableQuantity));
                }
                else if (response.ErrorList != null && response.ErrorList.Any())
                {
                    EnviarCorreoError("Error: " + response.ErrorList.Select(s => s.Message).FirstOrDefault() + " Codigo: " + response.ErrorList.Select(s => s.Code).FirstOrDefault(), "Obtener Estatus NotaVale y el uso de la NotaVale de Ticket Car");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(NotaValeEstatus);

            #endregion
        }
Exemple #3
0
        private Tuple <bool, decimal> ObtenerListadoTransacciones(DateTime Star, DateTime End, string CardNumber, int IdentificadorTicket)
        {
            decimal LitrosCargados = 0;
            bool    Resultado      = false;

            #region ObtenerListadoTransacciones
            try
            {
                var ExtClient = new TicketCarFacadeServicesClient("BasicHttpsBinding_ITicketCarFacadeServices");
                ExtClient.ClientCredentials.UserName.UserName = ConfigurationTicketCar.EXTERNAL_VALID_USER_ID;
                ExtClient.ClientCredentials.UserName.Password = ConfigurationTicketCar.EXTERNAL_VALID_PASSWORD;

                var request = new TransactionDTORequest();
                request.Security = new SecurityDTO {
                    Token = ConfigurationTicketCar.PROVIDED_TOKEN, Ip = ConfigurationTicketCar.CLIENT_IP
                };
                request.Paging = new PagingDTO {
                    All = ConfigurationTicketCar.GET_ALL_RECORDS, PageNumber = ConfigurationTicketCar.PAG_NUMBER, PageRecords = ConfigurationTicketCar.PAGE_RECORDS
                };
                request.Item = new TransactionDTO()
                {
                    TransactionDateTimeStart = Star,
                    TransactionDateTimeEnd   = End,
                    InformationType          = ConfigurationTicketCar.ONLINE_TRX ? 1 : 0,
                    CardNumber = CardNumber
                };

                TransactionListDTOResponse response = new TransactionListDTOResponse();
                response = ExtClient.TransactionGetFilteredList(request);

                if (response.Success)
                {
                    if (response.List != null)
                    {
                        foreach (var item in response.List)
                        {
                            if (item.CardRequisition.PreAuhorizationIdentification == IdentificadorTicket && item.Status == "APROBADA")
                            {
                                LitrosCargados += item.Detail.Merchandise.Quantity;
                            }
                            else if (item.CardRequisition.PreAuhorizationIdentification == IdentificadorTicket && item.Status == "PENDIENTE")
                            {
                                LitrosCargados += item.Detail.Merchandise.Quantity;
                            }
                        }

                        Resultado = true;
                    }
                }
                else if (response.ErrorList != null && response.ErrorList.Any())
                {
                    EnviarCorreoError("Error: " + response.ErrorList.Select(s => s.Message).FirstOrDefault() + " Codigo: " + response.ErrorList.Select(s => s.Code).FirstOrDefault(), "Obtener Listados de Transacciones de Ticket Car");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(new Tuple <bool, decimal>(Resultado, LitrosCargados));

            #endregion
        }