/// <summary>
        /// Add a new Product Caregory
        /// </summary>
        /// <returns></returns>
        public ActionResult Add(int Id)
        {
            ViewBag.ProductTypeFilter = EnumHelper.ProductTypeToEnum(Id);

            var newRecord = new ProductCategoryDto
                                {
                                    ProductType = ViewBag.ProductTypeFilter.ToString()
                                };

            ViewBag.FormMode = "Add";
            return View("Edit", newRecord);
        }
        public ActionResult Add(ProductCategoryDto newProductCategory)
        {
            try
            {
                _productService.InsertCategory(newProductCategory);

                return RedirectToAction("List", new { Id = EnumHelper.EnumTextToInt(newProductCategory.ProductType, typeof(Enums.ProductType)) });
            }
            catch
            {
                ViewBag.ProductTypeFilter = EnumHelper.ProductTypeToEnum(newProductCategory.ProductType);
                ViewBag.FormMode = "Add";
                return View("Edit");
            }
        }
        public void UpdateCategory(ProductCategoryDto editedItem)
        {
            //Begin DB transaction
            _productDb.BeginTransaction();

            try
            {
                //Get record
                _productDb.UpdateCategory(Mapper.Map<ProductCategoryDto, ProductCategoryDomain>(editedItem));
                _productDb.CompleteTransaction();
                Logger.Info(String.Format("Product Category #{0} Updated Successfully", editedItem.Id));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                _productDb.AbortTransaction();
                throw;
            }
        }
        public ActionResult Edit(int id, ProductCategoryDto editedProductCategory)
        {
            try
            {
                _productService.UpdateCategory(editedProductCategory);

                return RedirectToAction("List", new { Id = EnumHelper.EnumTextToInt(editedProductCategory.ProductType, typeof(Enums.ProductType)) });
            }
            catch
            {
                ViewBag.ProductTypeFilter = EnumHelper.ProductTypeToEnum(editedProductCategory.ProductType);
                ViewBag.FormMode = "Edit";
                return View();
            }
        }
        public void InsertCategory(ProductCategoryDto newRecord)
        {
            //Begin DB transaction
            _productDb.BeginTransaction();

            try
            {
                //Insert record
                _productDb.InsertCategory(Mapper.Map<ProductCategoryDto, ProductCategoryDomain>(newRecord));
                _productDb.CompleteTransaction();

                Logger.Info(String.Format("Product Category '{0}' Inserted Successfully", newRecord.Name));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                _productDb.AbortTransaction();
                throw;
            }
        }