public ActionResult Owner(OwnerAndFinanceVM ownerAndFinance,int id)
        {
            string valid = isValid(id);
            if (valid == null)
            {
                return RedirectToAction("Home", "Account");
            }
            if (valid == Permissions.Editor.ToString() || valid == Permissions.Owner.ToString() || valid == Permissions.Admin.ToString())
            {
                if (ModelState.IsValidField("vehicleOwner.email") && ModelState.IsValidField("financeCompany.email"))
                {
                    if (ownerAndFinance.hasFinance)
                    {
                        ownerAndFinance.financeCompany.estid = id;
                        _AddUpdate.addUpdateFinance(ownerAndFinance.financeCompany);
                    }
                    else
                    {
                        ownerAndFinance.financeCompany.estid = id;
                        _DAOFactory.FinanceDAO.delete(ownerAndFinance.financeCompany);
                    }

                    if (!ownerAndFinance.isFinanceOwner)
                    {
                        ownerAndFinance.vehicleOwner.estid = id;
                        _AddUpdate.addUpdateOwner(ownerAndFinance.vehicleOwner);
                    }
                    else
                    {
                        ownerAndFinance.vehicleOwner.estid = id;
                        _DAOFactory.OwnerDAO.delete(ownerAndFinance.vehicleOwner);
                    }
                    return RedirectToAction("Insurance", new { id = id });
                }
            }
            return View(ownerAndFinance);
        }
        public ActionResult Owner(int id)
        {
            string valid = isValid(id);
            if (valid == null)
            {
                return RedirectToAction("Home", "Account");
            }
            OwnerAndFinanceVM ownerAndFinance = new OwnerAndFinanceVM();

            ownerAndFinance.isFinanceOwner = false;
            ownerAndFinance.hasFinance = true;
            ownerAndFinance.vehicleOwner = _DAOFactory.OwnerDAO.getById(id);
            ownerAndFinance.financeCompany = _DAOFactory.FinanceDAO.getById(id);
            if (ownerAndFinance.vehicleOwner != null && ownerAndFinance.financeCompany == null)
            {
                ownerAndFinance.hasFinance = false;
            }
            else if (ownerAndFinance.financeCompany != null && ownerAndFinance.vehicleOwner == null)
            {
                ownerAndFinance.isFinanceOwner = true;
            }
            return View(ownerAndFinance);
        }