Exemplo n.º 1
0
        public void Usersignin()
        {
            string query = "select  ua.email , ua.userpassword , pay.paymentepxpiredate,pay.customerid   from useraccount ua join payment pay ON ua.userid = pay.customerid ";

            try
            {
                OracleDataAdapter adapter = new OracleDataAdapter(query, ordb);
                DataSet           ds      = new DataSet();
                adapter.Fill(ds);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (ds.Tables[0].Rows[i]["email"].ToString() == textBox1.Text && ds.Tables[0].Rows[i]["userpassword"].ToString() == textBox2.Text)
                    {
                        emaildb = ds.Tables[0].Rows[i]["email"].ToString();
                        passdb  = ds.Tables[0].Rows[i]["userpassword"].ToString();
                        expDate = ds.Tables[0].Rows[i]["paymentepxpiredate"].ToString();
                        userID  = Convert.ToInt32(ds.Tables[0].Rows[i]["customerid"]);
                        break;
                    }
                }
                DateTime dt1 = DateTime.Parse(expDate);
                DateTime dt2 = DateTime.Now;

                if (textBox1.Text == emaildb && textBox2.Text == passdb)
                {
                    if (dt1.Date <= dt2.Date)
                    {
                        MessageBox.Show("Your Subscription ended");
                        signupForm signupform = new signupForm(userID);
                        signupform.Show();
                    }
                    else
                    {
                        MessageBox.Show("Welcome");
                        Profile profile = new Profile(emaildb);
                        profile.Show();
                    }
                }
                else if (textBox1.Text == "*****@*****.**" && textBox2.Text == "0000")
                {
                    MessageBox.Show("Welcome");
                    Admin admin = new Admin();
                    admin.Show();
                }
                else
                {
                    MessageBox.Show("Email or Password is Wrong");
                }
            }

            catch
            {
                MessageBox.Show("Fields Cannot be Empty");
            }
        }
Exemplo n.º 2
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            signupForm signup = new signupForm();

            signup.Show();
        }