Exemple #1
0
        public ProductStoreForm()
        {
            InitializeComponent();
            IKernel kernel = BootStrapper.Initialize();

            _productStoreService          = kernel.GetService(typeof(ProductStoreService)) as ProductStoreService;
            _purchaseReceiveService       = kernel.GetService(typeof(PurchaseReceiveService)) as PurchaseReceiveService;
            _purchaseReceiveDetailService = kernel.GetService(typeof(PurchaseReceiveDetailService)) as PurchaseReceiveDetailService;
            _productUnitService           = kernel.GetService(typeof(ProductUnitService)) as ProductUnitService;
            _productSectionService        = kernel.GetService(typeof(ProductSectionService)) as ProductSectionService;

            _productStore = new ProductStoreModel();
        }
        public IActionResult UpdateProduct([FromBody] ProductStoreModel model)
        {
            Productstore productStore = new Productstore();

            productStore.Id_product = model.Id_product; productStore.Id_store = model.Id_store;
            productStore.Price      = model.Price; productStore.Availability = model.Availability;
            try
            {
                _storeService.UpdateProductStore(productStore);
            }
            catch (AppException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
            return(Ok());
        }
Exemple #3
0
        private void LoadFormWithData()
        {
            if (_productStoreList == null || _productStoreList.Count <= 0)
            {
                _isAddNewMode = true;
                ClearForm();
                //btnPurchaseReceiveDetails.Enabled = false;
                return;
            }

            btnPurchaseReceiveDetails.Enabled = true;
            _productStore = _productStoreList[_currentIndex];
            txtRemainToStoreEntry.Text = Convert.ToString(_purchaseReceiveDetail.ProductQuantity - _productStoreList.Sum(s => s.ProductQuantity));

            txtProductStoreId.Text = Convert.ToString(_productStore.Id);
            //cbxPurchaseReceiveDetail.SelectedValue = _productStore.PurchaseReceiveDetailId;
            //txtProductId.Text = Convert.ToString(_productStore.ProductId);
            txtSerial.Text = Convert.ToString(_productStore.Serial);
            cbxProductSection.SelectedValue = _productStore.ProductSectionId;
            cbxProductUnit.SelectedValue    = _productStore.ProductUnitId;
            txtProductQuantity.Text         = Convert.ToString(_productStore.ProductQuantity);
            txtProductSizeCode.Text         = _productStore.ProductSizeCode;
            txtProductSizeNumber.Text       = _productStore.ProductSizeNumber;
            txtProductSizeAge.Text          = _productStore.ProductSizeAge;
            txtProductColor.Text            = _productStore.ProductColor;
            txtProductStyle.Text            = _productStore.ProductStyle;
            chkIsActive.Checked             = _productStore.IsActive;
            txtDescription.Text             = _productStore.Description;

            //txtProductName.Text = _productStore.ProductName;
            //txtProductCategory.Text = _productStore.ProductCategoryName;
            //txtSupplier.Text = _productStore.ProductSupplierName;

            dgvProductList.Rows[_currentIndex].Selected = true;
            dgvProductList.CurrentCell = dgvProductList.Rows[_currentIndex].Cells[0];
            _isChanged    = false;
            _isAddNewMode = false;
        }