//public DataTable ShowItems(Item item) //{ // sqlConnection = new SqlConnection(connectionString); // commandString = @"SELECT * FROM StocksInView WHERE Item ='" + item.Name + "'"; // sqlCommand = new SqlCommand(commandString, sqlConnection); // sqlConnection.Open(); // SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand); // DataTable dataTable = new DataTable(); // //CreateSerialColumn(); // dataAdapter.Fill(dataTable); // sqlConnection.Close(); // return dataTable; //} public int insertIntoStockOut(StockOUT stockOUT) { sqlConnection = new SqlConnection(connectionString); commandString = @"INSERT INTO StockOUT(DT, ItemID, StockCondition, Amount) VALUES('" + DateTime.Now + "', '" + stockOUT.ItemID + "','" + stockOUT.StockCondition + "'," + stockOUT.Amount + ")"; sqlCommand = new SqlCommand(commandString, sqlConnection); sqlConnection.Open(); int isExecuted = sqlCommand.ExecuteNonQuery(); sqlConnection.Close(); return(isExecuted); }
public DataTable ShowItems(string fromDate, string toDate, StockOUT stockOUT) { sqlConnection = new SqlConnection(connectionString); commandString = @"SELECT * FROM StockOutView WHERE Date BETWEEN '" + fromDate + "' AND '" + toDate + "' AND StockCondition = '" + stockOUT.StockCondition + "' "; sqlCommand = new SqlCommand(commandString, sqlConnection); sqlConnection.Open(); SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand); DataTable dataTable = new DataTable(); //CreateSerialColumn(); dataAdapter.Fill(dataTable); sqlConnection.Close(); return(dataTable); }
public int insertIntoStockOut(StockOUT stockOUT) { return(_stockOutRepository.insertIntoStockOut(stockOUT)); }
public DataTable ShowItems(string fromDate, string toDate, StockOUT stockOUT) { return(_viewRepository.ShowItems(fromDate, toDate, stockOUT)); }