Esempio n. 1
0
 /// <summary>
 /// Supprime les ressources allouées.
 /// </summary>
 public void Dispose()
 {
     if (CommandServer.IsWaitingForConnections)
     {
         CommandServer.StopWaitingForConnections();
     }
 }
Esempio n. 2
0
        private void LoadGrid2()
        {
            var commandServer = new CommandServer();
            var dt            = commandServer.DataGridSet(@"select * from AloneDublicate(" + radGridView2.CurrentRow.Cells[0].Value.ToString() + ")").Tables[0];

            radLabel2.Text = dt.Rows[0].ItemArray[0].ToString();
            radLabel4.Text = dt.Rows[0].ItemArray[1].ToString().Split(' ')[0];
            if (dt.Rows[0].ItemArray[2].ToString() == "false")
            {
                radLabel6.Text = "Ж";
            }
            else
            {
                radLabel6.Text = "M";
            }
            radLabel10.Text = dt.Rows[0].ItemArray[3].ToString();
            radLabel16.Text = dt.Rows[0].ItemArray[4].ToString();
            radLabel15.Text = dt.Rows[0].ItemArray[5].ToString();
            radLabel14.Text = dt.Rows[0].ItemArray[6].ToString();

            BindingSource _bs = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select category.category as [категории]
                from category
                where category.fk_alone = " + radGridView2.CurrentRow.Cells[0].Value.ToString() + " order by category.category").Tables[0]
            };

            radGridView3.DataSource          = _bs;
            radGridView3.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        if (!settings)
        {
            settings = GetComponent <GameSettings>();
        }
        if (!subEventManager)
        {
            subEventManager = GetComponent <TwitchSubscribeEventManager>();
        }
        if (!subEventManager)
        {
            subEventManager = gameObject.AddComponent <TwitchSubscribeEventManager>();
        }

        commandServer = GetComponent <CommandServer>();

        itemManager     = GetComponent <ItemManager>();
        playerManager   = GetComponent <PlayerManager>();
        chunkManager    = GetComponent <ChunkManager>();
        craftingManager = GetComponent <CraftingManager>();
        raidManager     = GetComponent <RaidManager>();
        arenaController = FindObjectOfType <ArenaController>();


        commandServer.StartServer(this);
    }
Esempio n. 4
0
        /// <summary>
        /// Initialise le lobby où les clients se connectent.
        /// </summary>
        void InitializeLobby()
        {
            LobbyControler = new Server.Controlers.LobbyControler();
            // Charge le contrôleur humain.

            /*Entities.EntityHero hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team1Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
             * Server.Controlers.HumanControler humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Test" };
             * m_clientIdToControlerId.Add(hero.ID, 0);
             * Controlers.Add(0, humanControler);*/

            /*hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team1Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
             * humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Joueur intégré" };
             * Controlers.Add(1, humanControler);
             *
             * hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team1Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
             * humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Joueur intégré" };
             * Controlers.Add(2, humanControler);
             *
             * hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team2Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
             * humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Joueur intégré" };
             * Controlers.Add(3, humanControler);
             *
             * hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team2Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
             * humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Joueur intégré" };
             * Controlers.Add(4, humanControler);
             *
             * hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team2Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
             * humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Joueur intégré" };
             * Controlers.Add(5, humanControler);*/

            // Démarre l'attente de connexions.
            CommandServer.WaitForConnectionsAsync(GameServer.__DEBUG_PORT, "127.0.0.1");
        }
