public OurBank GetPersonBank(string NationalCode)
        {
            decimal Loan    = dc.LoanSelectCommand().Where(x => x.PersonNationalCode == NationalCode).Sum(x => x.Amount);
            decimal Deposit = dc.DepositSelectCommand().Where(x => x.PersonNationalCode == NationalCode).Sum(x => x.Amount);

            // TODO better code here
            decimal PayedInstallements = 0, NonPayedInstallements = 0;

            foreach (var item in dc.LoanTransactions.Where(x => x.PersonNationalCode == NationalCode))
            {
                PayedInstallements    += item.Installements.Where(x => x.IsPayed == true).Sum(x => x.Amount);
                NonPayedInstallements += item.Installements.Where(x => x.IsPayed == false).Sum(x => x.Amount);
            }

            return(new OurBank {
                Loan = Loan, Deposit = Deposit, PayedInstallements = PayedInstallements, NonPayedInstallements = NonPayedInstallements
            });
        }
 public List <DepositSelectCommandResult> UnPermittedDepositTransactions(string NationalCode)
 {
     return(dc.DepositSelectCommand().Where(x => x.AdminPermission == false && x.PersonNationalCode == NationalCode).ToList());
 }