Exemplo n.º 1
0
 public bool Update(ProductComponent entity, string userLogin)
 {
     using (var connection = GetConnection())
     {
         try
         {
             connection.Execute(@"
              sp_UpdateProductComponent 
                             @Id=@Id,
                             @ProductId=@productId,
                             @ComponentId=@ComponentId,
                             @ColorId=@ColorId,
                             @Quantity=@Quantity,
                             @Price=@Price,
                             @ExtCharge=@ExtCharge
             ", entity);
             return(true);
         }
         catch (Exception e)
         {
             BWC.Core.Common.LogManager.LogError("Update component info in product: ", e);
             return(false);
         }
     }
 }
Exemplo n.º 2
0
        private void LoadProductsList()
        {
            ProductComponent productComp = new ProductComponent();

            _ProductsList = productComp.GetProducts();
            ProductsComboBox.ItemsSource = _ProductsList;
        }
Exemplo n.º 3
0
 public void SaveProductComponent(Sender sender, ProductComponent obj)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy(true))
         {
             if (op.LoadProductComponent(obj) == 0)
             {
                 obj.Created    = DateTime.Now;
                 obj.CreatedBy  = sender.UserCode + "." + sender.UserName;
                 obj.Modified   = DateTime.Now;
                 obj.ModifiedBy = sender.UserCode + "." + sender.UserName;
                 op.InsertProductComponent(obj);
             }
             else
             {
                 obj.Modified   = DateTime.Now;
                 obj.ModifiedBy = sender.UserCode + "." + sender.UserName;
                 op.UpdateProductComponentByComponentID(obj);
             }
             op.CommitTransaction();
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }
Exemplo n.º 4
0
        private async void GotoSwapProductComponent(ProductComponent productComponent)
        {
            Log.Verbose("Get compatible components of a product.");
            var progressDialog = ProgressDialog.Show(context, context.GetString(Resource.String.please_wait), context.GetString(Resource.String.loading_compatible_components), true);

            _api = new SwapComponentApi();
            string parameters = "/compatible?stockId=" + productComponent.StockId;
            ProductComponentsResponse swappableProductComponentsResponse = await _api.GetProductDetails(Uri.EscapeUriString(parameters),
                                                                                                        filterFlags : ErrorFilterFlags.AllowEmptyResponses);

            progressDialog.Hide();
            if (swappableProductComponentsResponse.Successful)
            {
                Log.Verbose("API Call successful");
                Intent intent = new Intent(context, typeof(SwappableComponentsActivity));
                //pass the product details
                Bundle extras = new Bundle();
                extras.PutString("product", JsonConvert.SerializeObject(_product));
                extras.PutString("productComponent", JsonConvert.SerializeObject(productComponent));
                extras.PutString("swappableProductComponentsResponse", JsonConvert.SerializeObject(swappableProductComponentsResponse));
                extras.PutString("productComponentsResponse", JsonConvert.SerializeObject(_productComponentsResponse));
                extras.PutString("customerDetailsResponse", JsonConvert.SerializeObject(_customerDetailsResponse));
                intent.PutExtras(extras);
                context.StartActivity(intent);
            }
            else
            {
                Log.Verbose("Something went wrong");
                if (swappableProductComponentsResponse.ResponseText.Equals("not_connected"))
                {
                    Toast.MakeText(context, context.GetString(Resource.String.not_connected), ToastLength.Long).Show();
                }
            }
        }
Exemplo n.º 5
0
        private string toJson(ProductComponent productComponent)
        {
            string result = string.Empty;

            dynamic record = new ExpandoObject();

            record.Code = productComponent.RecId.ToString();
            record.Name = productComponent.RecId.ToString();


            record.U_PRODUTO       = productComponent.produto;
            record.U_COMPONENTE    = productComponent.componente;
            record.U_COMPONENTE_AK = productComponent.componente_ak;
            record.U_PRODUTO_AK    = productComponent.produto_ak;
            record.U_QUANTIDADE    = productComponent.quantidade;
            record.U_SEC_SIM_1     = productComponent.sec_sim_1;
            record.U_SEC_SIM_2     = productComponent.sec_sim_2;
            record.U_SEC_SIM_3     = productComponent.sec_sim_3;
            record.U_GRP_SIM_1     = productComponent.grp_sim_1;
            record.U_GRP_SIM_2     = productComponent.grp_sim_2;
            record.U_GRP_SIM_3     = productComponent.grp_sim_3;
            record.U_SBG_SIM_1     = productComponent.sbg_sim_1;
            record.U_SBG_SIM_2     = productComponent.sbg_sim_2;
            record.U_SBG_SIM_3     = productComponent.sbg_sim_3;
            record.U_CTG_SIM_1     = productComponent.ctg_sim_1;
            record.U_CTG_SIM_2     = productComponent.ctg_sim_2;
            record.U_CTG_SIM_3     = productComponent.ctg_sim_3;
            record.U_FILLER        = productComponent.filler;
            record.U_LASTUPDATE    = productComponent.lastupdate;
            record.U_STATUS        = productComponent.status;

            result = JsonConvert.SerializeObject(record);

            return(result);
        }
