Exemplo n.º 1
0
 internal void FillProducts(Schemas.Product.ProductInfo entity)
 {
     ProductDescriptionLabel.Text = entity.Name;
     //PorductImageView.Image = FromUrl(entity.Image);
     ProductPriceLabel.Text        = "$3333.33";
     ProductQuantityTextField.Text = "1";
 }
Exemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.basket, container, false);
            var  productsRecycleView = view.FindViewById <RecyclerView>(Resource.Id.ProductsRecyclerView);

            productsRecycleView.AddItemDecoration(new DividerItemDecoration(this.Context, DividerItemDecoration.Vertical));

            rows = new List <Schemas.Product.ProductInfo>();
            var product = new Schemas.Product.ProductInfo();

            product.Id   = 1;
            product.Name = "CONTPAQI® XML EN LÍNEA +, MULTIEMPRESA, LICENCIA ANUAL 100 USUARIO(S) - PAQUETE(PLXLMUL)";
            rows.Add(product);
            var product1 = new Schemas.Product.ProductInfo();

            product1.Id   = 2;
            product1.Name = "CONTPAQI® BANCOS, MULTIEMPRESA, LICENCIA ANUAL 3 USUARIO(S) - RENOVACIÓN(ALBANLA)";
            rows.Add(product1);

            GridLayoutManager manager = new GridLayoutManager(this.Context, 1);

            productsRecycleView.SetLayoutManager(manager);

            mAdapter = new BasketAdapter(rows);
            productsRecycleView.SetAdapter(mAdapter);
            HasOptionsMenu = false;
            return(view);
        }
Exemplo n.º 3
0
        void ButtonInCellClicked(object sender, Schemas.Product.ProductInfo e)
        {
            ProductsDetailController controllerProducts = this.Storyboard.InstantiateViewController("ProductsDetailController") as ProductsDetailController;

            controllerProducts.ProductID = e.Id;
            controllerProducts.Title     = e.Name.ToUpper();
            this.NavigationController.PushViewController(controllerProducts, true);
        }
        void OnCellSpeakButtonTapped(object sender, Schemas.Product.ProductInfo e)
        {
            // This is the event handler for the AnimalTableViewCell's SpeakButtonTapped event.
            // In this handler, we will invoke the AnimalTableViewSource's SpeakButtonTapped event causing it to "bubble up" into the view controller.

            if (ProductButtonTapped != null)
            {
                ProductButtonTapped(sender, e);
            }
        }
