Esempio n. 1
0
        ///<summary>Returns a collection of unique AtoZ folders for the array of dbnames passed in.  It will not include the current AtoZ folder for this database, even if shared by another db.</summary>
        public static List <string> GetAtoZforDb(string[] dbNames)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                throw new ApplicationException("MiscData.GetAtoZforDb failed.  Updates not allowed from ClientWeb.");
            }
            List <string>  retval = new List <string>();
            DataConnection dcon   = null;
            string         atozName;
            string         atozThisDb = PrefC.GetString(PrefName.DocPath);

            for (int i = 0; i < dbNames.Length; i++)
            {
                try {
                    dcon = new DataConnection(dbNames[i]);
                    string command = "SELECT ValueString FROM preference WHERE PrefName='DocPath'";
                    atozName = dcon.GetScalar(command);
                    if (retval.Contains(atozName))
                    {
                        continue;
                    }
                    if (atozName == atozThisDb)
                    {
                        continue;
                    }
                    retval.Add(atozName);
                }
                catch {
                    //don't add it to the list
                }
            }
            return(retval);
        }
Esempio n. 2
0
 ///<summary>Returns a collection of unique AtoZ folders for the array of dbnames passed in.  It will not include the current AtoZ folder for this database, even if shared by another db.</summary>
 public static List<string> GetAtoZforDb(string[] dbNames)
 {
     if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
         throw new ApplicationException("MiscData.GetAtoZforDb failed.  Updates not allowed from ClientWeb.");
     }
     List<string> retval=new List<string>();
     DataConnection dcon=null;
     string atozName;
     string atozThisDb=PrefC.GetString(PrefName.DocPath);
     for(int i=0;i<dbNames.Length;i++) {
         try {
             dcon=new DataConnection(dbNames[i]);
             string command="SELECT ValueString FROM preference WHERE PrefName='DocPath'";
             atozName=dcon.GetScalar(command);
             if(retval.Contains(atozName)) {
                 continue;
             }
             if(atozName==atozThisDb) {
                 continue;
             }
             retval.Add(atozName);
         }
         catch {
             //don't add it to the list
         }
     }
     return retval;
 }
Esempio n. 3
0
File: DataCore.cs Progetto: mnisl/OD
		/*
		///<summary>This is for multiple queries all concatenated together with ;</summary>
		public static DataSet GetDataSet(string commands){
			DataConnection dcon=new DataConnection();
			//DataTable table=dcon.GetTable(command);
			DataSet retVal=dcon.GetDs(commands);
			//retVal.Tables.Add(table);
			return retVal;
		}*/

		///<summary>Get one single value.</summary>
		public static string GetScalar(string command) {
			DataConnection dcon=new DataConnection();
			return dcon.GetScalar(command);
		}
Esempio n. 4
0
        /*
         * ///<summary>This is for multiple queries all concatenated together with ;</summary>
         * public static DataSet GetDataSet(string commands){
         *      DataConnection dcon=new DataConnection();
         *      //DataTable table=dcon.GetTable(command);
         *      DataSet retVal=dcon.GetDs(commands);
         *      //retVal.Tables.Add(table);
         *      return retVal;
         * }*/

        ///<summary>Get one single value.</summary>
        public static string GetScalar(string command)
        {
            DataConnection dcon = new DataConnection();

            return(dcon.GetScalar(command));
        }
Esempio n. 5
0
 ///<summary>Get one single value.</summary>
 public static string GetScalar(string command)
 {
     using (DataConnection dcon = new DataConnection()) {
         return(ExecuteQueryFunc(() => dcon.GetScalar(command)));
     }
 }