Ejemplo n.º 1
0
        public void loadData()
        {
            ArrayList list = new ArrayList();

            list = myData.getAdminData();
            boxname.Items.Clear();
            for (int i = 0; i < list.Count; i++)
            {
                boxname.Items.Add(((adminClass)list[i]).name);
            }
        }
Ejemplo n.º 2
0
        private void btfind_Click(object sender, EventArgs e)
        {
            ArrayList list = new ArrayList();

            list = myData.getAdminData();
            for (int i = 0; i < list.Count; i++)
            {
                if (((adminClass)list[i]).email.Equals(txtemail.Text))
                {
                    onfind();
                    lblusername.Text = ((adminClass)list[i]).name;
                    lblpass.Text     = ((adminClass)list[i]).pass;
                    txtusername.Text = ((adminClass)list[i]).name;
                    txtpassword.Text = ((adminClass)list[i]).pass;
                    return;
                }
            }
            MessageBox.Show("Wrong E-Mail !!!");
        }
        private void btsignup_Click(object sender, EventArgs e)
        {
            Boolean b = false;

            lblinfo.Text       = "Data Error";
            lblinfo.Visible    = false;
            erusername.Visible = false;
            eremail.Visible    = false;
            erpass.Visible     = false;
            ercpass.Visible    = false;
            if (txtusername.Text == String.Empty)
            {
                lblinfo.Visible    = true;
                erusername.Visible = true;
                b = true;
            }
            if (txtemail.Text == String.Empty)
            {
                lblinfo.Visible = true;
                eremail.Visible = true;
                b = true;
            }
            if (txtpassword.Text == String.Empty)
            {
                lblinfo.Visible = true;
                erpass.Visible  = true;
                b = true;
            }
            if (txtcpassword.Text == String.Empty)
            {
                lblinfo.Visible = true;
                ercpass.Visible = true;
                b = true;
            }
            if (b)
            {
                return;
            }
            ArrayList list = new ArrayList();

            list = myData.getAdminData();
            for (int i = 0; i < list.Count; i++)
            {
                if ((((adminClass)list[i]).name.Equals(txtusername.Text)))
                {
                    lblinfo.Text       = "User Name Already Available !!!";
                    lblinfo.Visible    = true;
                    erusername.Visible = true;
                    return;
                }
                if ((((adminClass)list[i]).email.Equals(txtemail.Text)))
                {
                    lblinfo.Text    = "E-Mail Already Available !!!";
                    lblinfo.Visible = true;
                    eremail.Visible = true;
                    return;
                }
            }
            if (!(txtpassword.Text.Equals(txtcpassword.Text)))
            {
                lblinfo.Text    = "Password Does Not Match !!!";
                lblinfo.Visible = true;
                erpass.Visible  = true;
                ercpass.Visible = true;
                return;
            }
            if (!(myData.insertAdminData(txtusername.Text, txtemail.Text, txtpassword.Text)))
            {
                lblinfo.Text    = "System Error !!!";
                lblinfo.Visible = true;
            }
            else
            {
                lblinfo.Text      = "Data Added Successfully !!!";
                lblinfo.Visible   = true;
                txtusername.Text  = "";
                txtemail.Text     = "";
                txtpassword.Text  = "";
                txtcpassword.Text = "";
            }
        }