Beispiel #1
0
        EcommerceProductAction generateCheckoutProductAction(ActionData actionData, ProductActions productAction)
        {
            var pAction = new EcommerceProductAction().SetAction(productAction.ToString());

            if (actionData != null)
            {
                if (string.IsNullOrEmpty(actionData?.Id) &&
                    (productAction == ProductActions.purchase ||
                     productAction == ProductActions.refund))
                {
                    return(pAction);
                }
                else if (!string.IsNullOrEmpty(actionData?.Id))
                {
                    pAction.SetTransactionId(actionData.Id);
                }

                if (!string.IsNullOrEmpty(actionData?.Affiliation))
                {
                    pAction.SetAffiliation(actionData.Affiliation);
                }

                if (actionData?.Revenue != 0)
                {
                    pAction.SetRevenue(new NSNumber(actionData.Revenue));
                }

                if (actionData?.Tax != 0)
                {
                    pAction.SetTax(new NSNumber(actionData.Tax));
                }

                if (actionData?.Shipping != 0)
                {
                    pAction.SetShipping(new NSNumber(actionData.Shipping));
                }

                if (!string.IsNullOrEmpty(actionData?.Coupon))
                {
                    pAction.SetCouponCode(actionData.Coupon);
                }

                if (!string.IsNullOrEmpty(actionData?.List))
                {
                    pAction.SetProductActionList(actionData.List);
                }

                if (actionData?.Step != 0)
                {
                    pAction.SetCheckoutStep(new NSNumber(actionData.Step));
                }

                if (!string.IsNullOrEmpty(actionData?.Option))
                {
                    pAction.SetCheckoutOption(actionData.Option);
                }
            }

            return(pAction);
        }
Beispiel #2
0
        public void TrackScreen(
            string screenName,
            string campaignUrl,
            List <ProductData> products,
            ProductActions productAction,
            ActionData actionData,
            PromotionData promotion,
            List <CustomDimension> customDimensions,
            List <CustomMetric> customMetrics
            )
        {
            analyticsTracker.Set(GaiConstants.ScreenName, screenName);

            var builder = DictionaryBuilder.CreateScreenView();

            if (customDimensions?.Count > 0)
            {
                foreach (var customDimension in customDimensions)
                {
                    builder.Set(customDimension.DimensionValue, Fields.CustomDimension((nuint)customDimension.DimensionIndex));
                }
            }

            if (customMetrics?.Count > 0)
            {
                foreach (var customMetric in customMetrics)
                {
                    builder.Set(Convert.ToString(customMetric.MetricValue), Fields.CustomMetric((nuint)customMetric.MetricIndex));
                }
            }

            if (promotion != null)
            {
                builder.AddPromotion(generatePromotion(promotion));
            }

            if (products != null)
            {
                foreach (var p in products)
                {
                    var product = mapper.mapProduct(p);
                    switch (productAction)
                    {
                    case ProductActions.none:
                        builder.AddProductImpression(product, screenName, "App");
                        break;

                    default:
                        builder.SetProductAction(generateCheckoutProductAction(actionData, productAction));
                        builder.AddProduct(product);
                        break;
                    }
                }
            }
            analyticsTracker.Send(builder.Build());
        }
