Пример #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);
            }
        }
Пример #2
0
        public IHttpActionResult ReIssueCard(CardReIssue pCardReIssue)
        {
            try
            {
                var mng = new CardManager();
                mng.ReIssueCard(pCardReIssue);

                apiResp         = new ApiResponse();
                apiResp.Message = "Se ha re-expedido la tarjeta.";

                return(Ok(apiResp));
            }
            catch (BusinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }