public IActionResult New(BankSaveModel bankSaveModel, bool edit = false)
        {
            if (edit)
            {
                Bank newBank = _bankService.Set().Single(s => s.ID == bankSaveModel.BankModel.ID);
                newBank.Name = bankSaveModel.BankModel.Name;
                newBank.URL  = bankSaveModel.BankModel.URL;
                _bankService.Commit();

                ContactPerson newContactPerson = _contactPersonService.Set().Single(s => s.BankID == bankSaveModel.BankModel.ID && s.PositionID == _positionService.Set().Single(ss => ss.Name.Equals("General Director")).ID);
                newContactPerson.FirstName   = bankSaveModel.ContactPersonModel.FirstName;
                newContactPerson.LastName    = bankSaveModel.ContactPersonModel.LastName;
                newContactPerson.DateOfBirth = bankSaveModel.ContactPersonModel.DateOfBirth;
                _contactPersonService.Commit();

                return(RedirectToAction("Index", "Home"));
            }

            Bank bank = new Bank()
            {
                ID   = bankSaveModel.BankModel.ID,
                Name = bankSaveModel.BankModel.Name.Trim(),
                URL  = bankSaveModel.BankModel.URL?.Trim()
            };

            _bankService.Save(bank);
            _bankService.Commit();

            ContactPerson contactPerson = new ContactPerson()
            {
                FirstName   = bankSaveModel.ContactPersonModel.FirstName.Trim(),
                LastName    = bankSaveModel.ContactPersonModel.LastName.Trim(),
                DateOfBirth = bankSaveModel.ContactPersonModel.DateOfBirth,
                BankID      = _bankService.Set().Last().ID,
                PositionID  = _positionService.Set().Single(s => s.Name.Equals("General Director")).ID
            };

            _contactPersonService.Save(contactPerson);
            _contactPersonService.Commit();

            return(RedirectToAction("NewContactPerson", new { bankId = bank.ID }));
        }
        public IActionResult Index(string text, int?id, bool remove = false)
        {
            if (remove && id != null)
            {
                if (_bankService.Set().SingleOrDefault(s => s.ID == id) == null)
                {
                    return(NotFound("Bank not found!"));
                }
                _bankService.Remove(_bankService.Set().Single(s => s.ID == id));
                _bankService.Commit();
            }
            else if (!string.IsNullOrWhiteSpace(text))
            {
                return(View(_bankService.Set().Where(w => w.Name.ToLower().Trim().Contains(text.ToLower().Trim())).Select(s => (BankModel)s).ToList()));
            }

            return(View(_bankService.Set().Select(s => (BankModel)s).ToList()));
        }