示例#1
0
        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();
        }
示例#2
0
        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);
            }
        }
示例#3
0
 public Boolean Save(StockInItem inItem)
 {
     return(_stockInRepository.Save(inItem));
 }