public ActionResult Edit(ProductOfInterestManageModel model, SubmitType submit)
        {
            if (ModelState.IsValid)
            {
                var response = _productOfInterestService.SaveProductOfInterest(model);
                SetResponseMessage(response);
                if (response.Success)
                {
                    switch (submit)
                    {
                    case SubmitType.Save:
                        return(RedirectToAction("Index"));

                    default:
                        return(RedirectToAction("Edit", new { id = model.Id }));
                    }
                }
            }
            return(View(model));
        }
        /// <summary>
        /// Save product of interest
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResponseModel SaveProductOfInterest(ProductOfInterestManageModel model)
        {
            ResponseModel response;
            var           productOfInterest = GetById(model.Id);

            if (productOfInterest != null)
            {
                productOfInterest.Name        = model.Name;
                productOfInterest.TargetCount = model.TargetCount;
                productOfInterest.RecordOrder = model.RecordOrder;
                response = Update(productOfInterest);
                return(response.SetMessage(response.Success
                    ? T("ProductOfInterest_Message_UpdateSuccessfully")
                    : T("ProductOfInterest_Message_UpdateFailure")));
            }
            Mapper.CreateMap <ProductOfInterestManageModel, ProductOfInterest>();
            productOfInterest = Mapper.Map <ProductOfInterestManageModel, ProductOfInterest>(model);
            response          = Insert(productOfInterest);

            return(response.SetMessage(response.Success
                ? T("ProductOfInterest_Message_CreateSuccessfully")
                : T("ProductOfInterest_Message_CreateFailure")));
        }