Example #1
0
        public void sort(TcpClient tcpClient)
        {
            Posts    post = new Posts(tcpClient);
            SQLclass sql  = new SQLclass();

            List <string> str2  = sql.getLoginsAndId();
            List <string> ready = new List <string>();
            List <string> name  = new List <string>();
            int           i     = 0;

            while (i != str2.Count())
            {
                string[] words = str2[i].Split('|');
                name.Add(words[1]);
                i++;
            }
            string mes;

            name.Sort();
            Thread.Sleep(50);
            post.sendMes(str2.Count().ToString());
            Thread.Sleep(40);
            post.sendMes("|id|Логин                    |Пароль                   |ФИО                      |Зарплата                 |Должность                |Телефон                  |\n");
            for (i = 0; i < str2.Count(); i++)
            {
                Thread.Sleep(40);
                mes = sql.getInfoUserWhereLogin(name[i]) + "|" + sql.getInfoUser(sql.getInfoUserWhereLogin(name[i]))[0];
                ready.Add(mes);
                post.sendMes(this.makeTable(ready, 1)[0] + "\n");
                ready.Clear();
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            DataBanck.whatDo = 0;
            //Подключаем SQL бд
            SQLclass objSQL = new SQLclass();

            objSQL.startSQL();
            //стартуем подклчение
            ServerConfig server = new ServerConfig();

            server.startServer();
            objSQL.closeSQl();
            //___________________________________________________________________________________________________________--
            return;
        }