public ActionResult Join(int id = 0)
        {
            var lease = _db.Leases.Find(id);
            if (lease == null)
            {
                return HttpNotFound();
            }

            var clientId = (int)ViewData["UserId"];
            var client = _db.Clients.Find(clientId);

            var pc = _db.PurchaseCooperatives.Find(lease.LeaseId);
            if (pc == null)
            {
                ViewBag.PC = false;
            }
            else
            {
                ViewBag.PC = true;
                ViewBag.Counts = pc.Clients.Count();
            }

            var viewModel = new JoinLeaseViewModel()
            {
                Client = client,
                Lease = lease
            };

            return View(viewModel);
        }
        public ActionResult Join(JoinLeaseViewModel viewModel)
        {
            var clientId = (int)ViewData["UserId"];
            var client = _db.Clients.Find(viewModel.Client.UserId);
            var lease = viewModel.Lease;
            client.DepositAmount += viewModel.Client.DepositAmount;

            var pc = new PurchaseCooperative();
            pc.Clients = new List<Client>();
            pc.Clients.Add(client);
            pc.Lease = lease;
            pc.AmountFinanced = 0;

            pc.AmountFinanced += viewModel.Client.DepositAmount;

            _db.PurchaseCooperatives.Add(pc);
            _db.SaveChanges();

            return RedirectToAction("Index");

            //            return View(viewModel);
        }