Exemplo n.º 5
0
        public Schemas.Product.ProductInfo ExistFavoriteProduct(ProductInfo entity)
        {
            Schemas.Product.ProductInfo resultProduct = new Schemas.Product.ProductInfo();

            using (var db = new LiteDatabase(AppRuntime.LiteDbConnectionString))
            {
                var data = db.GetCollection <Schemas.Product.ProductInfo>("ProductInfo");
                resultProduct = data.Find(Query.EQ("_id", entity.Id)).FirstOrDefault();
            }
            return(resultProduct);
        }
        internal void UpdateCell(Schemas.Product.ProductInfo entity)
        {
            lblProductName.Text = entity.Name;
            ProductImage.Image  = FromUrl(entity.Image);

            // Verificamos si el producto existe
            var favoriteProduct = AppRuntime.MarketliteDB.ExistFavoriteProduct(entity);

            if (favoriteProduct != null)
            {
                btnfavoritelist.ImageView.Image     = btnfavoritelist.ImageView.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                btnfavoritelist.ImageView.TintColor = UIColor.Red;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            rows = new List <Schemas.Product.ProductInfo>();
            var product = new Schemas.Product.ProductInfo();

            product.Id   = 1;
            product.Name = "CONTPAQI® XML EN LÍNEA +, MULTIEMPRESA, LICENCIA ANUAL 100 USUARIO(S) - PAQUETE(PLXLMUL)";
            rows.Add(product);
            var product1 = new Schemas.Product.ProductInfo();

            product1.Id   = 2;
            product1.Name = "CONTPAQI® BANCOS, MULTIEMPRESA, LICENCIA ANUAL 3 USUARIO(S) - RENOVACIÓN(ALBANLA)";
            rows.Add(product1);
            BasketSource TableSource = new BasketSource(rows, this);

            BasketTableView.Source    = TableSource;
            BasketTableView.RowHeight = 176f;
            BasketTableView.ReloadData();
            BasketTableView.TableFooterView = new UIView();

            CheckoutButton.Layer.CornerRadius = 8;
        }
 internal void FillProducts(Schemas.Product.ProductInfo entity, NSIndexPath indexPath)
 {
     ProductName.Text        = entity.Name;
     ProductDescription.Text = entity.FullDescription;
     ProductImage.Image      = MarketHelper.FromUrl(entity.Image);
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            btnBeneficios.TouchUpInside += (sender, e) => {
                AlertView("Beneficios y caracteristicas", Product.BenefitsCharacteristics);
            };

            HaveLicenceButton.Layer.BorderColor  = UIColor.LightGray.CGColor;
            HaveLicenceButton.Layer.BorderWidth  = 2.0f;
            HaveLicenceButton.Layer.CornerRadius = 8;

            NoHaveLicenceButton.Layer.BorderColor  = UIColor.LightGray.CGColor;
            NoHaveLicenceButton.Layer.BorderWidth  = 2.0f;
            NoHaveLicenceButton.Layer.CornerRadius = 8;

            VerifyButton.Layer.BorderColor  = UIColor.LightGray.CGColor;
            VerifyButton.Layer.BorderWidth  = 2.0f;
            VerifyButton.Layer.CornerRadius = 8;

            AddToCarButton.Layer.CornerRadius = 8;
            CotizarButton.Layer.CornerRadius  = 8;

            NumberUsersTextField.Text    = "1";
            NumberProductsTextField.Text = "1";

            NumberUsersTextField.AddTarget(ValueNoUserChanged, UIControlEvent.EditingChanged);
            NumberProductsTextField.AddTarget(ValueNoProductsChanged, UIControlEvent.EditingChanged);

            btnProductInfo.TouchUpInside += (sender, e) => {
                UIApplication.SharedApplication.OpenUrl(new NSUrl(Product.ProductInfoUrl));
            };

            // Cuando se hace click en el corazon
            // Guardamos localmente el producto en liteDB
            btnFavorite.Clicked += (sender, e) => {
                // Verificamos si el producto existe
                var favoriteProduct = AppRuntime.MarketliteDB.ExistFavoriteProduct(Product);

                if (favoriteProduct == null)
                {
                    // Insertamos en liteDB los resultados
                    var resultInsert = AppRuntime.MarketliteDB.FavoriteProduct(Product);
                    if (resultInsert.IsSucess)
                    {
                        btnFavorite.TintColor = UIColor.Red;
                        string AlertMessage = string.Format("Se ha agregado el producto {0} a tus favoritos.", Product.Name);
                        AlertView("Favoritos", AlertMessage);
                    }
                }
                else
                {
                    // Insertamos en liteDB los resultados
                    var resultDelete = AppRuntime.MarketliteDB.DeleteFavoriteProduct(Product);
                    if (resultDelete.IsSucess)
                    {
                        btnFavorite.TintColor = null;
                        string AlertMessage = string.Format("Se ha eliminado el producto {0} de tus favoritos.", Product.Name);
                        AlertView("Favoritos", AlertMessage);
                    }
                }
            };


            var result = AppRuntime.MarketData.getProdyctById(ProductID);

            if (result.ServiceResponseStatus.IsSuccess)
            {
                Product = result.Product;

                imgProductDetail.Image     = MarketHelper.FromUrl(Product.Image);
                lblProductNameDetail.Text  = Product.Name;
                lblProductDescription.Text = Product.FullDescription;

                // Revisamos si esta marcado como favorito
                // y lo pintamos de rojo
                // Verificamos si el producto existe
                var favoriteProduct = AppRuntime.MarketliteDB.ExistFavoriteProduct(Product);
                if (favoriteProduct == null)
                {
                    btnFavorite.TintColor = null;
                }
                else
                {
                    btnFavorite.TintColor = UIColor.Red;
                }

                // Cargamos la informacion para poder realizar la cotizacion
                LoadQuotation(result.Product.ProductQuotation);
            }


            CotizarButton.TouchUpInside += (sender, e) => {
                calculateQuotation();
            };
        }
Exemplo n.º 10
0
 public void SetProduct(Schemas.Product.ProductInfo entity)
 {
     this.CurrentProduct = entity;
 }