Exemplo n.º 6
0
        public ProductComponent toRecord(dynamic record)
        {
            ProductComponent productVendor = new ProductComponent();

            productVendor.RecId         = Guid.Parse(record.Code);
            productVendor.produto       = record.U_PRODUTO;
            productVendor.componente    = record.U_COMPONENTE;
            productVendor.componente_ak = record.U_COMPONENTE_AK;
            productVendor.produto_ak    = record.U_PRODUTO_AK;
            productVendor.quantidade    = record.U_QUANTIDADE;
            productVendor.sec_sim_1     = record.U_SEC_SIM_1;
            productVendor.sec_sim_2     = record.U_SEC_SIM_2;
            productVendor.sec_sim_3     = record.U_SEC_SIM_3;
            productVendor.grp_sim_1     = record.U_GRP_SIM_1;
            productVendor.grp_sim_2     = record.U_GRP_SIM_2;
            productVendor.grp_sim_3     = record.U_GRP_SIM_3;
            productVendor.sbg_sim_1     = record.U_SBG_SIM_1;
            productVendor.sbg_sim_2     = record.U_SBG_SIM_2;
            productVendor.sbg_sim_3     = record.U_SBG_SIM_3;
            productVendor.ctg_sim_1     = record.U_CTG_SIM_1;
            productVendor.ctg_sim_2     = record.U_CTG_SIM_2;
            productVendor.ctg_sim_3     = record.U_CTG_SIM_3;
            productVendor.filler        = record.U_FILLER;
            productVendor.lastupdate    = parseDate(record.U_LASTUPDATE);
            productVendor.status        = (int)record.U_STATUS;

            return(productVendor);
        }
 public bool Insert(ProductComponent entity, string userLogin)
 {
     using (var connection = GetConnection())
     {
         try
         {
             connection.Execute(@"
             call sp_InsertProductComponent (
                             @productId,
                             @ComponentId,
                             @ColorId,
                             @Quantity,
                             @Price,
                             @ExtCharge
                         )
             ", entity);
             return(true);
         }
         catch (Exception e)
         {
             BWC.Core.Common.LogManager.LogError("Insert component into product: ", e);
             return(false);
         }
     }
 }
        //[Test, TestCaseSource(nameof(ProductSearch))]
        public void CheckSearch(Product expectedProduct, SearchCriteria searchCriteria, Currency currency)
        {
            // Steps
            SearchSuccessPage searchSuccessPage = LoadApplication()
                                                  .SearchSuccessfully(searchCriteria)
                                                  .ChooseCurrency(currency);
            ProductComponent actualPoductComponent = searchSuccessPage
                                                     .ProductsCriteria
                                                     .ProductsContainer
                                                     .GetProductComponentByName(expectedProduct.Title);

            //
            // Check
            Assert.IsTrue(actualPoductComponent
                          .GetPartialDescriptionText()
                          .Contains(expectedProduct.Description));
            Assert.IsTrue(actualPoductComponent
                          .GetPriceText()
                          .Contains(expectedProduct.GetPrice(currency)));
            //
            Thread.Sleep(5000); // For Presentation ONLY
            //
            // Continue Searching. Use SearchCriteria from SearchCriteriaPart
            //
            // Return to Previous State
            HomePage homePage = searchSuccessPage.GotoHomePage();

            //
            // Check (optional)
            Assert.IsTrue(homePage
                          .GetSlideshow0FirstImageAttributeSrcText()
                          .Contains(HomePage.IPHONE6));
            //
            Thread.Sleep(5000); // For Presentation ONLY
        }
Exemplo n.º 9
0
 public ProductController(ProductQueryComponent productQueryComponent,
                          ProductComponent productComponent,
                          JourneyQueryComponent journeyQueryComponent)
 {
     this._productQueryComponent = productQueryComponent;
     this._productComponent      = productComponent;
     this._journeyQueryComponent = journeyQueryComponent;
 }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            String connectionString = "Data Source=localhost;Initial Catalog=Products;Integrated Security=True;Encrypt=True;TrustServerCertificate=True";

            using (ProductComponent component = ProductComponentFactory.GetProductComponent(connectionString))
            {
                Product product = component.GetProduct(1);
            }
        }
