Beispiel #1
0
        public async Task <int> DeleteBankNotifyAsync(BankNotifyDTO dto)
        {
            await Task.Delay(100);

            _bankNotifies.Remove(dto);
            return(0);
        }
Beispiel #2
0
        private static BankNotifyDTO GenerateBankNotifyDTOFromModel(BankNotifyModel model)
        {
            var bankNotifyDTO = new BankNotifyDTO
            {
                Id                = model.Id,
                IsReaded          = model.IsReaded,
                BankName          = model.BankName,
                DateTimeCreated   = model.DateTimeCreated,
                NotifyDescription = model.NotifyDescription
            };

            return(bankNotifyDTO);
        }
Beispiel #3
0
        public async Task <int> UpdateBankNotifyAsync(BankNotifyDTO dto)
        {
            await Task.Delay(100);

            var notify = _bankNotifies.FirstOrDefault(nt => nt.Id == dto.Id);

            if (notify != null)
            {
                notify.BankName          = dto.BankName;
                notify.NotifyDescription = dto.NotifyDescription;
            }
            return(0);
        }
Beispiel #4
0
        public async Task <BankNotifyDTO> CreateBankNotifyAsync(BankNotifyDTO dto)
        {
            await Task.Delay(100);

            long id = 1;

            if (_bankNotifies.Count > 0)
            {
                id = _bankNotifies.Select(x => x.Id).Max() + 1;
            }

            dto.Id = id;
            dto.DateTimeCreated = DateTime.Now;
            dto.IsReaded        = false;
            _bankNotifies.Add(dto);
            return(dto);
        }
Beispiel #5
0
        private static BankNotifyModel GenerateBankNotifyModelFromDTO(BankNotifyDTO dto)
        {
            var model = new BankNotifyModel(dto.Id, dto.BankName, dto.NotifyDescription, dto.DateTimeCreated, dto.IsReaded);

            return(model);
        }
Beispiel #6
0
 public Task <int> UpdateBankNotifyAsync(BankNotifyDTO dto)
 {
     throw new NotImplementedException();
 }