예제 #1
0
        private void PvaMainUiAutoLoad(object autoLoadSender, EventArgs autoLoadEventArgs)
        {
            // Initialize header
            UpdateHeaderStrip();

            // Initialize first tab Add people
            cityList.DataSource     = Const.GetListFromDict(Const.SettingsCities);
            purposeList.DataSource  = Const.GetListFromDict(Const.FillPurpose());
            categoryList.DataSource = Const.GetListFromDict(Const.GetCategoryType());
            statusList.DataSource   = Const.GetListFromDict(Const.FillStatus());
            natList.DataSource      = Const.GetListFromDict(Const.FillNations());
            priorityList.DataSource = Const.GetListPriority();
            natList.SelectedItem    = "UKRAINE";
            statusList.SelectedItem = "Mr.";
            receptionCode.Text      = "0000/0000/0000";
            adultNum.Text           = "1";

            try
            {
                if (!vpaPolandDbDataSet.IsInitialized || !vpaPolandDbDataSet.Peoples.IsInitialized)
                {
                    return;
                }
                // Initialize second tab DB peoples
                peoplesTableAdapter.Fill(vpaPolandDbDataSet.Peoples);
                UpdateStatusStrip("SQL DB Connection established!", Color.Green, true);
            }
            catch (SqlException sqlException)
            {
                MessageBox.Show(sqlException.Message, "SQL Connection error!", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                UpdateStatusStrip("SQL Connection error! Cannot establish connection...", Color.Red, true);
            }

            // Temp func
            clsUserBtn.Enabled = false;

            // Start engine
            _engine = new Engine(_dataTypeses, tabControl1, false);
            _engine.RefreshViewTab();
        }
예제 #2
0
        private void PvAutoLoad(object sender, EventArgs e)
        {
            _commFolder = Path.Combine(AssemblyDirectory, COMM);
            if (!Directory.Exists(_commFolder))
            {
                Directory.CreateDirectory(_commFolder);
            }
            if (!_isMain)
            {
                _parentFolder = Path.Combine(Environment.CurrentDirectory, COMM);
            }
            Logger.Info("_commFolder " + _commFolder + " _parentFolder " + _parentFolder);
            ImageResolver.Instance.ChangeUseProxy += Instance_ChangeUseProxy;

            UpdateHeader();
            chbAutoResolveImage.Checked = ImageResolver.Instance.AutoResolveImage;
            radiocom.Checked            = ImageResolver.Instance.Host == radiocom.Text;
            radioinfo.Checked           = ImageResolver.Instance.Host == radioinfo.Text;
            chbProxy.Checked            = ImageResolver.Instance.UseProxy;
            chkAsk.Checked = ImageResolver.Instance.AskMaster;

            cbxCity.DataSource     = Const.GetListFromDict(Const.SettingsCities);
            cbxNation.DataSource   = Const.GetListFromDict(Const.FillNations());
            cbxStatus.DataSource   = Const.GetListFromDict(Const.FillStatus());
            cbxPurpose.DataSource  = Const.GetListFromDict(Const.FillPurpose());
            cbxCategory.DataSource = Const.GetListFromDict(Const.GetCategoryType());
            cbxPriority.DataSource = Const.GetListPriority();

            cityDataGridViewComboBoxColumn.DataSource = Const.GetListFromDict(Const.SettingsCities);
            priorityComboBoxColumn.DataSource         = Const.GetDataTablePriority();

            cbxStatus.SelectedItem = "Mr.";
            cbxNation.SelectedItem = "UKRAINE";

            _visaTasks = VisaTask.DeSerialize(VisaEntityType.New);

            dataGridView1.DataSource = _visaTasks;
            dataGridView1.Columns["deleteColumn"].DisplayIndex = 0;
            dataGridView1.Columns["duplColumn"].DisplayIndex   = 1;
            dataGridView1.Columns["City"].DisplayIndex         = 2;
            dataGridView1.Columns["LastName"].DisplayIndex     = 3;
            dataGridView1.Columns["Name"].DisplayIndex         = 4;
            dataGridView1.Columns["Status"].DisplayIndex       = 5;
            dataGridView1.Refresh();

            _completedVisaTasks      = VisaTask.DeSerialize(VisaEntityType.Completed);
            dataGridView2.DataSource = _completedVisaTasks;
            dataGridView2.Columns["deleteColumn2"].DisplayIndex    = 0;
            dataGridView2.Columns["restoreColumn"].DisplayIndex    = 1;
            dataGridView2.Columns["City2"].DisplayIndex            = 2;
            dataGridView2.Columns["LastName2"].DisplayIndex        = 3;
            dataGridView2.Columns["Name2"].DisplayIndex            = 4;
            dataGridView2.Columns["RegistrationInfo"].DisplayIndex = 5;
            dataGridView2.Columns["Purpose"].DisplayIndex          = 8;
            dataGridView2.Refresh();

            foreach (TabPage tabPage in tabControl1.TabPages)
            {
                Engine.TabColors.Add(tabPage, Color.White);
            }

            _engine = new Engine(_visaTasks, tabControl1, _isMain);//, _completedVisaTasks);
            _engine.RefreshViewTabs();
            _engine.ETaskEvent += _engine_ETaskEvent;
        }