Ejemplo n.º 1
0
        public int GetDataBlockIdByDriversName(string driversName)
        {
            SQLDB_Records sqldbRecords = new SQLDB_Records(connectionString);
            int driversDataBlockId;
            string[] splittedName = driversName.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            string name = splittedName[0];
            string surname = splittedName[1];
            List<int> driversDataBlock = new List<int>();

            driversDataBlock = sqldbRecords.Get_DataBlockIdByDriversName(name, surname);
            if (driversDataBlock != null && driversDataBlock.Count > 0)
                driversDataBlockId = driversDataBlock[0];
            else
                throw new Exception("Данные не могут быть извлечены");
            return driversDataBlockId;
        }