public ActionResult Create() { // Copy over the possibly applicable data to the listing so the user doesn't have to type it twice if it's the same as the account info. ListingViewModelEdit listing = new ListingViewModelEdit(); //plamen: instead of copy get available account data and use AccountLogic accountLogic = new AccountLogic(); var accountVM = accountLogic.GetByEmail(User.Identity.Name); ClientCardInfoLogic ClientCardInfoLogic = new ClientCardInfoLogic(); if (accountVM != null) { var clientCardInfo = ClientCardInfoLogic.GetByClientGuid(accountVM.ClientGuid); if (null == clientCardInfo) return RedirectToAction("ClientCardInfo","Account"); listing = accountVM.FeedListing(); this.AddListingTypesToListing(listing); this.AddTypesOfCareToListing(listing); this.AddFacilityPhotoToListing(listing, true); } listing.SaveButtonText = listing.ActionName = "Create"; // If logged in, show the form. return View(listing); }
public ActionResult See() { AccountLogic accountLogic = new AccountLogic(); AccountViewModel accountVM = accountLogic.GetByEmail(User.Identity.Name); // If an account does not exist, help user create one. if (null == accountVM) { return RedirectToAction("Create", "Account"); } // If it does exist, show it. else { AccountWithListingsViewModel accountWithListings = accountVM.WithListings(); ListingLogic llogic = new ListingLogic(); var listings = llogic.GetListingsWithDateModifiedByClientGuid(accountWithListings.ClientGuid); accountWithListings.AccountListings = listings.ToList(); ClientCardInfoLogic ClientCardInfoLogic = new ClientCardInfoLogic(); var ccinfo= ClientCardInfoLogic.GetByClientGuid(accountWithListings.ClientGuid); ClientCardInfoViewModel clientCardInfoVM = new ClientCardInfoViewModel(); if (ccinfo != null) clientCardInfoVM = DecryptCCinfo(ccinfo); accountWithListings.clientCardInfoVM = clientCardInfoVM; return View(accountWithListings); } }
public ActionResult EditClientCardInfo(Guid ClientGuid) { ClientCardInfoLogic ClientCardInfoLogic = new ClientCardInfoLogic(); ClientCardInfo ccinfo = ClientCardInfoLogic.GetByClientGuid(ClientGuid); ClientCardInfoViewModel clientCardInfoVM = new ClientCardInfoViewModel(); if (ccinfo != null) clientCardInfoVM = DecryptCCinfo(ccinfo); ViewBag.cardType = GetCardTypes(); ViewBag.expiryMonth = GetExpiryMonths(); ViewBag.expiryYear = GetExpiryYears(); return View(clientCardInfoVM); }