示例#1
0
文件: MiscData.cs 项目: nampn/ODental
        ///<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);
        }
示例#2
0
文件: MiscData.cs 项目: nampn/ODental
 ///<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;
 }
示例#3
0
文件: DataCore.cs 项目: 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);
		}
示例#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));
        }
示例#5
0
 ///<summary>Get one single value.</summary>
 public static string GetScalar(string command)
 {
     using (DataConnection dcon = new DataConnection()) {
         return(ExecuteQueryFunc(() => dcon.GetScalar(command)));
     }
 }