示例#1
0
        public List <LinkedAtmCards> GetAtmCards(Guid id)
        {
            List <LinkedAtmCards> atm_cards = new List <LinkedAtmCards>();

            tbl_Customer customer = customerAccountsManager.CustomerDetails(id);

            atm_cards = customerAccountsManager.GetLinkedAtmCards(customer.CustomerNo, atm_cards);

            return(atm_cards);
        }
        public bool BlockAtmCard(Guid atmCardId, tbl_Customer customer)
        {
            bool blockingStatus = false;

            List <LinkedAtmCards> cards = new List <LinkedAtmCards>();

            cards = customerAccountsManager.GetLinkedAtmCards(customer.CustomerNo, cards);

            LinkedAtmCards foundCard = cards.Where(x => x.tbl_LinkedAtmCardsID == atmCardId).FirstOrDefault();

            if (foundCard != null)
            {
                string docid = "503F";

                //block it
                string updateLinkProcess = "INSERT INTO tbl_LinkProcess(AccountNo,CardNumber,Branch,ENABLED,TransactionDate,LoginId,Narration,DOCID) " +
                                           " VALUES('" + foundCard.AccountNo + "','" + foundCard.CardNumber + "','" + foundCard.Branch +
                                           "',5,GetDate(),'APP','Stopped ATM CARD :" + foundCard.CardNumber + "','" + docid + "'); ";

                updateLinkProcess += "UPDATE tbl_LinkedAtmCards SET ENABLED=0,VERIFY=0 where tbl_LinkedAtmCardsId='" + foundCard.tbl_LinkedAtmCardsID.ToString() + "';";

                try
                {
                    //DbDataReader reader = DbConnector.GetSqlReader(updateLinkProcess);

                    int success = this.mainDb.Database.ExecuteSqlCommand(updateLinkProcess);

                    if (success >= 1)
                    {
                        blockingStatus = true;
                    }
                }
                catch (Exception ex)
                {
                    //log the exception
                    blockingStatus = false;
                }
            }

            return(blockingStatus);
        }