Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool isCashierSepecified = true;
            bool isAdminSepecified   = true;
            bool ispresent           = false;
            bool isregister;

            server.Service1 myservse = new server.Service1();
            if (checkBox1.Checked == true && checkBox2.Checked == false)
            {
                myservse.RegisterationAdmin(textBox1.Text, textBox2.Text, textBox3.Text, checkBox1.Checked, true, checkBox2.Checked, true, out ispresent, out isregister);
                if (ispresent)
                {
                    MessageBox.Show("Either User Is already present or password and cpassword is not same!!");
                }
                else
                {
                    MessageBox.Show("Admin registered");
                }
            }
            else if (checkBox2.Checked == true && checkBox1.Checked == false)
            {
                myservse.RegisterationCashier(textBox1.Text, textBox2.Text, textBox3.Text, checkBox1.Checked, true, checkBox2.Checked, true, out ispresent, out isregister);
                if (ispresent)
                {
                    MessageBox.Show("Either User Is already present or password and cpassword is not same!!");
                }
                else
                {
                    MessageBox.Show("Cashier registered");
                }
            }
            else if (checkBox1.Checked == false && checkBox2.Checked == false)
            {
                myservse.RegisterationUser(textBox1.Text, textBox2.Text, textBox3.Text, checkBox1.Checked, true, checkBox2.Checked, true, out ispresent, out isregister);
                if (ispresent)
                {
                    MessageBox.Show("Either User Is already present or password and cpassword is not same!!");
                }
                else
                {
                    MessageBox.Show("User registered");
                }
            }
            else
            {
                MessageBox.Show("Some Error");
            }
        }