Example #1
0
        /// <summary>
        /// Edit a single License
        /// </summary>
        /// <param name="key">Key of the license to edit</param>
        /// <returns>Edit License view</returns>
        public ActionResult Edit(Guid key)
        {
            using (var context = dataContextFactory.CreateByUser())
            {
                var licenseQuery = from x in context.Licenses where x.ObjectId == key select x;
                var skuQuery = from x in context.SKUs select x;
                var customerQuery = from x in context.Customers select x;

                LicenseEditViewModel viewModel = new LicenseEditViewModel(licenseQuery.FirstOrDefault(),
                    skuQuery.ToList(), customerQuery.ToList());

                viewModel.UseLocalReferrerAsRedirectUrl(Request);

                return View(viewModel);
            }
        }