Esempio n. 1
0
        public string UpdateProductSEO(ProductDTO updateProductDTO)
        {
            var currentUser = ClaimsPrincipal.Current.Identity.Name;

            Enums.UpdateStatus status = Enums.UpdateStatus.Failure;

            try
            {
                if (updateProductDTO.ProductId > 0)
                {
                    var updateProduct = _unitOfWork.ProductRepository.UpdateProductSeo(updateProductDTO);
                    if (updateProduct != null)
                    {
                        _unitOfWork.UpdateAndSave(updateProduct);
                    }
                    status = Enums.UpdateStatus.Success;
                }
            }
            catch
            {
                status = Enums.UpdateStatus.Error;
            }
            return(status.ToString());
        }
Esempio n. 2
0
        public string IncludeProducts(RetailerAddProductDTO retailerProduct)
        {
            var currentUser = ClaimsPrincipal.Current.Identity.Name;

            Enums.UpdateStatus status = Enums.UpdateStatus.Failure;
            if (retailerProduct.BranchIdList == null || retailerProduct.BranchIdList.Count <= 0)
            {
                retailerProduct.BranchIdList = GetBranchIdListFromStore(retailerProduct.StoreId);
            }
            try
            {
                foreach (var branch in retailerProduct.BranchIdList)
                {
                    //For now We beleive if one branch is updated and sucess it is fine. anyway last branch value persist.
                    status = _unitOfWork.PricingRepository.IncludeProduct(retailerProduct, branch, currentUser);
                }
                _unitOfWork.Commit();
            }
            catch
            {
                status = Enums.UpdateStatus.Error;
            }
            return(status.ToString());
        }