예제 #1
0
        // Clone section
        public VisaTask Clone()
        {
            var dt = new VisaTask
            {
                ArrivalDt        = ArrivalDt,
                Category         = Category,
                CategoryCode     = CategoryCode,
                City             = City,
                CityCode         = CityCode,
                CountAdult       = CountAdult,
                CountChild       = CountChild,
                Dob              = Dob,
                Email            = Email,
                LastName         = LastName,
                Name             = Name,
                Nationality      = Nationality,
                PassportEndDate  = PassportEndDate,
                Password         = Password,
                Priority         = Priority,
                Purpose          = Purpose,
                PurposeCode      = PurposeCode,
                Receipt          = Receipt,
                RedLine          = RedLine,
                GreenLine        = GreenLine,
                RegistrationInfo = RegistrationInfo,
                Status           = Status,
                StatusCode       = StatusCode
            };

            return(dt);
        }
예제 #2
0
        public void RefreshViewTab()
        {
            var dtT = new VisaTask
            {
                City     = "Львов",
                CityCode = "1"
            };

            _visaTasks = new BindingList <VisaTask> {
                dtT
            };

            foreach (var dt in _visaTasks)
            {
                if (!_cityTasks.ContainsKey(dt.CityV))
                {
                    // Create UI tab first
                    var tabPage = new TabPage(dt.CityV)
                    {
                        Name = dt.CityV
                    };

                    // Create webbrowser UI
                    var webBrowser = new WebBrowser
                    {
                        Location = new Point(0, 0),
                        Size     = new Size(1000, 460),
                        Dock     = DockStyle.Top,
                        Name     = "webBrowser" + dt.City,
                        Url      = new Uri("http://google.com")
                    };
                    tabPage.Controls.Add(webBrowser);

                    var logTxtBox = new RichTextBox
                    {
                        Location = new Point(0, 0),
                        Size     = new Size(1000, 130),
                        Dock     = DockStyle.Bottom,
                        Name     = "logTxtBox" + dt.CityCode
                    };
                    tabPage.Controls.Add(logTxtBox);

                    SetTabHeader(tabPage, Color.Chartreuse);
                    _tabControl.TabPages.Add(tabPage);

                    VisaTabs visaTab = new VisaTabs(dt, tabPage);
                    _cityTasks.Add(dt.CityV, visaTab);
                }
                else
                {
                    return;
                }
            }

            foreach (KeyValuePair <string, VisaTabs> pair in _cityTasks)
            {
            }
        }
예제 #3
0
        public VisaTabs(VisaTask visaTask, TabPage taskTabPage)
        {
            // Add curent task
            Tasks.Add(visaTask);

            // Initialize  tabs
            _tabPage = taskTabPage;

            // Finding controls
            _webBrowser = (WebBrowser)_tabPage.Controls.Find("webBrowser" + visaTask.City, true)[0];
            // Enable js
            _webBrowser.ScriptErrorsSuppressed = true;
            // Browser events
            _webBrowser.DocumentCompleted    += WebBrowserOnDocumentCompleted;
            _webBrowser.DocumentTitleChanged += WebBrowserOnDocumentTitleChanged;
            _webBrowser.NewWindow            += WebBrowserOnNewWindow;
            _webBrowser.Navigated            += WebBrowserOnNavigated;

            _richTextBox          = (RichTextBox)_tabPage.Controls.Find("logTxtBox" + visaTask.CityCode, true)[0];
            _richTextBox.ReadOnly = true;

            _proxyHelper.UseProxy = true;
            SetProxyHelper();
        }