Beispiel #3
0
    private void ManageProduct(ProductActions action, GameEntity product)
    {
        var time = DateTime.Now;

        //Companies.Log(product, "Actions." + action.ToString());
        switch (action)
        {
        case ProductActions.Features:
            ManageFeatures(product);
            MeasureTag("* Features", time);

            break;

        case ProductActions.ReleaseApp:
            ReleaseProduct(product);
            MeasureTag("* Release", time);

            break;

        case ProductActions.Monetise:
            Monetize(product);
            MeasureTag("* Monetize", time);

            break;

        case ProductActions.GrabUsers:
            ManageChannels(product);
            MeasureTag("* Channels", time);

            break;

        case ProductActions.HandleTeam:
            HandleTeam(product);
            MeasureTag("* Teams", time);

            break;

        case ProductActions.RestoreLoyalty:
            DeMonetize(product);
            MeasureTag("* Restore loyalty", time);

            break;

        default:
            var lg = Visuals.Negative("UNKNOWN ACTION in ProductDevelopmentSystem: " + action);
            Companies.Log(product, lg);

            MeasureTag("* <B>DEFAULT PRODUCT ACTION</B>", time);

            Debug.LogError(lg);

            break;
        }
    }
        private void InitializeActions()
        {
            AccountControllerTest accountTest = new AccountControllerTest();

            productActions = new ProductActions();
            AutorizationCheck(AutorizationType);
            if (AutorizationType == AutorizationType.Authorize)
            {
                productActions.CreateHeaders(AutorizationType, LoginResult);
            }
        }
        public void Initialize()
        {
            _productRepository = new Mock <IGenericRepository <Product> >();
            var rolesRepository = new Mock <IGenericRepository <Role> >();
            var userRepository  = new Mock <IGenericRepository <User> >();
            var context         = new Mock <DataContext>();

            _unitOfWork = new Mock <UnitOfWork>(context.Object, _productRepository.Object, rolesRepository.Object, userRepository.Object);

            _service = new ProductActions(_unitOfWork.Object);
        }
Beispiel #6
0
        public RestaurantViewModel()
        {
            produsActions  = new ProductActions();
            comandaActions = new ComandaActions();

            Paste                  = new ObservableCollection <Produs>();
            Bauturi                = new ObservableCollection <Produs>();
            Desert                 = new ObservableCollection <Produs>();
            Cos                    = new ObservableCollection <Produs>();
            StergeTotCommand       = new RelayCommand(StergeTotDinCos);
            PlaseazaComandaCommand = new RelayCommand(PlaseazaComanda);
        }
        public void ShoulbBePossibleToAddAndRemoveItemFromBasket()
        {
            const string searchValue = "Sewing Machine";

            ProductActions product = new ProductActions(_driver);

            product.GoToMainPageAndAcceptCookies();
            product.SearchForItemAndGoToItemPage(searchValue);
            product.AddProductAndGoToBasket("2");

            BasketActions basket = new BasketActions(_driver);

            basket.RemoveItemFromBasketAndClearCookies(searchValue);
        }
Beispiel #8
0
        private void PersistData()
        {
            var wasProductAdded = new ProductActions().AddProduct(AddProductName.Text, AddProductDescription.Text,
                                                                  AddProductPrice.Text, DropDownAddCategory.SelectedValue, ProductImage.FileName);

            if (wasProductAdded)
            {
                RefreshPage("?ProductAction=add");
            }
            else
            {
                LabelAddStatus.Text = "File type not accepted";
            }
        }
Beispiel #9
0
        public async Task <IActionResult> GetProductActions(Guid id)
        {
            var actions = await ProductService.GetProductActionsAsync(id);

            if (actions == null)
            {
                return(NotFound());
            }

            var productActions = new ProductActions
            {
                Id      = id,
                Actions = actions
            };

            return(Ok(productActions));
        }
 public PreparateViewModel(string categorie, Cont user)
 {
     pAct = new ProductActions();
     categorieDeAfisat = categorie;
     if (user != null)
     {
         if (user.statut == "Angajat")
         {
             Visibility = "Visible";
         }
         else
         {
             Visibility = "Hidden";
         }
         User = user;
     }
     else
     {
         Visibility = "Hidden";
     }
     //PreparateList = new ObservableCollection<Preparat>();
 }
Beispiel #11
0
        // DELETE: api/Product/5
        public void Delete(int id)
        {
            ProductActions p1 = new ProductActions();

            p1.DeleteProductByID(id);
        }
Beispiel #12
0
        public void Put(int id, [FromBody] MProduct value)
        {
            ProductActions p1 = new ProductActions();

            p1.ChangeProduct(value);
        }
Beispiel #13
0
        public void Post([FromBody] MProduct mProduct)
        {
            ProductActions p1 = new ProductActions();

            p1.AddProduct(mProduct);
        }
Beispiel #14
0
        // GET: api/Product/5
        public MProduct Get(int id)
        {
            ProductActions p1 = new ProductActions();

            return(p1.GetProductById(id));
        }
