[Quantproject-developers] QuantProject/b2_DataAccess/Tables Tickers_tickerGroups.cs,NONE,1.1
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-05-11 21:55:58
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20107/b2_DataAccess/Tables Added Files: Tickers_tickerGroups.cs Log Message: Added class to access Ticker_tickerGroups table --- NEW FILE: Tickers_tickerGroups.cs --- /* QuantDownloader - Quantitative Finance Library Tickers_tickerGroups.cs Copyright (C) 2003 Marco Milletti This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using System.Windows.Forms; using QuantProject.DataAccess; namespace QuantProject.DataAccess.Tables { /// <summary> /// Class to access the Tickers_tickerGroups table, where tickers are collected /// into groups /// </summary> public class Tickers_tickerGroups { // these static fields provide field name in the database table // They are intended to be used through intellisense when necessary public static string GroupID = "ttTgId"; public static string Ticker = "ttTiId"; public Tickers_tickerGroups() { } /// <summary> /// It provides deletion of the single ticker from the specified group /// </summary> public static void Delete( string tickerToDelete, string fromGroupID) { try { SqlExecutor.ExecuteNonQuery("DELETE * FROM tickers_tickerGroups " + "WHERE " + Tickers_tickerGroups.Ticker + "='" + tickerToDelete + "' AND " + Tickers_tickerGroups.GroupID + "='" + fromGroupID + "'"); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } } /// <summary> /// It provides deletion of an entire group of tickers /// </summary> public static void Delete( string groupToDelete) { try { SqlExecutor.ExecuteNonQuery("DELETE * FROM tickers_tickerGroups " + "WHERE " + Tickers_tickerGroups.GroupID + "='" + groupToDelete + "'"); } catch(Exception ex) { MessageBox.Show(ex.ToString()); } } } } |