private void SaveButton_Click(object sender, EventArgs e) { DateTime today = DateTime.Today; StockInItem inItem = new StockInItem(); inItem.ItemId = Convert.ToInt32(itemComboBox.SelectedValue); inItem.StockInQty = Convert.ToInt32(stockInTextBox.Text); inItem.StockInDate = today.ToString(); _stockInManager.Save(inItem); LoadStockItem(); }
public Boolean Save(StockInItem itemIn) { string query = @"INSERT INTO StockInItems(ItemId,StockInQty,StockInDate) values('" + itemIn.ItemId + "','" + itemIn.StockInQty + "','" + itemIn.StockInDate + "')"; SqlCommand sqlCommand = new SqlCommand(query, sqlConnection); sqlConnection.Open(); int isExecuted = sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); if (isExecuted > 0) { return(true); } else { return(false); } }
public Boolean Save(StockInItem inItem) { return(_stockInRepository.Save(inItem)); }