Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
        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");
        }