<commit_before>﻿using ExpenseManager.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseManager.Persistence;

namespace ExpenseManager.ViewModel
{
    /// <summary>
    /// The controller for the register payment function
    /// </summary>
    public class RegisterPaymentMethodController
    {
        /// <summary>
        /// The controller method to create the credit card
        /// </summary>
        /// <param name="cardName">the card name</param>
        /// <param name="bank">the card bank</param>
        /// <param name="owner">the card owner</param>
        /// <param name="valid">the card validity</param>
        /// <param name="number">the card number</param>
        /// <param name="limit">the card limit</param>
        public void CreateCreditCard(string cardName, string bank, string owner, DateTime valid, int number, int limit)
        {
            CreditCard cc = new CreditCard(cardName, bank, owner, valid, number, limit);

            //TODO add factory
            throw new NotImplementedException();
        }

        /// <summary>
        /// The controller method to create the debit card
        /// </summary>
        /// <param name="cardName">the card name</param>
        /// <param name="bank">the card bank</param>
        /// <param name="owner">the card owner</param>
        /// <param name="valid">the card validity</param>
        /// <param name="number">the card number</param>
        public void CreateDebitCard(string cardName, string bank, string owner, DateTime valid, int number)
        {
            DebitCard dc = new DebitCard(cardName, bank, owner, valid, number);

            //TODO add factory
            throw new NotImplementedException();
        }

        /// <summary>
        /// The controller method to create the cheque book
        /// </summary>
        /// <param name="chequeBook">the cheque book name</param>
        /// <param name="bank">the cheque book bank</param>
        /// <param name="accountNumber">the account number of the cheque book</param>
        public void CreateCheque(string chequeBook, string bank, int accountNumber)
        {
            Cheque cc = new Cheque(chequeBook, bank, accountNumber);

            //TODO add factory
            throw new NotImplementedException();
        }

        /// <summary>
        /// The controller method to create the money
        /// </summary>
        /// <param name="currency">the currency of the money</param>
        public void CreateMoney(string currency)
        {
            Money mc = new Money(currency);

            //TODO add factory
            throw new NotImplementedException();
        }
    }
}<commit_msg>Finish the in memory save implementation ref #3<commit_after>﻿using ExpenseManager.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseManager.Persistence;

namespace ExpenseManager.ViewModel
{
    /// <summary>
    /// The controller for the register payment function
    /// </summary>
    public class RegisterPaymentMethodController
    {
        /// <summary>
        /// The controller method to create the credit card
        /// </summary>
        /// <param name="cardName">the card name</param>
        /// <param name="bank">the card bank</param>
        /// <param name="owner">the card owner</param>
        /// <param name="valid">the card validity</param>
        /// <param name="number">the card number</param>
        /// <param name="limit">the card limit</param>
        public void CreateCreditCard(string cardName, string bank, string owner, DateTime valid, int number, int limit)
        {
            CreditCard cc = new CreditCard(cardName, bank, owner, valid, number, limit);

            PersistenceFactory.GetFactory().GetRepository().GetPaymentMethodRepository().Save(cc);
        }

        /// <summary>
        /// The controller method to create the debit card
        /// </summary>
        /// <param name="cardName">the card name</param>
        /// <param name="bank">the card bank</param>
        /// <param name="owner">the card owner</param>
        /// <param name="valid">the card validity</param>
        /// <param name="number">the card number</param>
        public void CreateDebitCard(string cardName, string bank, string owner, DateTime valid, int number)
        {
            DebitCard dc = new DebitCard(cardName, bank, owner, valid, number);

            PersistenceFactory.GetFactory().GetRepository().GetPaymentMethodRepository().Save(dc);
        }

        /// <summary>
        /// The controller method to create the cheque book
        /// </summary>
        /// <param name="chequeBook">the cheque book name</param>
        /// <param name="bank">the cheque book bank</param>
        /// <param name="accountNumber">the account number of the cheque book</param>
        public void CreateCheque(string chequeBook, string bank, int accountNumber)
        {
            Cheque cc = new Cheque(chequeBook, bank, accountNumber);

            PersistenceFactory.GetFactory().GetRepository().GetPaymentMethodRepository().Save(cc);
        }

        /// <summary>
        /// The controller method to create the money
        /// </summary>
        /// <param name="currency">the currency of the money</param>
        public void CreateMoney(string currency)
        {
            Money mc = new Money(currency);

            PersistenceFactory.GetFactory().GetRepository().GetPaymentMethodRepository().Save(mc);
        }
    }
}
{'fraction_non_alphanumeric': 0.1242004264392324, 'fraction_numerical': 0.00017768301350390902, 'mean_word_length': 2.2803030303030303, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4041624', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1399, 'n_words': 435}