private static DataTable GetCountOfCollections()
        {
            SqlCommand CMD = new SqlCommand();

            CMD.CommandText = @" select   * from CollectCountView  ";/* P join WBin W on W.id */



            DataTable DT = new DB_Class().Select(CMD);

            return(DT);
        }
        private static DataTable GetWastesByMaxLevel()
        {
            SqlCommand CMD = new SqlCommand();

            CMD.CommandText = @" select   * from wbin  ";/* P join WBin W on W.id */



            DataTable DT = new DB_Class().Select(CMD);

            return(DT);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            LoggerClass log = new LoggerClass("./log", EnumLogLevel.LogLevelAll, true);
            DB_Class    db  = new DB_Class("./DB_Config.xml");

            /*
             * Console.WriteLine();
             * log.TraceWarning("GetTableColumns(\"BrakeResult\")");
             * db.GetTableColumns("BrakeResult");
             *
             * Console.WriteLine();
             * log.TraceError("GetRecords(\"VehicleInfo\", 1, 4)");
             * db.GetRecords("VehicleInfo", 1, 4);
             */

            /*
             * Console.WriteLine();
             * log.TraceInfo("GetRecordsCount(\"VehicleInfo\")");
             * int count = db.GetRecordsCount("VehicleInfo");
             * Console.WriteLine("There is {0} record(s) in \"VehicleInfo\"", count);
             *
             * // UpdateDB
             * Console.WriteLine();
             * log.TraceFatal("ModifyDB(\"VehicleInfo\", new string[] { \"3\", \"4\" }, strArr)");
             * string[,] strArr = new string[,] { { "testvincode332345", "IEV33" }, { "testvincode442345", "IEV44" } };
             * int iRet = db.ModifyDB("VehicleInfo", new string[] { "3", "4" }, strArr);
             * Console.WriteLine("ModifyDB(), {0} Row(s) affected", iRet);
             *
             * // UpdateDB and InsertDB
             * Console.WriteLine();
             * log.TraceFatal("ModifyDB(\"VehicleInfo\", new string[] { \"3\" }, strArr)");
             * strArr = new string[,] { { "testvincode332345", "IEV33" }, { "testvincode992299", "IEV992299" } };
             * iRet = db.ModifyDB("VehicleInfo", new string[] { "3" }, strArr);
             * Console.WriteLine("ModifyDB(), {0} Row(s) affected", iRet);
             *
             * // InsertDB
             * Console.WriteLine();
             * log.TraceFatal("ModifyDB(\"VehicleInfo\", new string[] { }, strArr)");
             * strArr = new string[,] { { "testvincode993399", "IEV993399" } };
             * iRet = db.ModifyDB("VehicleInfo", new string[] { }, strArr);
             * Console.WriteLine("ModifyDB(), {0} Row(s) affected", iRet);
             *
             * // DeleteDB
             * Console.WriteLine();
             * log.TraceFatal("ModifyDB(\"VehicleInfo\", new string[] { \"22\", \"23\" }, strArr)");
             * iRet = db.DeleteDB("VehicleInfo", new string[] { "22", "23" });
             * Console.WriteLine("DeleteDB(), {0} Row(s) affected", iRet);
             *
             * // Select
             * Console.WriteLine();
             * log.TraceError("SelectRecord(\"CaliProcResult\", \"Result\", \"X\", out count)");
             * db.SelectRecord("CaliProcResult", "Result", "X", out count);
             * Console.WriteLine("SelectRecord(), There is {0} record(s)", count);
             */

            Console.WriteLine("\nGetTableName()");
            string[] strTableName = db.GetTableName();
            foreach (var item in strTableName)
            {
                Console.WriteLine(item);
            }

            Console.WriteLine("\nGetTableColumnDesc");
            string[] strDesc = db.GetTableColumnDesc(3);
            foreach (var item in strDesc)
            {
                Console.WriteLine(item);
            }
        }