Exemple #1
0
        private void ocmOk_Click(object sender, EventArgs e)
        {
            string tUser, tPwd;
            wMain  oMain = new wMain();

            try
            {
                if (otbUserName.Text == string.Empty)
                {
                    otbUserName.Focus();
                    return;
                }
                if (otbUserPassword.Text == string.Empty)
                {
                    otbUserPassword.Focus();
                    return;
                }

                var oLogin = cCNSP.SP_GEToDbConfigXml();
                tUser = oLogin.Rows[0]["UserLogin"].ToString();
                tPwd  = oLogin.Rows[0]["PwdLogin"].ToString();

                if (tUser == otbUserName.Text && tPwd == otbUserPassword.Text)
                {
                    //  MessageBox.Show("Successfull", "Login Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Hide();
                    oMain.Show();
                }
                else
                {
                    MessageBox.Show("User หรือ Password ผิด", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception oEx)
            {
                MessageBox.Show("wLogin : ocmOk_Click // " + oEx.Message);
            }
        }
Exemple #2
0
 public wSetting(wMain poMain)
 {
     oW_Main = poMain;
     InitializeComponent();
     W_SETxDefaultFormateFile();
 }