예제 #1
0
        void button1_Click(object sender, EventArgs e)
        {
            if (MR.Checked == false && MRS.Checked == false && MS.Checked == false)
            {
                MessageBox.Show("Please choose personal title");
                return;
            }
            if (nameTT.Text == "" || nameTT.Text == " ")
            {
                MessageBox.Show("Please fill your name correctly");
                return;
            }
            if (SUPER.Checked == false && ADMIN.Checked == false && ACC.Checked == false)
            {
                MessageBox.Show("Please choose account type");
                return;
            }
            StreamWriter sww = new StreamWriter("login.txt");

            if (SUPER.Checked == true)
            {
                usser = "user";
            }
            if (ADMIN.Checked == true)
            {
                usser = "admin";
            }
            if (ACC.Checked == true)
            {
                usser = "accountant";
            }
            if (MR.Checked == true)
            {
                abb = "Mr.";
            }
            if (MS.Checked == true)
            {
                abb = "Ms.";
            }
            if (MRS.Checked == true)
            {
                abb = "Mrs.";
            }
            sww.WriteLine(usser);
            sww.WriteLine(abb + " " + nameTT.Text);
            sww.Close();
            mainForm m = new mainForm();

            m.Show();
            this.Hide();
        }
예제 #2
0
        private void btnGiris_Click(object sender, EventArgs e)
        {
            bool success;

            using (CustomersServices.ConvertSoapClient Login = new CustomersServices.ConvertSoapClient())
            {
                success      = Login.LoginCheck(txtAd.Text, txtPass.Text);
                txtAd.Text   = "";
                txtPass.Text = "";
            }
            var message = success ? "Başarılı!" : "Başarısız!";

            MessageBox.Show("Giriş işlemi " + message);
            if (success)
            {
                this.Hide();
                mainForm mdiParent = new mainForm();
                mdiParent.Show();
            }
        }