private void btnUpdate_Click(object sender, EventArgs e) { if (IsNameEmpty()) { return; } int stockInId = EditStockInId; string name = txtBatch.Text.Trim(); int count = Convert.ToInt32(txtCount.Text.Trim()); int productId = Convert.ToInt32(txtProductId.Text.Trim()); decimal subtotal = Convert.ToDecimal(txtSubtotal.Text.Trim()); int userId = UserLogined.UserId; DateTime inStockTime = dtpInStockTime.Value; StockIn stockIn = new StockIn() { StockInId = stockInId, Batch = name, Count = count, ProductId = productId, Subtotal = subtotal, UserId = userId, InStockTime = inStockTime, }; StockInService.UpdateInventoryByInventory(stockIn); BindData(); ResetUIInputtdData(); }