예제 #1
0
파일: MainForm.cs 프로젝트: alex765022/IBN
        private void GetManagers(bool source, ComboBox combo, ref bool populated)
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                if (!populated)
                {
                    combo.Items.Clear();

                    if (comboSourceCompany.SelectedItem != null)
                    {
                        NameValueCollection items = IbnConverter.GetManagers(GetSourcePortalConnectionString());
                        foreach (string key in items.AllKeys)
                        {
                            combo.Items.Add(new ComboboxWraper(items[key], int.Parse(key)));
                        }

                        populated = true;
                    }
                }
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #2
0
파일: MainForm.cs 프로젝트: alex765022/IBN
        private void GetCompanies(bool source, ComboBox combo, ref bool populated)
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                if (!populated)
                {
                    combo.Items.Clear();

                    foreach (CompanyInfo ci in IbnConverter.GetCompanies(GetConnectionString(source, false)))
                    {
                        combo.Items.Add(new ComboboxWraper(string.Format("{0} ({1})", ci.Domain, ci.Database), ci));
                    }

                    populated = true;
                }
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #3
0
파일: MainForm.cs 프로젝트: alex765022/IBN
        private void GetDatabases(bool source, ComboBox combo, ref bool populated)
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                if (!populated)
                {
                    combo.Items.Clear();

                    foreach (string db in IbnConverter.GetDatabases(GetConnectionString(source, true)))
                    {
                        combo.Items.Add(db);
                    }

                    populated = true;
                }
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch {}
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #4
0
 static void Convert()
 {
     try
     {
         string       source    = @"Data source=(local);Initial catalog=ibn45;Integrated Security=SSPI";
         string       target    = @"Data source=(local);Initial catalog=ibn47;Integrated Security=SSPI";
         IbnConverter converter = new IbnConverter(60, 1024 * 1024, source, target);
         converter.Progress += new EventHandler <ConverterEventArgs>(OnProgress);
         //converter.Convert45to47(false, true);
         converter.Convert(1, 1);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
예제 #5
0
        public static void SaveList(DBHelper target, IDictionary <int, ListFolder> folders)
        {
            List <ListFolder> list = new List <ListFolder>(folders.Values);

            list.Sort(Compare);

            const string targetTableName = "cls_ListFolder";

            IbnConverter.SetInsertIdentity(target, targetTableName, true);

            foreach (ListFolder folder in list)
            {
                folder.Save(target);
            }

            IbnConverter.SetInsertIdentity(target, targetTableName, false);
        }
예제 #6
0
파일: MainForm.cs 프로젝트: alex765022/IBN
        public MainForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            _converter = new IbnConverter(
                int.Parse(ConfigurationManager.AppSettings["SqlCommandTimeout"]),
                int.Parse(ConfigurationManager.AppSettings["BinaryBufferSize"]));

            _converter.Progress  += new EventHandler <ConverterEventArgs>(this.OnProgress);
            _converter.Warning   += new EventHandler <ConverterEventArgs>(this.OnWarning);
            _converter.Completed += new EventHandler <ConverterEventArgs>(this.OnCompleted);
        }