示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (validation())
            {
                Insert_Form();
                DataVariables.Form_Data = this;
                this.Hide();

                Form_Data fl = new Form_Data();
                fl.Show();
            }
        }
示例#2
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            if (user_name.Text == "test1234" && user_password.Text == "test1234")
            {
                DataVariables.User_Name  = user_name.Text;
                DataVariables.Form_Login = this;

                this.Hide();
                //Form_Data obj_main = new Form_Data();
                //obj_main.Show();

                FormMain form_main = new FormMain();
                form_main.Show();
            }
            else if (user_name.Text == "dmu@aku" && user_password.Text == "aku?dmu")
            {
                DataVariables.User_Name  = user_name.Text;
                DataVariables.Form_Login = this;

                this.Hide();
                Form_Data obj_main = new Form_Data();
                obj_main.Show();
            }
            else if (user_name.Text != null && user_password.Text != null)
            {
                urs.username = user_name.Text;
                urs.password = user_password.Text;

                if (IsValid(urs.username, urs.password))
                {
                    DataVariables.User_Name  = user_name.Text;
                    DataVariables.Form_Login = this;
                    this.Hide();
                    Form_Data obj_main = new Form_Data();
                    obj_main.Show();
                }
                else
                {
                    MessageBox.Show("User does not exist ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    user_name.Focus();
                }
            }
        }