Example #1
0
 public void InitializeWithExistingSession(IndianRailwaysSession oldSession)
 {
     this.sessionId = oldSession.sessionId;
     this.engineId = oldSession.engineId;
     this.submitClicksCount = oldSession.submitClicksCount;
 }
Example #2
0
        private void StartBookingProcess(object sender, WebBrowserNavigatedEventArgs e)
        {
            //if (e.Url == new Uri("about:blank"))
            {
                webBrowser.Navigated -= StartBookingProcess;

                var oldSession = irctcSession;
                irctcSession = new IndianRailwaysSession(this);

                var availabilityBrowser = new AvailabilityWebBrowser(this);
                availabilitySession = new IndianRailwaysSession(availabilityBrowser);
                availabilitySession.ShowAvailability(rs);

                if (oldSession != null && oldSession.LoggedIn && preserveLoginCheckbox.Checked)
                {
                    irctcSession.InitializeWithExistingSession(oldSession);
                    irctcSession.Book(rs);
                }
                else
                {
                    irctcSession.LoginAndBook(userNameTextBox.Text, passwordTextBox.Text, rs);
                }
            }
        }