public void InsertAppointmentBooking(int branchId, int clientId, int caseType, DateTime dateTime) { using (BankingChatbotDataContext db = new BankingChatbotDataContext()) { BookedAppointment appointment = new BookedAppointment() { BranchId = branchId, CaseType = caseType, ClientId = clientId, Date = dateTime }; db.BookedAppointments.Add(appointment); db.SaveChanges(); } }
public void UpdateCardLimit(int cardId, CardLimitType limitType, int newLimit) { using (BankingChatbotDataContext db = new BankingChatbotDataContext()) { DebitCard selectedCard = db.DebitCards.Single(x => x.DebitCardId == cardId); switch (limitType) { case CardLimitType.PurchaseLimit: selectedCard.DailyPaymentLimit = newLimit; break; case CardLimitType.CashWithdrawalLimit: selectedCard.DailyCashWithdrawalLimit = newLimit; break; default: throw new ArgumentOutOfRangeException(); } db.SaveChanges(); } }