Example #1
0
        public SigoCreditosInfoModel(wsCRM.mCliente pClient)
        {
            Emisor = new ClienteModel
            {
                SigoClubId = pClient.Cod_SigoClub,
                EntityId   = pClient.Cod_Entidad,
                Documento  = pClient.Cedula,
                Nombre     = pClient.Nombre,
                Apellido   = pClient.Apellido,
            };

            Emisor.SaldoActualList = string.IsNullOrEmpty(pClient.DatosCuenta) ? new List <SaldoModel>() :
                                     (from mAccount in XElement.Parse(pClient.DatosCuenta).Elements("mAccount")
                                      select new SaldoModel
            {
                NumeroCuenta = Convert.ToString(mAccount.Element("NumeroCuenta").Value).Trim(),
                Descripcion = Convert.ToString(mAccount.Element("TipoCuenta").Value).Trim(),
                MontoDisponible = Convert.ToDecimal(Convert.ToString(mAccount.Element("SaldoCuenta").Value).Trim()),
                Moneda = "Dolares",
                CodigoTipoMoneda = Convert.ToInt64(Convert.ToString(mAccount.Element("Cod_Moneda").Value).Trim()),
                TipoCuenta = Convert.ToInt64(Convert.ToString(mAccount.Element("Cod_TipoCuenta").Value).Trim())
            }).Where(x => x.TipoCuenta == 7).ToList();

            Abono = new AbonoModel {
                Receptor = Emisor,
            };
            TransaccionList = new List <TransaccionModel>();
            GiftCardList    = new List <SelectListItem>();
        }
Example #2
0
        /// <summary>
        /// Asigna codigos giftcard a un cliente.
        /// </summary>
        /// <param name="pGifcardModel"></param>
        /// <returns></returns>
        public static wsCRM.mAbonosCredito EnviarGiftCard(SigoCreditosInfoModel pGifcardModel)
        {
            try
            {
                wsCRM.mCliente client = cRMClient.ObtenerPuntosxClienteAsync(pGifcardModel.Abono.Receptor.TipoDocumento, pGifcardModel.Abono.Receptor.Documento).Result;

                // var result=  cRMClient.CrearVenderGiftCardAsync(0, pGifcardModel.Abono.Receptor.EntityId, client, 1, 2, Convert.ToDecimal(pGifcardModel.Abono.MontoTransaccionGiftCard), "Dolares", true).Result;
                var vResult = new wsCRM.mAbonosCredito
                {
                    Cod_Abono = 0//result
                };

                return(vResult);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public static wsCRM.mAbonosCredito AbonarPuntos(SigoCreditosInfoModel pModel)
        {
            try
            {
                wsCRM.IwsCRMClient cRMClient = new wsCRM.IwsCRMClient(wsCRM.IwsCRMClient.EndpointConfiguration.BasicHttpBinding_IwsCRM);
                wsCRM.mCliente     clienteA  = new wsCRM.mCliente();
                wsCRM.mCliente     client    = pModel.AddBalanceModel.OwnerBalance == 1
                ? new wsCRM.mCliente()
                {
                    Cod_SigoClub = pModel.AddBalanceModel.CustomerSigoClubId, Cedula = pModel.CustomerDocumentValue
                }
                : cRMClient.ObtenerPuntosxClienteAsync(pModel.AddBalanceModel.ReceiverDocumentType, pModel.AddBalanceModel.ReceiverDocumentValue).Result;

                // wsCRM.mAbonosCredito result = cRMClient.GenerarAbonoPuntosAsync(client.Cod_SigoClub, "00", 2, new wsCRM.mCliente(), "", pModel.AddBalanceModel.TransactionAmount, 13440, 44, "", false, "Dolar", (wsCRM.CodigosTipoOperacionMov)TipoOperacionMov.EcormmerceAbonoSaldo, -1).Result;
                // wsCRM.mAbonosCredito result = cRMClient.GenerarAbonoPuntosAsync(client.Cod_SigoClub, "00", 2, new wsCRM.mCliente(), "", pModel.AddBalanceModel.TransactionAmount, 13440, 44, "", false, "Dolar", (wsCRM.CodigosTipoOperacionMov)TipoOperacionMov.CRMAbobodirectodesaldo, -1).Result;
                return(cRMClient.GenerarAbonoPuntosAsync(client.Cod_SigoClub, "00", 2, clienteA, "", Convert.ToDecimal(pModel.AddBalanceModel.TransactionAmount.Replace(".", string.Empty).Replace(",", ".").Trim()), 0, 44, "", false, "Dolar", (wsCRM.CodigosTipoOperacionMov)TipoOperacionMov.EcormmerceAbonoSaldo, -1).Result);
                //return CRMAbobodirectodesaldo
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
 public static bool EnviarGiftCard(SigoCreditosGiftCardModel pGifcardModel)
 {
     wsCRM.mCliente client = cRMClient.ObtenerPuntosxClienteAsync(pGifcardModel.DocumentType, pGifcardModel.DocumentValue).Result;
     return(!(client is null) && cRMClient.VenderGiftCardAsync(0, pGifcardModel.EntityId, client, 1, 2, pGifcardModel.Amount, "Dolares").Result > 0);
 }