Beispiel #1
0
        /// <summary>
        /// Method removes an item from
        /// </summary>
        /// <param name="desc"></param>
        /// <param name="cost"></param>
        public void deleteItem(string desc, string cost)
        {
            // use SQL query to find item code
            string itemCode = SQLItems.SelectDistinctItemCodeByDescCost(desc, cost);
            string query    = SQLItems.DeleteItem(itemCode);

            // execute delete SQL
            db.ExecuteNonQuery(query);
        }
Beispiel #2
0
        /// <summary>
        /// This method will delete an item from the data grid if
        /// it is okay to delete
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public bool deleteItem(string code)
        {
            // if deleted
            if (!okayToDelete(code))
            {
                return(false); //unsuccessful delete
            }
            // get deleted item
            string query = clsItemsSQL.DeleteItem(code);

            // SQL statement
            clsDataAccess.ExecuteNonQuery(query);

            return(true); //successful delete
        }