Exemplo n.º 11
0
        public void AddToProduct()
        {
            ProductComponent product = new ProductComponent();

            Assert.AreEqual(true, product.AddProduct('A', 50));
            Assert.AreEqual(true, product.AddProduct('B', 30));
            Assert.AreEqual(true, product.AddProduct('C', 20));
            Assert.AreEqual(true, product.AddProduct('D', 15));
        }
Exemplo n.º 12
0
        public Product RemoveComponent(ProductComponent componentToDelete)
        {
            var product = componentToDelete.Product;

            _context.Components.Attach(componentToDelete);
            _context.Entry(componentToDelete).State = EntityState.Deleted;
            _context.SaveChanges();

            return(product);
        }
Exemplo n.º 13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Bundle extras = Intent.Extras;

            _product                   = JsonConvert.DeserializeObject <SwapProduct>(extras.GetString("product"));
            _productComponent          = JsonConvert.DeserializeObject <ProductComponent>(extras.GetString("productComponent"));
            _customerDetailsResponse   = JsonConvert.DeserializeObject <CustomerDetailsResponse>(extras.GetString("customerDetailsResponse"));
            _productComponentsResponse = JsonConvert.DeserializeObject <ProductComponentsResponse>(extras.GetString("productComponentsResponse"));
            InitializeScreen();
        }
Exemplo n.º 14
0
 // Initialize the dataset of the Adapter
 public SwappableComponentsAdapter(ProductComponentsResponse swappableProductComponentsResponse, Context context, ProductComponent selectedProductComponent,
                                   CustomerDetailsResponse customerDetailsResponse, SwapProduct product, ProductComponentsResponse productComponentsResponse)
 {
     _swappableProductComponentsResponse = swappableProductComponentsResponse;
     _swappableProductComponentsList     = swappableProductComponentsResponse.ProductComponents;
     _selectedProductComponent           = selectedProductComponent;
     _customerDetailsResponse            = customerDetailsResponse;
     _product = product;
     _productComponentsResponse         = productComponentsResponse;
     SwappableComponentsAdapter.context = context;
 }
Exemplo n.º 15
0
        private void ProductsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            _currentProduct = (WeighrDAL.Models.Product)ProductsComboBox.SelectedItem;

            ProductComponent productComp = new ProductComponent();

            _currentProduct = productComp.SetCurrentProduct(_currentProduct.ProductCode);
            productComp.SetCurrentProduct(_currentProduct.ProductCode);
            _normal_cutoff_weight  = (_currentProduct.TargetWeight) * Convert.ToDecimal(0.8);
            _final_setpoint_weight = _currentProduct.TargetWeight - Convert.ToDecimal(_currentProduct.Inflight);

            ProductNameTextBox.Text = _currentProduct.Name + " : " + _currentProduct.TargetWeight + " Kgs";
        }
        //[Test, TestCaseSource(nameof(ProductToAdd))]
        public void CheckAdding(Product addingProduct)
        {
            HomePage homePage = LoadApplication();

            homePage.GotoLoginPage().LoggingIn("*****@*****.**", "TESTER_PASWORD").GotoHomePage();
            ProductsContainerComponent productsContainerComponent = homePage.getProductComponentsContainer();
            ProductComponent           productComponent           = productsContainerComponent.GetProductComponentByName(addingProduct.Title);

            productComponent.ClickAddToWishButton();
            WishListPage wishListPage = homePage.GotoWishListPage();

            Assert.IsTrue(wishListPage.getWishListComponentsContainer().GetWishListComponentByName(addingProduct.Title)
                          .GetWishListComponentProductNameText().Contains(productComponent.Name.Text));
        }
