public async Task<ActionResult> ListingTypeUpdate(ListingType model)
        {
            var isNew = false;

            if (model.ID == 0)
            {
                model.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added;

                isNew = true;
                _ListingTypeService.Insert(model);
            }
            else
            {
                var listingTypeExisting = await _ListingTypeService.FindAsync(model.ID);

                listingTypeExisting.Name = model.Name;
                listingTypeExisting.ButtonLabel = model.ButtonLabel;
                listingTypeExisting.PriceUnitLabel = model.PriceUnitLabel;
                listingTypeExisting.ShippingEnabled = model.ShippingEnabled;

                listingTypeExisting.PaymentEnabled = model.PaymentEnabled;
                if (model.PaymentEnabled)
                {
                    listingTypeExisting.OrderTypeID = model.OrderTypeID;
                    listingTypeExisting.OrderTypeLabel = model.OrderTypeLabel;
                }

                listingTypeExisting.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Modified;

                _ListingTypeService.Update(listingTypeExisting);
            }

            await _unitOfWorkAsync.SaveChangesAsync();

            // Add item type to each category
            if (isNew)
            {
                foreach (var category in CacheHelper.Categories)
                {
                    _categoryListingTypeService.Insert(new CategoryListingType()
                    {
                        CategoryID = category.ID,
                        ListingTypeID = model.ID,
                        ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added
                    });
                }
                await _unitOfWorkAsync.SaveChangesAsync();
            }

            _dataCacheService.RemoveCachedItem(CacheKeys.ListingTypes);

            return RedirectToAction("ListingTypes");
        }
        public async Task<ActionResult> ListingTypeUpdate(int? id)
        {
            ListingType ListingType = new ListingType();

            if (id.HasValue)
            {
                ListingType = await _ListingTypeService.FindAsync(id);

                if (ListingType == null)
                    return new HttpNotFoundResult();
            }

            return View(ListingType);
        }