Beispiel #15
0
        // GET: api/Product
        public IEnumerable <MProduct> Get()
        {
            ProductActions p1 = new ProductActions();

            return(p1.GetProducts());
        }
        private void lookUpEditActionButtons_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                var action  = (sender as LookUpEdit).EditValue.ToString();
                var product = this.gridViewSearchResults.GetRow(this.gridViewSearchResults.FocusedRowHandle) as ProductViewDto;

                switch (action)
                {
                case "Buy":
                    using (var form = new CustomerBuyingConfirmation())
                    {
                        form.Text    = Properties.Resources.Title_BuyProduct;
                        form.Product = product;
                        form.ShowDialog();
                    }
                    break;

                case "Complain":
                    using (var form1 = new ProductActions())
                    {
                        form1.Text    = Properties.Resources.Title_ProductComplaint;
                        form1.Action  = ProductStatus.Complained;
                        form1.Product = product;
                        form1.ShowDialog();
                    }
                    break;

                case "Return":
                    using (var form1 = new ProductActions())
                    {
                        form1.Text    = Properties.Resources.Title_ProductReturn;
                        form1.Action  = ProductStatus.Returned;
                        form1.Product = product;
                        form1.ShowDialog();
                    }
                    break;

                case "Replace":
                    using (var form1 = new ProductActions())
                    {
                        form1.Text    = Properties.Resources.Title_ProductReplacement;
                        form1.Action  = ProductStatus.Replaced;
                        form1.Product = product;
                        form1.ShowDialog();
                    }
                    break;

                case "Request":
                    using (var form1 = new ProductActions())
                    {
                        form1.Text    = Properties.Resources.Title_ProductRequest;
                        form1.Action  = ProductStatus.Requested;
                        form1.Product = product;
                        form1.ShowDialog();
                    }
                    break;

                case "Order":
                    using (var form1 = new ProductActions())
                    {
                        form1.Text    = Properties.Resources.Title_ProductOrdering;
                        form1.Action  = ProductStatus.Ordered;
                        form1.Product = product;
                        form1.ShowDialog();
                    }
                    break;
                }

                //this.Refresh();
                this.gridControlProductSearchResult.RefreshDataSource();
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #17
0
 public async Task <int> AddProducts([FromBody] Product product)
 {
     return(await ProductActions.AddProduct(_context, product));
 }
Beispiel #18
0
 public async Task <ItemsPage <Product> > GetProducts(int pageSize, int page)
 {
     return(await ProductActions.GetProductsAsync(_context, pageSize, page));
 }
 public PreparateViewModel()
 {
     pAct = new ProductActions();
 }
        public void TrackScreen(
            string screenName,
            string campaignUrl,
            List <ProductData> products,
            ProductActions productAction,
            ActionData actionData,
            PromotionData promotion,
            List <CustomDimension> customDimensions,
            List <CustomMetric> customMetrics
            )
        {
            analyticsTracker.SetScreenName(screenName);

            var builder = new HitBuilders.ScreenViewBuilder();

            if (customDimensions?.Count > 0)
            {
                foreach (var customDimension in customDimensions)
                {
                    builder.SetCustomDimension(customDimension.DimensionIndex, customDimension.DimensionValue);
                }
            }

            if (customMetrics?.Count > 0)
            {
                foreach (var customMetric in customMetrics)
                {
                    builder.SetCustomMetric(customMetric.MetricIndex, customMetric.MetricValue);
                }
            }

            if (!string.IsNullOrWhiteSpace(campaignUrl))
            {
                builder.SetCampaignParamsFromUrl(campaignUrl);
            }

            if (promotion != null)
            {
                builder.AddPromotion(generatePromotion(promotion));
            }

            if (products != null)
            {
                foreach (var p in products)
                {
                    var product = mapper.mapProduct(p);
                    switch (productAction)
                    {
                    case ProductActions.none:
                        builder.AddImpression(product, screenName);
                        break;

                    default:
                        builder.SetProductAction(generateCheckoutProductAction(actionData, productAction));
                        builder.AddProduct(product);
                        break;
                    }
                }
            }
            analyticsTracker.Send(builder.Build());
        }