Example #1
0
 public async Task ChangePIN(ChangePIN command)
 {
     //get card with old pin
     //Card c = await _repository.GetPINAsync(command.Id);
     //create the same card with new pin
     Card newCard = new Card(command.Id, command.Type, command.PIN);
     await _repository.ChangePIN(newCard);
 }
        public ChangePINResponse DoChangePIN(CardDetails theCard, Account acct, string seq_nr)
        {
            ChangePINResponse response = null;

            lock (this)
            {
                if (_clientPeer.IsConnected)
                {
                    ChangePIN cpMsg = new ChangePIN(_terminal, acct, theCard, _transactionID, seq_nr);
                    new PANE.ERRORLOG.Error().LogInfo("Pin Change Request: " + cpMsg.ToString());

                    Trx.Messaging.Message responseMessage = ProcessRequest(cpMsg);
                    new PANE.ERRORLOG.Error().LogInfo("Pin Change Response: " + responseMessage.ToString());
                    response = new ChangePINResponse(responseMessage);
                    response.TransactionID = _transactionID;
                }
            }
            return(response);
        }
Example #3
0
        /// <summary>
        /// Bắt sự kiện đăng nhập và khởi tạo các use case có liên quan
        /// </summary>
        /// <param name="isSuccess"></param>
        /// <param name="ds"></param>
        /// <param name="mathe"></param>
        private void Validation_login(bool isSuccess, DanhsachtheATM ds, string mathe)
        {
            if (isSuccess)
            {
                this.ds    = ds;
                tk         = DanhSachTaiKhoan_BUL.Instance.LayThongTinTaiKhoan(ds.Mataikhoan);
                kh         = KhachHang_BUL.Instance.LayThongTinKhachHang(tk.Makhachhang);
                main       = new MainUC(tk, kh);
                this.mathe = mathe;

                main.rutten       += Main_rutten;
                main.checkBalance += Main_checkBalance;
                main.history      += Main_history;
                main.changePIN    += Main_changePIN;
                main.exit         += Main_exit;
                main.cardTranfer  += Main_cardTranfer;

                viewHistory   = new ViewHistory(tk, kh, mathe, thongTinMay.MaATM);
                checkBanlance = new CheckBanlance(tk, kh, mathe, thongTinMay.MaATM);
                changePIN     = new ChangePIN(mathe, thongTinMay.MaATM, this);
                withDraw      = new WithDraw(tk, kh);
                beingFinal    = new BeingFinal_UC(tk, kh);
                cardTranfer   = new CardTranfer(tk, kh, mathe, thongTinMay.MaATM, this);
                final_UC      = new Final_UC(tk, kh);

                withDraw.SetMoney   += WithDraw_SetMoney;
                viewHistory.click   += ViewHistory_click;
                checkBanlance.click += CheckBanlance_click;
                changePIN.ok        += ChangePIN_ok;
                cardTranfer.tranfer += CardTranfer_tranfer;

                final_UC.click_Finish += Final_UC_click_Finish;

                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(main);
            }
        }
Example #4
0
        public async Task <IActionResult> Put([FromRoute] Guid id, [FromBody] ChangePIN command)
        {
            await _service.ChangePIN(command);

            return(NoContent());
        }