public ActionResult EditClientCardInfo(ClientCardInfoViewModel clientCardInfoVM)
        {
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Please correct the errors and try again.");
                return View(clientCardInfoVM);
            }

            var user = Membership.GetUser();
            if (user == null)
            {
                return RedirectToAction("Create");
            }

            ClientLogic clientLogic = new ClientLogic();
            Client possibleClient = clientLogic.GetClientByEmail(user.UserName);

            if (null == possibleClient)
            {
                return RedirectToAction("Create");
            }
            clientCardInfoVM.ClientGuid = possibleClient.ClientGuid;
            this.SaveClientCardInfo(clientCardInfoVM, false);
            return RedirectToAction("see");
        }
        public ActionResult Create(AccountViewModel account)
        {
            // todo: implement some create account wizard when have more information
            if (!ModelState.IsValid)
            {
                return View(account);
            }

            // If logged in, show the appropriate view.
            var user = Membership.GetUser();
            if (user == null)
            {
                return RedirectToAction("Create");
            }

            ClientLogic clientLogic = new ClientLogic();
            // UserName is the email address they signed in with.
            Client possibleClient = clientLogic.GetClientByEmail(user.UserName);

            // If an account already exists for the user, show them the See page.
            if (null != possibleClient)
            {
                return RedirectToAction("See");
            }

            this.SaveAccount(clientLogic, account, user, true);
            return RedirectToAction("See");
        }
        public ActionResult Edit(AccountViewModel account)
        {
            if (!ModelState.IsValid)
            {
                return View(account);
            }

            // Call business logic to insert the data.
            ClientLogic clientLogic = new ClientLogic();
            Client possibleClient = clientLogic.GetClientByEmail(account.Email);

            if (null == possibleClient)
            {
                return RedirectToAction("See");
            }

            this.SaveAccount(clientLogic, account, Membership.GetUser(), false);
            return RedirectToAction("See");
        }
        public ActionResult ClientCardInfo(ClientCardInfoViewModel clientCardInfoVM)
        {
            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Please correct the errors and try again.");
                return View(clientCardInfoVM);
            }

            var user = Membership.GetUser();
            if (user == null)
                return RedirectToAction("Create");

            ClientLogic clientLogic = new ClientLogic();
            // UserName is the email address they signed in with.
            Client possibleClient = clientLogic.GetClientByEmail(user.UserName);

            // If an account already exists for the user, show them the See page.
            if (null == possibleClient)
                return RedirectToAction("Create");
            clientCardInfoVM.ClientGuid = possibleClient.ClientGuid;
            this.SaveClientCardInfo(clientCardInfoVM, true);
            return RedirectToAction("See");
        }