Example #1
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     if (txtFolderHome.Text != "")
     {
         if (txtProcess == null || txtProcess.ProcessState == ProcessState.Stopped)
         {
             FReadEntities.SetDirectory(txtFolderHome.Text);
             txtFolderHome.Enabled    = false;
             btnFolderBrowser.Enabled = false;
             btnStart.Text            = "Dừng đọc";
             StartProcess(ref txtProcess);
         }
         else
         {
             txtFolderHome.Enabled    = true;
             btnFolderBrowser.Enabled = true;
             btnStart.Text            = "Bắt đầu đọc";
             StopProcess(txtProcess);
         }
     }
 }
Example #2
0
 private void Login()
 {
     try
     {
         ctrlSA.CreateUserSession(out session, txtUserName.Text, txtPassWord.Text);
         FReadEntities.SetGlobalSession(session);
         txtUserName.Enabled        = false;
         txtPassWord.Enabled        = false;
         btnLogin.Enabled           = false;
         btnStart.Enabled           = true;
         btnFolderBrowser.Enabled   = true;
         txtFolderHome.Enabled      = true;
         txtLog.Enabled             = true;
         txtLog.Properties.ReadOnly = true;
         txtLog.Text += "Đăng nhập thành công\r\n";
     }
     catch
     {
         MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu", "Đăng nhập");
     }
 }