Example #1
0
        public void ReIssueCard(CardReIssue pCardReIssue)
        {
            Card be = null;
            //Card newCard = null;
            var cardCRUD = new CardCrud();

            try
            {
                be = RetrieveById(pCardReIssue.Card);
                if (be != null)
                {
                    if (pCardReIssue.Type == 1)
                    {
                        be.Balance = be.Balance + GetSystemBalance();
                    }

                    cardCRUD.Delete(be);
                    //newCard = cardCRUD.CardReIssue<Card>(be);
                    cardCRUD.Create(be);
                    SendCardDeactivationEmail(be);
                }
                else
                {
                    // Tarjeta no Encontrada || tarjeta no existe.
                    throw new BusinessException(32);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }
        }
Example #2
0
        public void Create(Card card)
        {
            var crudCard = new CardCrud();

            try
            {
                SystemParam SystemParan = new SystemParam();
                SystemParan.IdSystemParam = 4;
                SystemParan  = SyParam.Retrieve <SystemParam>(SystemParan);
                card.Balance = Convert.ToDouble(SystemParan.Value);
                card         = typeExperyCard(card);
                cardValidarior(card);
                DateValidator(card);
                notificacionValidarior(card);
                card = CreateNotificasion(card);

                if (card.User.IdUser == 0)
                {
                    User user = new User();
                    user.Identification = card.User.Identification;
                    user      = UCrud.RetrieveIdentification <User>(user);
                    card.User = user;
                }
                crudCard.Create(card);
                List <Card> ListCard = new List <Card>();
                ListCard.Add(card);
                checkSentEmail(ListCard);
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }
        }