Exemplo n.º 17
0
        async public Task <ProductComponent> Find(List <Criteria> criterias)
        {
            string recid = criterias[0].Value;
            string query = Global.BuildQuery($"U_VSITPRODUCT_COMP('{recid}')");

            string data = await _serviceLayerConnector.getQueryResult(query);

            ExpandoObject record = Global.parseQueryToObject(data);

            ProductComponent product = toRecord(record);


            return(product);
        }
Exemplo n.º 18
0
        public void GetCurrentProductDetails()
        {
            ProductComponent ProductComp = new ProductComponent();

            var product = ProductComp.GetCurrentProduct();

            _current_product_id      = product.ProductId;
            _current_product_code    = product.ProductCode;
            _current_product_density = product.Density;
            _curent_product_name     = product.Name;
            _current_target_weight   = product.TargetWeight;
            _current_upper_limit     = product.UpperLimit;
            _current_lower_limit     = product.LowerLimit;
        }
Exemplo n.º 19
0
        private void LoadProductByProductCode(string productCode)
        {
            ProductComponent productComp = new ProductComponent();

            _product = productComp.GetProduct(productCode);

            ProductCodeTextBox.Text      = _product.ProductCode;
            ProductNameTextBox.Text      = _product.Name;
            DensityTextBox.Text          = _product.Density.ToString();
            TargetWeightTextBox.Text     = _product.TargetWeight.ToString();
            UpperLimitTextBox.Text       = _product.UpperLimit.ToString();
            LowerLimitTextBox.Text       = _product.LowerLimit.ToString();
            DribblePointTextBox.Text     = _product.DribblePoint.ToString();
            ExpectedFillTimeTextBox.Text = _product.ExpectedFillTime.ToString();
        }
Exemplo n.º 20
0
        private void WriteProductComponent(XmlWriter writer, ProductComponent productComponent)
        {
            var productId = TaskWriter.Products.FindById(productComponent.IngredientId);

            if (string.IsNullOrEmpty(productId) ||
                productComponent.Quantity == null ||
                productComponent.Quantity.Value == null)
            {
                return;
            }

            writer.WriteStartElement("PLN");
            writer.WriteAttributeString("A", productId);
            writer.WriteAttributeString("B", productComponent.Quantity.Value.Value.ToString("F0", CultureInfo.InvariantCulture));
            writer.WriteEndElement();
        }
Exemplo n.º 21
0
        private Ingredient LoadProductRelation(XmlNode productRelationNode, ProductMix productMix)
        {
            var productId       = productRelationNode.GetXmlNodeValue("@A");
            var productQuantity = productRelationNode.GetXmlNodeValue("@B");

            if (string.IsNullOrEmpty(productId) || string.IsNullOrEmpty(productQuantity))
            {
                return(null);
            }

            long quantity;

            if (!long.TryParse(productQuantity, NumberStyles.Integer, CultureInfo.InvariantCulture, out quantity) ||
                quantity < 0)
            {
                return(null);
            }

            Product product;

            if (_taskDocument.Products.TryGetValue(productId, out product) == false)
            {
                return(null);
            }

            var unit         = _taskDocument.UnitsByItemId.FindById(productId);
            var numericValue = new NumericValue(unit.ToAdaptUnit(), unit.ConvertFromIsoUnit(quantity));

            var ingredient = new ActiveIngredient
            {
                Description = product.Description,
            };

            var productComponent = new ProductComponent
            {
                IngredientId = product.Id.ReferenceId,
                Quantity     = new NumericRepresentationValue(null, numericValue.UnitOfMeasure, numericValue)
            };

            if (productMix.ProductComponents == null)
            {
                productMix.ProductComponents = new List <ProductComponent>();
            }
            productMix.ProductComponents.Add(productComponent);

            return(ingredient);
        }