Esempio n. 5
0
        public void Initialize(BotConfig config)
        {
            m_config = config;
            if (m_config.obswebsocket.Enabled)
            {
                m_obs = new OBSWebsocket();

                m_obs.Connected    += onConnect;
                m_obs.Disconnected += onDisconnect;

                m_obs.SceneChanged              += onSceneChange;
                m_obs.SceneCollectionChanged    += onSceneColChange;
                m_obs.ProfileChanged            += onProfileChange;
                m_obs.TransitionChanged         += onTransitionChange;
                m_obs.TransitionDurationChanged += onTransitionDurationChange;

                m_obs.StreamingStateChanged += onStreamingStateChange;
                m_obs.RecordingStateChanged += onRecordingStateChange;

                m_obs.StreamStatus += onStreamData;
                CommandServer.AddCommand(string.Empty, CommandPermissions.Viewer, "OBSIntegrationModule", true, "!uptime", "!uptime", "Display how long the stream has been online.", PrintUptime);
                CommandServer.AddCommand(string.Empty, CommandPermissions.Mod | CommandPermissions.BroadCaster | CommandPermissions.VIP | CommandPermissions.Bits100000p, "OBSIntegrationModule", true, "!scenes", "!scenes", "Lists all scenes in the current scene collection.", PrintOBSScenes);
                CommandServer.AddCommand(string.Empty, CommandPermissions.Mod | CommandPermissions.BroadCaster | CommandPermissions.VIP | CommandPermissions.Bits100000p, "OBSIntegrationModule", true, "!switchscene", "!switchscene [sceneindex]", "Switches scene to scene identified by this scene index from the !scenes command", SwitchOBSScene);

                ConnectOBS(m_obs);
            }
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))
                          .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);

            Configuration = builder.Build();

            Console.CancelKeyPress += Console_CancelKeyPress;

            Log.Logger = new LoggerConfiguration()
                         .ReadFrom.Configuration(Configuration)
                         .CreateLogger();

            var id = $"ipc.demo.{Guid.NewGuid().ToString()}";

            Log.Logger.Information("Server name: {id}", id);

            var server = new CommandServer(id);

            server.CancellationToken = CancellationTokenSource.Token;
            Log.Logger.Verbose("Total threads: {threads}", Process.GetCurrentProcess().Threads.Count);

            server.StartAsync().ContinueWith(t =>
            {
                Console.WriteLine("Server shutting down");
            }, TaskContinuationOptions.OnlyOnCanceled)
            .Wait();

            Console.WriteLine("Press ENTER to exit...");
            Console.ReadLine();
            Log.CloseAndFlush();
        }
Esempio n. 7
0
 private void radButton1_Click(object sender, EventArgs e)
 {
     if (RadMessageBox.Show(@"Вы точно хотите объединить записи БЕЗВОЗВРАТНО?", "Внимание", MessageBoxButtons.OKCancel, RadMessageIcon.Question) == DialogResult.OK)
     {
         var commandServer   = new CommandServer();
         var returnSqlServer = commandServer.ExecReturnServer("DublicateUnion", radGridView2.Rows[0].Cells[0].Value.ToString() + "," + radGridView2.Rows[1].Cells[0].Value.ToString() + "," + radGridView2.RowCount);
         if (returnSqlServer[1] == "1")
         {
             if (radGridView2.RowCount == 2)
             {
                 StartDataGrid();
                 radGridView2.DataSource = null;
             }
             else
             {
                 DublicateDelo();
             }
         }
         else
         {
             radDesktopAlert1.ContentText = returnSqlServer[0];
             radDesktopAlert1.Show();
         }
     }
 }
Esempio n. 8
0
        /// <summary>
        /// Envoie la queue de commandes au serveur.
        /// </summary>
        void CommandServer_Update()
        {
            lock (CommandLock)
            {
                while (m_commands.Count != 0)
                {
                    var tup = m_commands.Dequeue();
#if DEBUG
                    CommandServer.Send(tup.Item1, State.ProcessRequest(tup.Item2, tup.Item1));
#else
                    try
                    {
                        CommandServer.Send(tup.Item1, State.ProcessRequest(tup.Item2, tup.Item1));
                    }
                    catch (Exception e)
                    {
                        Log.Entries.Add(new Tools.Log.Entry(Tools.Log.EntryType.Error,
                                                            "Une erreur est survenue lors de l'envoi de la commande :\n" +
                                                            "Client =" + tup.Item1 + "\n" +
                                                            "Commande = " + Encoding.UTF8.GetString(tup.Item2),
                                                            e.StackTrace,
                                                            e));
                    }
#endif
                }
            }
        }
 private void ActivateConcreteCommand(SharedInformationalChatCommand cmd)
 {
     //if (!triggerResponses.ContainsKey(cmd.CommandTrigger))
     //{
     // triggerResponses.Add(cmd.CommandTrigger, cmd);
     CommandServer.AddCommand(chan.Channel, CommandPermissions.Unknown | CommandPermissions.Viewer | CommandPermissions.VIP | CommandPermissions.Bits1000p | CommandPermissions.Follower | CommandPermissions.BroadCaster | CommandPermissions.Subscriber | CommandPermissions.Bits100p, "General", false, cmd.CommandTrigger, string.Empty, string.Empty, HandleConcreteCommand, cmd.CoolDownSeconds);
     //}
 }
 private void ActivateConcreteCommand(SharedInformationalChatCommand cmd)
 {
     if (!triggerResponses.ContainsKey(cmd.CommandTrigger))
     {
         triggerResponses.Add(cmd.CommandTrigger, cmd);
         CommandServer.AddCommand(chan.Channel, CommandPermissions.Unknown, "General", false, cmd.CommandTrigger, string.Empty, string.Empty, HandleConcreteCommand, cmd.CoolDownSeconds);
     }
 }
 public void Cleanup()
 {
     CommandServer.Stop();
     ConfigMonitor.Dispose();
     Timers.ForEach(t => t.Stop());
     Timers.ForEach(t => t.Dispose());
     NLog.LogManager.Shutdown();
 }
