Ejemplo n.º 1
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (currentpage == Pages.LOGIN_PAGE)
     {
         mLogintrial = 0;
         mdidShow = false;
         if (chkRemember.Checked)
         {
             loginSettings.save(txtName.Text, txtSurName.Text, txtEmployeeId.Text, comboBox1.Text, txtPassword.Text);
         }
         else
         {
             loginSettings.DeleteSettings();
             LoginSettings tempSettings = new LoginSettings();
             loginSettings.Name = txtName.Text;
             loginSettings.SurName = txtSurName.Text;
             loginSettings.EmployeeId = txtEmployeeId.Text;
             loginSettings.CompanyId = comboBox1.Text;
             loginSettings.Password = txtPassword.Text;
             loginRender.loginSettings = tempSettings;
         }
         if (!String.IsNullOrEmpty(txtPassword.Text) || loginRender.isPasswordEntered())
         {
             loginRender.loginSettings = loginSettings;
             loginRender.work();
         }
     }
 }
Ejemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     dateTimePickerTo.Value = DateTime.Now;
     dateTimePickerFrom.Value = DateTime.Now.AddDays(-30);
     webBrowser1.Navigate(textBox1.Text);
     webBrowser1.DocumentCompleted += WebBrowser1_DocumentCompleted;
     currentpage = Pages.NONE;
     loginRender = new LoginRender(webBrowser1);
     mLogintrial = 0;
     mdidShow = false;
     loginSettings = new LoginSettings();
     loginSettings.load();
     txtPassword.Text = loginSettings.Password;
     txtName.Text = loginSettings.Name;
     txtSurName.Text = loginSettings.SurName;
     txtEmployeeId.Text = loginSettings.EmployeeId;
     comboBox1.SelectedIndex = 0;
     btnGo.Enabled = false;
     currentpage = Pages.CHANGE_LANG;
 }