Exemplo n.º 22
0
        private void btnSaveProduct_Click(object sender, RoutedEventArgs e)
        {
            if (ValidateSaveProduct() == false)
            {
                return;
            }

            if (_product == null)
            {
                _product           = new WeighrDAL.Models.Product();
                _product.ProductId = 0;
            }

            _product.ProductCode      = ProductCodeTextBox.Text;
            _product.Name             = ProductNameTextBox.Text;
            _product.Density          = Decimal.Parse(DensityTextBox.Text);
            _product.TargetWeight     = Decimal.Parse(TargetWeightTextBox.Text);
            _product.UpperLimit       = Decimal.Parse(UpperLimitTextBox.Text);
            _product.LowerLimit       = Decimal.Parse(LowerLimitTextBox.Text);
            _product.Inflight         = 0;// Decimal.Parse(InflightTextBox.Text);
            _product.DribblePoint     = Decimal.Parse(DribblePointTextBox.Text);
            _product.ExpectedFillTime = decimal.Parse(ExpectedFillTimeTextBox.Text);

            ProductComponent productComp = new ProductComponent();

            var curProduct = productComp.GetCurrentProduct();

            if (curProduct == null)
            {
                _product.isCurrent = true;
            }


            if (_product.ProductId == 0)
            {
                productComp.AddProduct(_product);
            }
            else
            {
                productComp.UpdateProduct(_product);
            }

            ClearProduct();
            LoadProductsList();
            saveSuccessfullmessage();
        }
Exemplo n.º 23
0
 public List <ProductComponent> GetProductComponentByComponentID(Sender sender, Int32 ComponentID)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy())
         {
             ProductComponent obj = new ProductComponent();
             obj.ComponentID = ComponentID;
             return(op.LoadProductComponentByComponentID(obj));
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }
Exemplo n.º 24
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Bundle extras = Intent.Extras;

            _incomingProductComponent = JsonConvert.DeserializeObject <ProductComponent>(extras.GetString("incomingProductComponent"));
            _outgoingProductComponent = JsonConvert.DeserializeObject <ProductComponent>(extras.GetString("outgoingProductComponent"));
            _customerDetailsResponse  = JsonConvert.DeserializeObject <CustomerDetailsResponse>(extras.GetString("customerDetailsResponse"));
            reason   = extras.GetString("reason");
            _product = JsonConvert.DeserializeObject <SwapProduct>(extras.GetString("product"));
            _customerDetailsResponse   = JsonConvert.DeserializeObject <CustomerDetailsResponse>(extras.GetString("customerDetailsResponse"));
            _productComponentsResponse = JsonConvert.DeserializeObject <ProductComponentsResponse>(extras.GetString("productComponentsResponse"));

            _selectedProductComponent           = JsonConvert.DeserializeObject <ProductComponent>(extras.GetString("productComponent"));
            _swappableProductComponentsResponse = JsonConvert.DeserializeObject <ProductComponentsResponse>(extras.GetString("swappableProductComponentsResponse"));
            InitializeScreen();
        }
Exemplo n.º 25
0
        private List <ProductComponent> ImportProductComponents(ISOProduct isoProduct)
        {
            if (!isoProduct.ProductRelations.Any())
            {
                return(null);
            }
            var productComponents = new List <ProductComponent>();

            foreach (ISOProductRelation prn in isoProduct.ProductRelations)
            {
                //Find the product referenced by the relation
                ISOProduct isoComponent = ISOTaskData.ChildElements.OfType <ISOProduct>().FirstOrDefault(p => p.ProductId == prn.ProductIdRef);

                if (isoComponent != null) //Skip PRN if PRN@A doesn't resolve to a product
                {
                    //Find or create the product to match the component
                    Product adaptProduct = DataModel.Catalog.Products.FirstOrDefault(i => i.Id.FindIsoId() == isoComponent.ProductId);
                    if (adaptProduct == null)
                    {
                        adaptProduct = ImportProduct(isoComponent);
                        DataModel.Catalog.Products.Add(adaptProduct);
                    }

                    //Create a component for this ingredient
                    ProductComponent component = new ProductComponent()
                    {
                        IngredientId = adaptProduct.Id.ReferenceId,
                        IsProduct    = true,
                        IsCarrier    = adaptProduct.Category == CategoryEnum.Carrier
                    };

                    var quantityDDI = GetQuantityDDI(isoComponent.QuantityDDI, adaptProduct.Form);
                    if (!string.IsNullOrEmpty(quantityDDI))
                    {
                        component.Quantity = prn.QuantityValue.AsNumericRepresentationValue(quantityDDI, RepresentationMapper);
                    }
                    productComponents.Add(component);
                }
                else
                {
                    TaskDataMapper.AddError($"Product relation with quantity {prn.QuantityValue} ommitted for product {isoProduct.ProductId} due to no ProductIdRef");
                }
            }

            return(productComponents);
        }
