Пример #1
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         DBEngine.exec("SC_Login_CheckLogin", "@LoginName", txtUserName.Text, "@PassWord", HPA.Common.Encryption.EncryptText(txtPassword.Text, true));
         UserID = DBEngine.getReturnValue();
         if (Convert.ToInt32(UserID) == -1 || Convert.ToInt32(UserID) == -2)
         {
             LOGIN_FAILURE.Text = HPA.Common.UIMessage.Get_Message(LOGIN_FAILURE.Name);
             LOGIN_FAILURE.Visible = true;
             txtUserName.Focus();
             return;
         }
         else if (Convert.ToInt32(UserID) == -3)// password was expired
         {
             UIMessage.Alert(99);
             object o;
             HPA.SystemAdmin.ChangePassword changePass = new HPA.SystemAdmin.ChangePassword();
             changePass.AccessibleName = "HPA.Component.SystemAdmin";
             changePass.ClassName = "frmChangesPassword";
             m_objManager.OpenObject(changePass, true, null, out o);
             return;
         }
         UserName = txtUserName.Text;
         DialogResult = DialogResult.OK;
         Microsoft.Win32.Registry.CurrentUser.SetValue("Paradise-HPA", UserName);
         UIMessage.userID = UserID;
     }
     catch (Exception ex)
     {
         HPA.Common.Helper.ShowException(ex, this.Text, "btnLogin_Click");
     }
     this.Close();
 }
Пример #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         DBEngine.exec("SC_Login_CheckLogin", "@LoginName", txtUserName.Text, "@PassWord", HPA.Common.Encryption.EncryptText(txtPassword.Text, true));
         UserID = DBEngine.getReturnValue();
         if (Convert.ToInt32(UserID) == -1 || Convert.ToInt32(UserID) == -2)
         {
             LOGIN_FAILURE.Text    = HPA.Common.UIMessage.Get_Message(LOGIN_FAILURE.Name);
             LOGIN_FAILURE.Visible = true;
             txtUserName.Focus();
             return;
         }
         else if (Convert.ToInt32(UserID) == -3)// password was expired
         {
             UIMessage.Alert(99);
             object o;
             HPA.SystemAdmin.ChangePassword changePass = new HPA.SystemAdmin.ChangePassword();
             changePass.AccessibleName = "HPA.Component.SystemAdmin";
             changePass.ClassName      = "frmChangesPassword";
             m_objManager.OpenObject(changePass, true, null, out o);
             return;
         }
         UserName     = txtUserName.Text;
         DialogResult = DialogResult.OK;
         Microsoft.Win32.Registry.CurrentUser.SetValue("Paradise-HPA", UserName);
         UIMessage.userID = UserID;
     }
     catch (Exception ex)
     {
         HPA.Common.Helper.ShowException(ex, this.Text, "btnLogin_Click");
     }
     this.Close();
 }
Пример #3
0
 private void btnLogin_Click(object sender, System.EventArgs e)
 {
     // For free data base
     // DBEngine.exec("delete tblEmployee where EmployeeID not in (select top 50 employeeID from tblEmployee)");
     //end
     DBEngine.exec("SC_Login_CheckLogin", "@LoginName", txtUserName.Text, "@PassWord", HPA.Common.Encryption.EncryptText(txtPassword.Text, true));
     UserID = DBEngine.getReturnValue();
     if (Convert.ToInt32(DBEngine.getReturnValue()) == -1)
     {
         UIMessage.Alert(54);
         txtUserName.Focus();
         return;
     }
     else if (Convert.ToInt32(DBEngine.getReturnValue()) == -2)
     {
         UIMessage.Alert(55);
         txtPassword.Focus();
         return;
     }
     else if (Convert.ToInt32(DBEngine.getReturnValue()) == -3)// password was expired
     {
         UIMessage.Alert(99);
         object o;
         HPA.SystemAdmin.ChangePassword changePass = new HPA.SystemAdmin.ChangePassword();
         changePass.AccessibleName = "HPA.Component.SystemAdmin";
         changePass.ClassName      = "frmChangesPassword";
         m_objManager.OpenObject(changePass, true, null, out o);
         return;
     }
     UserName     = txtUserName.Text;
     DialogResult = DialogResult.OK;
     Microsoft.Win32.Registry.CurrentUser.SetValue("Paradise-HPA", UserName);
     UIMessage.userID = UserID;
     //UIMessage.languageID = Application.CurrentCulture.TwoLetterISOLanguageName.ToUpper();
     this.Close();
 }
Пример #4
0
 private void btnLogin_Click(object sender, System.EventArgs e)
 {
     // For free data base
     // DBEngine.exec("delete tblEmployee where EmployeeID not in (select top 50 employeeID from tblEmployee)");
     //end
     DBEngine.exec("SC_Login_CheckLogin", "@LoginName", txtUserName.Text, "@PassWord", HPA.Common.Encryption.EncryptText(txtPassword.Text,true));
     UserID = DBEngine.getReturnValue();
     if (Convert.ToInt32(DBEngine.getReturnValue()) == -1)
     {
         UIMessage.Alert(54);
         txtUserName.Focus();
         return;
     }
     else if (Convert.ToInt32(DBEngine.getReturnValue()) == -2)
     {
         UIMessage.Alert(55);
         txtPassword.Focus();
         return;
     }
     else if (Convert.ToInt32(DBEngine.getReturnValue()) == -3)// password was expired
     {
         UIMessage.Alert(99);
         object o;
         HPA.SystemAdmin.ChangePassword changePass = new HPA.SystemAdmin.ChangePassword();
         changePass.AccessibleName = "HPA.Component.SystemAdmin";
         changePass.ClassName = "frmChangesPassword";
         m_objManager.OpenObject(changePass, true, null, out o);
         return;
     }
     UserName = txtUserName.Text;
     DialogResult = DialogResult.OK;
     Microsoft.Win32.Registry.CurrentUser.SetValue("Paradise-HPA", UserName);
     UIMessage.userID = UserID;
     //UIMessage.languageID = Application.CurrentCulture.TwoLetterISOLanguageName.ToUpper();
     this.Close();
 }