Ejemplo n.º 1
0
        private void operateManually()
        {
            try
            {
                var manualSettings = new StageConnector();
                manualSettings.Closing += ManualSettings_Closing;
                manualSettings.ShowDialog();
                if (serverName != "" && procName != "" && stageName != "")
                {
                    TabItem tabItem = CreateLogTabItem("MANUAL");
                    TabElement.Items.Add(tabItem);
                    sqlConnectionBuilder.DataSource     = serverName;
                    sqlConnectionBuilder.InitialCatalog = stageName;
                    sqlConnection  = new SqlConnection(sqlConnectionBuilder.ToString());
                    extractPathSQL = "select top 1 FILEPATHLOAD,FILEPATHSAVE from Replicas where REPLICAID = @Replica";


                    var command = new SqlCommand
                    {
                        Connection  = sqlConnection,
                        CommandText = string.Format("use {0} select CAST(REPLICAID as varchar(8)) from REPLICAS", sqlConnection.Database)
                    };
                    if (command.Connection.State != System.Data.ConnectionState.Open)
                    {
                        command.Connection.Open();
                    }

                    StartPuller(tabItem, command);
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "Возникла ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }