public int CreateDebitCardApplication(BLL.Models.DebitCardApplication model) { DebitCardApplication application = new DebitCardApplication() { BaseApplicationId = model.BaseApplicationId, IsContactless = model.IsContactless, AccountId = model.AccountId }; context.Entry(application).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); return(application.Id); }
public int CreateDebitCard(DebitCardApplication model, int baseId) { DebitCard card = new DebitCard() { BaseCardId = baseId, MonthlyLimit = 300, AccountId = model.AccountId, IsContactless = model.IsContactless }; context.Entry(card).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); return(card.Id); }
public DebitCardApplication GetDebitApplication(int id) { var item = cardsDAO.GetDebitApplication(id); var baseItem = cardsDAO.GetBaseApplication(item.BaseApplicationId); var user = usersFcd.GetUserById(baseItem.UserId); DebitCardApplication debitApp = new DebitCardApplication() { IsContactless = item.IsContactless, AccountId = item.AccountId, AccountNumber = usersFcd.GetUserAccountById(item.AccountId).AccountNumber, BaseApplicationId = baseItem.Id, Id = item.Id, Name = user.FirstName, Surname = user.LastName }; return(debitApp); }