Exemplo n.º 1
0
        public static void GetUserInfo( )
        {
            try
            {
                ATCTSDBDataSetTableAdapters.GetUserInfoTableAdapter QTA = new ATCTSDBDataSetTableAdapters.GetUserInfoTableAdapter( );
                ATCTSDBDataSet.GetUserInfoDataTable QDT = QTA.GetData(UserInfo.Id);
                Email     = QDT [0] ["Email"].ToString( );
                FirstName = QDT [0] ["FirstName"].ToString( );
                LastName  = QDT [0] ["LastName"].ToString( );

                ATCTSDBDataSetTableAdapters.GetSectorsTableAdapter QTA2 = new ATCTSDBDataSetTableAdapters.GetSectorsTableAdapter( );
                ATCTSDBDataSet.GetSectorsDataTable QDT2 = QTA2.GetData(Id);

                for (int CurrentRow = 0; CurrentRow < QDT2.Rows.Count; CurrentRow++)
                {
                    Sectors.Add(new SectorInfo(QDT2 [CurrentRow] ["ICAO"].ToString( ), QDT2));
                }

                string LocalSectors = null;
                foreach (SectorInfo CurrentSector in Sectors)
                {
                    LocalSectors += CurrentSector.ICAO + ";";
                }
                AuthWindow.ProgramKey.SetValue(Crypto.GetMD5("Sectors"), Crypto.EncryptStringAES(LocalSectors, "Bdp4XDP3AN"));
            }
            catch { }
        }
Exemplo n.º 2
0
        public SectorInfo(string ICAO, ATCTSDBDataSet.GetSectorsDataTable QDT)
        {
            for (int CurrentRow = 0; CurrentRow < QDT.Rows.Count; CurrentRow++)
            {
                if (QDT [CurrentRow] ["ICAO"].ToString( ) == ICAO)
                {
                    Name          = QDT [CurrentRow] ["Name"].ToString( );
                    this.ICAO     = ICAO;
                    ServerVersion = Convert.ToInt16(QDT [CurrentRow] ["Version"]);

                    FileInfo SectorFile = new FileInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\NWD-Group\\ATC Training Simulator Full\\Sectors\\" + ICAO + ".sector");

                    isLocal = SectorFile.Exists;
                }
            }
        }