using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Net; using System.Text; using System.Windows.Forms; using PatientMan.Properties; using System.Globalization; using System.Threading; namespace PatientMan.Forms { public partial class frmLogin : PatientMan.BasicForms.frmCommon { public frmLogin() { InitializeComponent(); } private void OK_Click(object sender, EventArgs e) { if (UserName.Text == "Admin" && SettingInfo.Password == common.MD5Hash(Password.Text)) { this.Hide(); if (this.Language.SelectedIndex == 0) { Thread.CurrentThread.CurrentUICulture = new CultureInfo("vi-VN"); SettingInfo.Language = 0; } else { Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); SettingInfo.Language = 1; } var frm = new frmMain(); frm.ShowDialog(); this.Close(); } else { MessageBox.Show("Password is not correct!", "Login Information", MessageBoxButtons.OK); } } private void frmLogin_Load(object sender, EventArgs e) { this.Language.SelectedIndex = SettingInfo.Language; Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); } private void Cancel_Click(object sender, EventArgs e) { Application.Exit(); } } }