Exemplo n.º 26
0
        private void PopulateModule(string moduleName)
        {
            //remove all control
            var pnlModule = this.Parent.Controls.Find("pnlModule", true).FirstOrDefault();

            foreach (Control item in pnlModule.Controls.OfType <Control>())
            {
                pnlModule.Controls.Remove(item);
            }

            string title = string.Empty;

            switch (moduleName)
            {
            case "Product":
                var productComponent = new ProductComponent();
                pnlModule.Controls.Add(productComponent);
                title = "All Products";
                break;

            case "Tax":
                var taxComponent = new TaxComponent();
                pnlModule.Controls.Add(taxComponent);
                break;

            case "Product Type":
                var productTypeComponent = new ProductTypeComponent();
                pnlModule.Controls.Add(productTypeComponent);
                break;

            case "Discount Code":
                var discountCodeComponent = new DiscountCodeComponent();
                pnlModule.Controls.Add(discountCodeComponent);
                break;

            default:
                break;
            }


            var lblTitle = (Label)Parent.Controls.Find("lblModuleTitle", true).FirstOrDefault();

            lblTitle.Text = string.IsNullOrEmpty(title) ? moduleName : title;
        }
Exemplo n.º 27
0
        private static void AreEqual(XmlNode prnNode, ProductComponent productComponent, XmlNodeList productNodes, Catalog catalog, Dictionary <string, List <UniqueId> > linkList)
        {
            var productNode = FindMatchingProductNode(prnNode.GetXmlAttribute("A"), productNodes);

            if (productNode == null)
            {
                return;
            }

            var quantityDdi = Int32.Parse(productNode.GetXmlAttribute("E"));
            var uom         = new RepresentationMapper().GetUnitForDdi(quantityDdi);

            Assert.AreEqual(uom, productComponent.Quantity.Value.UnitOfMeasure);
            Assert.AreEqual(prnNode.GetXmlAttribute("B"), productComponent.Quantity.Value.Value);

            var ingredient = catalog.Ingredients.Single(x => x.Id.ReferenceId == productComponent.IngredientId);

            Assert.AreEqual(productNode.GetXmlAttribute("B"), ingredient.Description);
        }
Exemplo n.º 28
0
 public ProductComponent GetProductComponent(Sender sender, Int32 ComponentID)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy())
         {
             ProductComponent obj = new ProductComponent();
             obj.ComponentID = ComponentID;
             if (op.LoadProductComponent(obj) == 0)
             {
                 return(null);
             }
             return(obj);
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }
Exemplo n.º 29
0
 public ProductComponent GetProductComponentByComponentTypeID(Sender sender, int ComponentTypeID, string ProductCode)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy())
         {
             ProductComponent obj = new ProductComponent();
             obj.ComponentTypeID = ComponentTypeID;
             obj.ProductCode     = ProductCode;
             if (op.LoadProductComponentByComponentTypeID(obj) == 0)
             {
                 return(null);
             }
             return(obj);
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }
Exemplo n.º 30
0
        private void GotoSwapProductComponent(ProductComponent productComponent)
        {
            Intent intent = new Intent(context, typeof(ReasonForSwapActivity));
            //pass the product details
            Bundle extras = new Bundle();

            extras.PutString("incomingProductComponent", JsonConvert.SerializeObject(_selectedProductComponent));
            extras.PutString("outgoingProductComponent", JsonConvert.SerializeObject(productComponent));
            extras.PutString("product", JsonConvert.SerializeObject(_product));
            extras.PutString("customerDetailsResponse", JsonConvert.SerializeObject(_customerDetailsResponse));
            extras.PutString("productComponentsResponse", JsonConvert.SerializeObject(_productComponentsResponse));
            extras.PutString("productComponent", JsonConvert.SerializeObject(_selectedProductComponent));
            extras.PutString("swappableProductComponentsResponse", JsonConvert.SerializeObject(_swappableProductComponentsResponse));
            //            extras.PutString("productComponentsResponse", JsonConvert.SerializeObject(productComponentsResponse));
            //            extras.PutInt("incomingStockId", _selectedProductComponent.StockId);
            //            extras.PutInt("outgoingStockId", productComponent.StockId);
            //            extras.PutString("incomingComponentName", productComponent.StockItem);
            //            extras.PutInt("incomingProductId", productComponent.ProductId);
            //            extras.PutString("incomingProductName", productComponent.Product);
            intent.PutExtras(extras);
            //start activity
            context.StartActivity(intent);
        }