Esempio n. 12
0
File: Dead.cs Progetto: Vla00/alone
        private void UpdateGrid()
        {
            var commandServer = new CommandServer();

            _bindingSource = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select * from DeadSelect() order by [ФИО ГИССЗ]").Tables[0]
            };
            radGridView2.DataSource = _bindingSource;
        }
Esempio n. 13
0
        private void ComboBox_every()
        {
            var commandServer = new CommandServer();

            _binding_every = new BindingList <string>(commandServer.ComboBoxList(@"select name
                from every_set
                where tabl = 'disability'
                order by name", false));
        }
        public void startServerVM()
        {
            cs  = CommandServer.Instance;
            isr = InfoServer.Instance;
            isr.Connect();
            cs.Start();
            FlightBoardViewModel fbvm = FlightBoardViewModel.Instance;

            fbvm.initFlightBoard();
        }
Esempio n. 15
0
        /// <summary>
        /// Initialise la phase de picks.
        /// </summary>
        void InitializePickPhase()
        {
            PickControler = new Controlers.PickPhaseControler(this, Controlers.Select(
                                                                  new Func <KeyValuePair <int, Controlers.ControlerBase>, EntityHero>((KeyValuePair <int, Controlers.ControlerBase> kvp) =>
            {
                return(kvp.Value.Hero);
            })).ToList());

            CommandServer.Start();
        }
Esempio n. 16
0
        private void fillTheDataGrid()
        {
            var commandServer = new CommandServer();

            try
            {
                radGridView1.Invoke(new MethodInvoker(delegate()
                {
                    radGridView1.EnablePaging = true;

                    if (dateS == null)
                    {
                        _bindingSource = new BindingSource {
                            DataSource = commandServer.DataGridSet(@"select * from ListSurvey() order by [Дата] desc").Tables[0]
                        }
                    }
                    ;
                    else
                    {
                        _bindingSource = new BindingSource {
                            DataSource = commandServer.DataGridSet(@"select * from ListSurvey()
                    where [Дата] between '" + dateS.Value + "' and '" + dateE.Value + "'order by [Дата] desc").Tables[0]
                        }
                    };

                    radGridView1.DataSource = _bindingSource;

                    if (radGridView1.Columns.Count > 0)
                    {
                        radGridView1.Columns[0].IsVisible    = false;
                        radGridView1.Columns[6].FormatString = "{0:dd/MM/yyyy}";
                        radGridView1.AutoSizeColumnsMode     = GridViewAutoSizeColumnsMode.Fill;
                        radGridView1.Columns[1].BestFit();
                        radGridView1.Columns[6].BestFit();

                        radGridView1.EnableFiltering = true;
                        radGridView1.MasterTemplate.ShowHeaderCellButtons = true;
                        radGridView1.MasterTemplate.ShowFilteringRow      = false;
                        radGridView1.Columns["Адрес"].AllowFiltering      = false;
                        radGridView1.Columns["ФИО"].AllowFiltering        = false;
                        radGridView1.Columns[6].AllowFiltering            = false;
                        radGridView1.Columns["Результат"].AllowFiltering  = false;
                    }

                    radLabelElement1.Text = @"Записей: " + radGridView1.MasterTemplate.DataView.ItemCount;
                }));
            }
            catch (Exception ex)
            {
                CommandClient commandClient = new CommandClient();
                radLabelElement1.Text = @"Произошла ошибка при загрузке данных. Сообщите разработчику.";
                commandClient.WriteFileError(ex, "select * from ListSurvey() order by [Дата] desc");
            }
        }
Esempio n. 17
0
        private void DeadAutoLoad()
        {
            var commandServer = new CommandServer();

            _bindingSource = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select *
                from family").Tables[0]
            };

            radGridView3.DataSource          = _bindingSource;
            radGridView3.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
Esempio n. 18
0
        public SocketService()
        {
            SocketServerConfiguration config = ServerConfigurationHelper.GetServerConfiguration();

            if (config.Queues.Count > 0)
            {
                _messageServer = new CommandServer(config.Queues[0].QueueName, config.Queues[0].QueuePath);
            }

            _serverManager = new SocketManager(config);
            InitializeComponent();
        }
Esempio n. 19
0
        private void StartDataGrid()
        {
            var commandServer = new CommandServer();

            try
            {
                radGridView1.Invoke(new MethodInvoker(delegate()
                {
                    radGridView1.EnablePaging = true;
                    _bindingSource            = new BindingSource {
                        DataSource = commandServer.DataGridSet(@"select (family.family + ' ' + family.name + ' ' + family.surname) as [ФИО], count(*) as [кол.]
                        from dublicate inner join alone on dublicate.fk_alone = alone.key_alone
	                        inner join family on family.fk_alone = alone.key_alone
                        group by family.family, family.name, family.surname").Tables[0]
                    };

                    _bindingSourcePol = new BindingSource {
                        DataSource = commandServer.DataGridSet(@"--вычисление женщин
                        select alone.key_alone, family + ' ' + name + ' ' + surname as [ФИО], 
	                        case pol when 1 then 'муж' when 0 then 'жен' end as [пол]
                        from alone inner join family on alone.key_alone = family.fk_alone
                        where alone.pol = 0 and (family.surname not like '%на' and family.surname not like '%зы' and family.surname not like '%ва')
                        union all
                        select alone.key_alone, family + ' ' + name + ' ' + surname as [ФИО],
	                        case pol when 1 then 'муж' when 0 then 'жен' end as [пол]
                        from alone inner join family on alone.key_alone = family.fk_alone
                        where alone.pol = 1 and (family.surname not like '%ич' and family.surname not like '%лы')").Tables[0]
                    };


                    radGridView1.DataSource = _bindingSource;
                    radGridView4.DataSource = _bindingSourcePol;

                    if (radGridView1.Columns.Count > 0)
                    {
                        radGridView1.Columns[0].BestFit();
                        radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
                    }

                    if (radGridView4.Columns.Count > 0)
                    {
                        radGridView4.Columns[0].IsVisible = false;
                        radGridView4.AutoSizeColumnsMode  = GridViewAutoSizeColumnsMode.Fill;
                    }
                }));
            }
            catch (Exception ex)
            {
                CommandClient commandClient = new CommandClient();
                commandClient.WriteFileError(ex, null);
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Initialise le mode de jeu de la scène.
        /// </summary>
        void InitializeGameMode()
        {
            if (m_skipPicks)
            {
                // Charge le contrôleur humain.

                /*Entities.EntityHero hero = new EntityHero() { Position = new Vector2(25, 25), Type = EntityType.Team1Player, Role = EntityHeroRole.Fighter, BaseMaxHP = 50000, HP = 50000 };
                 * Server.Controlers.HumanControler humanControler = new Server.Controlers.HumanControler(hero) { HeroName = "Test" };
                 * m_clientIdToControlerId.Add(hero.ID, 0);
                 * Controlers.Add(0, humanControler);*/
            }

            // Création de la map.
            Map = new Map();
            Map.Initialize();

            // Création de l'event scheduler.
            EventSheduler = new Scheduler();


            // Charge les variables dans l'interpréteur.
            GameInterpreter.MainContext.LocalVariables.Add("map", new PonyCarpetExtractor.ExpressionTree.Mutable(GameServer.GetMap()));
            GameInterpreter.MainContext.LocalVariables.Add("scene", new PonyCarpetExtractor.ExpressionTree.Mutable(GameServer.GetScene()));
            // GameInterpreter.MainContext.LocalVariables.Add("ctrl", new PonyCarpetExtractor.ExpressionTree.Mutable(Controlers[0]));
            GameInterpreter.Eval("print = function(arg) { Interpreter.Puts(arg); };");


            // Chargement des héros à partir des contrôleurs loggués.
            LoadPlayers();
            __initDone = true;
            // Création du système de récompenses.
            RewardSystem = new RewardSystem(Map.Heroes);

            // Chargement de la map.
            MapFile loaded = MapFile.FromFile(Ressources.MapFilename);

            Map.Load(loaded);

            if (m_skipPicks)
            {
                // Démarre le serveur de commandes.
                CommandServer.Start();
            }



            // DEBUG

            /*Map.Heroes[0].Weapon = new Equip.Weapon(Map.Heroes[0], GameServer.GetScene().ShopDB.Weapons.First());
             * Map.Heroes[0].Armor = new Equip.Armor(Map.Heroes[0], GameServer.GetScene().ShopDB.Armors.First());
             * Map.Heroes[0].Boots = new Equip.Boots(Map.Heroes[0], GameServer.GetScene().ShopDB.Boots.First());*/
        }
Esempio n. 21
0
File: Dead.cs Progetto: Vla00/alone
        private void SqlAdd()
        {
            radProgressBar1.Value1 = 0;
            radProgressBar1.Text   = "0%";
            var    commandServer  = new CommandServer();
            double step           = 100.00f / (double)radGridView1.RowCount;
            double value_progress = 0.00f;

            foreach (GridViewRowInfo row in radGridView1.Rows)
            {
                value_progress += step;
                row.IsSelected  = true;

                string parameters = "'" + row.Cells["Фамилия Имя Отчество"].Value.ToString().Trim() + "', '" + row.Cells["Дата рождения"].Value.ToString().Trim() + "', '" +
                                    row.Cells["Дата смерти"].Value.ToString().Trim() + "','" + row.Cells["Адрес"].Value.ToString().Trim() + "'";

                radProgressBar1.Value1 = (int)value_progress;
                radProgressBar1.Text   = radProgressBar1.Value1 + "%";

                var returnSqlServer = commandServer.ExecReturnServer("dead_add", parameters);
                if (returnSqlServer[0] == "1")
                {
                    row.Cells[row.Cells.Count - 1].Value = "Нет такого человека";
                    not++;
                }
                else
                {
                    if (returnSqlServer[0] == "2")
                    {
                        row.Cells[row.Cells.Count - 1].Value = "Данный человека уже помечен как умерший";
                        date_sm++;
                    }
                    else
                    {
                        if (returnSqlServer[0] == "3")
                        {
                            row.Cells[row.Cells.Count - 1].Value = "Данный человека уже занесен ранее";
                            doubl++;
                        }
                        else
                        {
                            row.Cells[row.Cells.Count - 1].Value = returnSqlServer[0];
                            add++;
                        }
                    }
                }
            }
            radProgressBar1.Value1 = 100;
            radProgressBar1.Text   = "100%";
            MessageBox.Show("Установлена дата смерти: " + date_sm + "\nДанные выли занесены ранее: " + doubl + "\nНет такого:" + not + "\nУспешно: " + add, "Отчет", MessageBoxButtons.OK, MessageBoxIcon.Information);
            UpdateGrid();
        }
Esempio n. 22
0
 // Start is called before the first frame update
 void Start()
 {
     if (!commandServer)
     {
         commandServer = GetComponent <CommandServer>();
     }
     if (!ioc)
     {
         ioc = FindObjectOfType <IoCContainer>();
     }
     ioc.Container.RegisterCustomShared <IGameManager>(() => this);
     commandServer.StartServer(this);
 }
Esempio n. 23
0
        private void radGridView1_UserAddedRow(object sender, GridViewRowEventArgs e)
        {
            var commandServer = new CommandServer();

            _bindingSource = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select * from Disability_get_table(" + _key + ") order by [Дата инв.]").Tables[0]
            };

            radGridView1.Invoke(new MethodInvoker(delegate()
            {
                radGridView1.DataSource = _bindingSource.DataSource;
            }));
        }
 private void DeactivateConcreteCommand(SharedInformationalChatCommand cmd)
 {
     lock (triggerResponses)
     {
         if (triggerResponses.ContainsKey(cmd.CommandTrigger))
         {
             triggerResponses.Remove(cmd.CommandTrigger);
             //triggerResponses.Remove(cmd.CommandTrigger, cmd);
             //CommandServer.(CommandPermissions.Unknown, "General", false, cmd.CommandTrigger, string.Empty, string.Empty, HandleConcreteCommand);
             CommandServer.RemCommand(chan.Channel, CommandPermissions.Unknown, "General", false, cmd.CommandTrigger, string.Empty, string.Empty, HandleConcreteCommand);
         }
     }
 }
 public bool Start()
 {
     var config = new ServerConfig
     {
         Port = port,
         Ip = ip,
         Mode = SocketMode.Tcp,
         Name = "CommandServer"
     };
     Server = new CommandServer();
     if (Server.Setup(config))
         return Server.Start();
     else return false;
 }
Esempio n. 26
0
        private void radGridView5_RowsChanging(object sender, Telerik.WinControls.UI.GridViewCollectionChangingEventArgs e)
        {
            var commandServer = new CommandServer();

            if (e.Action == NotifyCollectionChangedAction.ItemChanging)
            {
                var line = (GridViewRowInfo)e.NewItems[0];

                if (line.Cells[0].Value != null)
                {
                    commandServer.ExecNoReturnServer("EverySet_edit", line.Cells[0].Value.ToString() + "'" + line.Cells[1].Value.ToString() + "'");
                }
            }
        }
Esempio n. 27
0
        private void radGridView5_UserAddedRow(object sender, Telerik.WinControls.UI.GridViewRowEventArgs e)
        {
            var commandServer = new CommandServer();

            _bindingSource = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select key_every, name as [Название]
                from every_set
                where tabl = 'disability'
                order by name").Tables[0]
            };

            radGridView5.Invoke(new MethodInvoker(delegate()
            {
                radGridView5.DataSource = _bindingSource.DataSource;
            }));
        }
Esempio n. 28
0
        private void Grid()
        {
            var commandServer = new CommandServer();

            _bindingSource = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select key_every, name as [Название]
                from every_set
                where tabl = 'disability'
                order by name").Tables[0]
            };
            radGridView5.Refresh();
            radGridView5.AutoSizeRows         = true;
            radGridView5.DataSource           = _bindingSource;
            radGridView5.Columns[0].IsVisible = false;
            radGridView5.AutoSizeColumnsMode  = GridViewAutoSizeColumnsMode.Fill;
        }
Esempio n. 29
0
File: Dead.cs Progetto: Vla00/alone
        private void DeadLoad(object sender, DoWorkEventArgs e)
        {
            var commandServer = new CommandServer();

            _bindingSource = new BindingSource {
                DataSource = commandServer.DataGridSet(@"select * from DeadSelect() order by [ФИО ГИССЗ]").Tables[0]
            };

            radGridView2.Invoke(new MethodInvoker(delegate()
            {
                radGridView2.DataSource = _bindingSource;

                if (radGridView2.Columns["Дата р."] != null)
                {
                    radGridView2.Columns["Дата р."].FormatString = "{0:dd/MM/yyyy}";
                }

                if (radGridView2.Columns["Дата смерти"] != null)
                {
                    radGridView2.Columns["Дата смерти"].FormatString = "{0:dd/MM/yyyy}";
                }


                radGridView2.Columns[0].IsVisible          = false;
                radGridView2.Columns["key_dead"].IsVisible = false;
                radGridView2.Columns["cou"].IsVisible      = false;

                GridViewCommandColumn command = new GridViewCommandColumn();
                command.Name           = "commandDelYes";
                command.UseDefaultText = true;
                command.DefaultText    = "Удалить";
                command.FieldName      = "delete";
                command.HeaderText     = "Операция";
                radGridView2.MasterTemplate.Columns.Add(command);
                radGridView2.CommandCellClick += new CommandCellClickEventHandler(radGridViewButton_Click);

                radGridView2.Columns["ФИО ГИССЗ"].BestFit();
                radGridView2.Columns["Дата р."].BestFit();
                radGridView2.Columns["Адрес ГИССЗ"].BestFit();
                radGridView2.Columns["ФИО из базы"].BestFit();
                radGridView2.Columns["Адрес из базы"].BestFit();
                radGridView2.Columns["Дата смерти"].BestFit();
                radGridView2.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            }));
        }
Esempio n. 30
0
        private void radButton2_Click(object sender, EventArgs e)
        {
            var commandServer = new CommandServer();
            var commandClient = new CommandClient();

            for (int i = 0; i < radGridView3.Rows.Count; i++)
            {
                GridViewRowInfo row = radGridView3.Rows[i];

                string fio     = row.Cells[1].Value.ToString();
                string name    = row.Cells[2].Value.ToString();
                string surname = row.Cells[3].Value.ToString();
                string key     = row.Cells[0].Value.ToString();

                var parameters = row.Cells[0].Value.ToString() + ",'" + fio.Trim() + "','" + name.Trim() + "','" + surname.Trim() + "'";
                commandServer.ExecNoReturnServer("_renameFIO", parameters);
            }
        }
Esempio n. 31
0
        private void LoadInv()
        {
            var inv = new CommandServer().ComboBoxList(@"select name
                from every_set
                where tabl = 'disability'
                order by name", true);

            foreach (var i in inv)
            {
                if (!string.IsNullOrEmpty(i))
                {
                    radTreeView3.Invoke(new MethodInvoker(delegate
                    {
                        radTreeView3.Nodes.Add(i);
                    }));
                }
            }
        }