/// <summary>
        /// Edit a Trailer Stock item
        /// </summary>
        /// <param name="stock">Stock item.</param>
        void EditStockItem(DriverStock stock)
        {
            var product = _repository.Products.First(x => x.ProductCode == stock.ProductCode);

            _stockItemDialog = StockItemDialog.NewTrailerStockInstance(product.ProductCode, stock.Id, OnStockItemDialogAction);
            _stockItemDialog.Show(FragmentManager, StockItemDialog.TAG);
        }
        /// <summary>
        /// Edit delivery docket item
        /// </summary>
        void EditDeliveryDocketItem(DeliveryDocketItem docketItem)
        {
            PersistOrderReference();

            var product = _repository.Products.First(x => x.ProductCode == docketItem.ProductCode);

            _stockItemDialog = StockItemDialog
                               .NewDeliveryItemInstance(product.ProductCode, docketItem.Id, OnUpdateDocketItem);

            _stockItemDialog.Show(FragmentManager, TAG);
        }
        public static StockItemDialog NewTrailerStockInstance(string productCode, string stockItemId,
                                                              Action <StockItemDialogAction, Product, string> action)
        {
            var fragment = new StockItemDialog {
                Arguments = new Bundle()
            };

            fragment.Arguments.PutString(BundleArguments.StockItemId, stockItemId);
            fragment.Arguments.PutString(BundleArguments.ProductCode, productCode);
            fragment.Arguments.PutInt(BundleArguments.Mode, (int)StockItemDialogMode.Trailer);
            fragment._action = action;
            return(fragment);
        }
        public static StockItemDialog NewDeliveryItemInstance(string productCode, string docketItemId,
                                                              Action <StockItemDialogAction, Product, string> action)
        {
            var fragment = new StockItemDialog {
                Arguments = new Bundle()
            };

            fragment.Arguments.PutString(BundleArguments.DocketItemId, docketItemId);
            fragment.Arguments.PutString(BundleArguments.ProductCode, productCode);
            fragment.Arguments.PutInt(BundleArguments.Mode, (int)StockItemDialogMode.Delivery);
            fragment._action = action;
            return(fragment);
        }