private void saving_Click(object sender, EventArgs e)
        {
            this.Hide();
            Welcome ps = new Welcome();

            ps.Show();
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Welcome k = new Welcome();

            k.Show();
            this.Hide();
        }
Example #3
0
        private void back_Click(object sender, EventArgs e)
        {
            Welcome x = new Welcome();

            this.Hide();
            x.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            Welcome p = new Welcome();

            p.Show();
        }
        private void connectToDb()
        {
            try
            {
                connect1();
                OracleCommand cm = new OracleCommand();
                cm.Connection  = conn;
                cm.CommandText = "pass_ver";
                cm.CommandType = CommandType.StoredProcedure;
                OracleParameter retval = new OracleParameter("myretval", OracleDbType.Varchar2, 50);
                retval.Direction = ParameterDirection.ReturnValue;
                cm.Parameters.Add(retval);

                cm.Parameters.Add(new OracleParameter(textBox1.Text, OracleDbType.Varchar2)).Value = textBox1.Text;
                cm.ExecuteNonQuery();
                conn.Close();
                string ps = retval.Value.ToString();
                string pas;
                pas = textBox2.Text;

                if (ps == pas)
                {
                    MessageBox.Show("Password is correct!");
                    this.Hide();
                }

                else
                {
                    MessageBox.Show("Password is incorrect!");
                    this.Hide();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Exception!");
                this.Hide();
            }

            this.Hide();
            Welcome k = new Welcome();

            k.Show();
        }
        public void TuckIn_Click(object sender, EventArgs e)
        {
            //try
            {
                user = username.Text;
                string pass = password.Text;
                passx = password.Text;

                int  num;
                char f;

                connect1();

                //comm = new OracleCommand();
                OracleCommand cm = new OracleCommand();

                // da for OracleDataAdapter

                DataTable dt;
                int       RowCount;

                cm.Connection = conn;

                // cm.CommandText = "SELECT * from Users WHERE User_ID='"+username.Text+"' and Password='******';";
                cm.CommandText = "SELECT * from Users;";

                cm.CommandType = CommandType.Text;
                // cm.ExecuteNonQuery();


                ds = new DataSet();
                da = new OracleDataAdapter(cm.CommandText, conn);

                da.Fill(ds, "USERS");
                dt = ds.Tables["USERS"];

                dr = dt.Rows[i];
                int t = dt.Rows.Count;

                int cot = 0;


                string us = dr["User_ID"].ToString();
                string pa = dr["Password"].ToString();

                for (; i < t; i++)
                {
                    dr = dt.Rows[i];
                    us = dr["User_ID"].ToString();
                    pa = dr["Password"].ToString();
                    if (username.Text == us)
                    {
                        if (password.Text == pa)
                        {
                            Welcome n = new Welcome();

                            n.Show();
                            this.Hide();
                            cot = 1;
                            break;
                        }
                    }
                }
                if (cot == 0)
                {
                    MessageBox.Show("Invalid Credentials!");
                    i = 0;
                }

                /* if (cot == 1)
                 * {
                 *   if (password.Text == pa)
                 *   {
                 *       Welcome n = new Welcome();
                 *       this.Hide();
                 *       n.Show();
                 *   }
                 * }*/
                /*else
                 * {
                 *  MessageBox.Show("Invalid Credentials!");
                 * }
                 */



                /*if ((username.Text==us) && (password.Text==pa))
                 * {
                 *  Welcome n = new Welcome();
                 *  this.Hide();
                 *  n.Show();
                 * }
                 *
                 * else
                 * {
                 *  MessageBox.Show("Invalid Credentials!");
                 * }
                 *
                 * }
                 *
                 * // catch (Exception s) { MessageBox.Show("Error"); }
                 *
                 *
                 *
                 *
                 *
                 * /* if((user == "Isha") && (pass == "1234"))
                 * {
                 * Welcome x = new Welcome();
                 * x.Show();
                 * this.Hide();
                 * }
                 * else if((user == "") && (pass == ""))
                 * {
                 * MessageBox.Show("Please Enter Username And Password!");
                 * }
                 *
                 * else if ((user == ""))
                 * {
                 * MessageBox.Show("Please Enter Username!");
                 * }
                 *
                 * else if ((pass == ""))
                 * {
                 * MessageBox.Show("Please Enter Password!");
                 * }
                 *
                 *
                 *
                 * else
                 * {
                 * MessageBox.Show("Invalid Credentials!");
                 * }*/

                if (username.Text.Contains('1') || username.Text.Contains('2') || username.Text.Contains('3') || username.Text.Contains('4') || username.Text.Contains('5') || username.Text.Contains('6') || username.Text.Contains('7') || username.Text.Contains('8') || username.Text.Contains('9') || username.Text.Contains('0'))
                {
                    MessageBox.Show("Enter alphabets only for the username!");
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Contains('1') || textBox1.Text.Contains('2') || textBox1.Text.Contains('3') || textBox1.Text.Contains('4') || textBox1.Text.Contains('5') || textBox1.Text.Contains('6') || textBox1.Text.Contains('7') || textBox1.Text.Contains('8') || textBox1.Text.Contains('9') || textBox1.Text.Contains('0'))
            {
                MessageBox.Show("Enter only alphabets in the Full Name!");
            }
            if (textBox3.Text.Contains('1') || textBox3.Text.Contains('2') || textBox3.Text.Contains('3') || textBox3.Text.Contains('4') || textBox3.Text.Contains('5') || textBox3.Text.Contains('6') || textBox3.Text.Contains('7') || textBox3.Text.Contains('8') || textBox3.Text.Contains('9') || textBox3.Text.Contains('0'))
            {
                MessageBox.Show("Enter only alphabets in City name!");
            }
            if (textBox5.Text.Contains('a') || textBox5.Text.Contains('b') || textBox5.Text.Contains('c') || textBox5.Text.Contains('d') || textBox5.Text.Contains('e') || textBox5.Text.Contains('f') || textBox5.Text.Contains('g') || textBox5.Text.Contains('h') || textBox5.Text.Contains('i') || textBox5.Text.Contains('j') || textBox5.Text.Contains('k') || textBox5.Text.Contains('l') || textBox5.Text.Contains('m') || textBox5.Text.Contains('n') || textBox5.Text.Contains('o') || textBox5.Text.Contains('p') || textBox5.Text.Contains('q') || textBox5.Text.Contains('r') || textBox5.Text.Contains('s') || textBox5.Text.Contains('t') || textBox5.Text.Contains('u') || textBox5.Text.Contains('v') || textBox5.Text.Contains('w') || textBox5.Text.Contains('x') || textBox5.Text.Contains('y') || textBox5.Text.Contains('z') || textBox5.Text.Contains('A') || textBox5.Text.Contains('B') || textBox5.Text.Contains('C') || textBox5.Text.Contains('D') || textBox5.Text.Contains('E') || textBox5.Text.Contains('F') || textBox5.Text.Contains('G') || textBox5.Text.Contains('H') || textBox5.Text.Contains('I') || textBox5.Text.Contains('J') || textBox5.Text.Contains('K') || textBox5.Text.Contains('L') || textBox5.Text.Contains('M') || textBox5.Text.Contains('N') || textBox5.Text.Contains('O') || textBox5.Text.Contains('P') || textBox5.Text.Contains('Q') || textBox5.Text.Contains('R') || textBox5.Text.Contains('S') || textBox5.Text.Contains('T') || textBox5.Text.Contains('U') || textBox5.Text.Contains('V') || textBox5.Text.Contains('W') || textBox5.Text.Contains('X') || textBox5.Text.Contains('Y') || textBox5.Text.Contains('Z'))
            {
                MessageBox.Show("Enter only numbers in the mobile number!");
            }
            if (!((textBox7.Text.Contains('@')) && (textBox7.Text.EndsWith(".com"))))
            {
                MessageBox.Show("Invalid email-id!");
            }
            else
            {
                val = 1;
            }


            string fullname = textBox1.Text;
            string city     = textBox3.Text;
            string insta    = textBox2.Text;
            string mob      = textBox5.Text;
            string email    = textBox7.Text;

            if (val == 1)
            {
                connect1();

                OracleCommand cm = new OracleCommand();
                cm.Connection  = conn;
                cm.CommandText = "update users set user_name=:u1, email_id=:u2, user_mobile=:u3, instagram_handle=:u4, user_city=:u5 where user_id=:pdn";
                cm.CommandType = CommandType.Text;



                OracleParameter p1 = new OracleParameter();
                OracleParameter p2 = new OracleParameter();
                OracleParameter p3 = new OracleParameter();
                OracleParameter p4 = new OracleParameter();
                OracleParameter p5 = new OracleParameter();
                OracleParameter p6 = new OracleParameter();



                p1.ParameterName = "u1";
                p1.DbType        = DbType.String;
                p1.Value         = fullname;

                p2.ParameterName = "u2";
                p2.DbType        = DbType.String;
                p2.Value         = email;

                p3.ParameterName = "u3";
                p3.DbType        = DbType.String;
                p3.Value         = mob;

                p4.ParameterName = "u4";
                p4.DbType        = DbType.String;
                p4.Value         = insta;

                p5.ParameterName = "u5";
                p5.DbType        = DbType.String;
                p5.Value         = city;

                p6.ParameterName = "pdn";
                p6.DbType        = DbType.String;
                p6.Value         = U;


                cm.Parameters.Add(p1);
                cm.Parameters.Add(p2);
                cm.Parameters.Add(p3);
                cm.Parameters.Add(p4);
                cm.Parameters.Add(p5);
                cm.Parameters.Add(p6);
                cm.ExecuteNonQuery();

                MessageBox.Show("Succssfully Updated Profile Info!");
                this.Hide();
                Welcome k = new Welcome();
                k.Show();
            }

            //comm = new OracleCommand();

            /* OracleCommand cm = new OracleCommand();
             *
             * // da for OracleDataAdapter
             *
             * DataTable dt;
             * int RowCount;
             *
             * cm.Connection = conn;
             *
             * // cm.CommandText = "SELECT * from Users WHERE User_ID='"+username.Text+"' and Password='******';";
             * cm.CommandText = "UPDATE TABLE USERS SET USER_NAME='"+fullname+"';";
             *
             * cm.CommandType = CommandType.Text;
             * // cm.ExecuteNonQuery();
             *
             *
             * ds = new DataSet();
             * da = new OracleDataAdapter(cm.CommandText, conn);
             *
             * da.Fill(ds, "USERS");
             * dt = ds.Tables["USERS"];
             *
             * dr = dt.Rows[i];
             * int t = dt.Rows.Count;
             *
             * int cot = 0;
             *
             *
             * /*string us = dr["User_ID"].ToString();
             * string pa = dr["Password"].ToString();
             *
             * for (; i < t; i++)
             * {
             *   dr = dt.Rows[i];
             *   us = dr["User_ID"].ToString();
             *   pa = dr["Password"].ToString();
             *   if (username.Text == us)
             *   {
             *       if (password.Text == pa)
             *       {
             *           Welcome n = new Welcome();
             *
             *           n.Show();
             *           this.Hide();
             *           cot = 1;
             *           break;
             *       }
             *
             *
             *   }
             *
             *
             * }
             * if (cot == 0)
             * {
             *   MessageBox.Show("Invalid Credentials!");
             *   i = 0;
             * }
             * */
            /*if(textBox1.Text.Contains('1')||textBox1.Text.Contains('2')||textBox1.Text.Contains('3')||textBox1.Text.Contains('4')||textBox1.Text.Contains('5')||textBox1.Text.Contains('6')||textBox1.Text.Contains('7')||textBox1.Text.Contains('8')||textBox1.Text.Contains('9')||textBox1.Text.Contains('0'))
             * {
             *  MessageBox.Show("Enter only alphabets in the Full Name!");
             * }
             * if (textBox3.Text.Contains('1') || textBox3.Text.Contains('2') || textBox3.Text.Contains('3') || textBox3.Text.Contains('4') || textBox3.Text.Contains('5') || textBox3.Text.Contains('6') || textBox3.Text.Contains('7') || textBox3.Text.Contains('8') || textBox3.Text.Contains('9') || textBox3.Text.Contains('0'))
             * {
             *  MessageBox.Show("Enter only alphabets in City name!");
             * }
             * if(textBox5.Text.Contains('a')||textBox5.Text.Contains('b')||textBox5.Text.Contains('c')||textBox5.Text.Contains('d')||textBox5.Text.Contains('e')||textBox5.Text.Contains('f')||textBox5.Text.Contains('g')||textBox5.Text.Contains('h')||textBox5.Text.Contains('i')||textBox5.Text.Contains('j')||textBox5.Text.Contains('k')||textBox5.Text.Contains('l')||textBox5.Text.Contains('m')||textBox5.Text.Contains('n')||textBox5.Text.Contains('o')||textBox5.Text.Contains('p')||textBox5.Text.Contains('q')||textBox5.Text.Contains('r')||textBox5.Text.Contains('s')||textBox5.Text.Contains('t')||textBox5.Text.Contains('u')||textBox5.Text.Contains('v')||textBox5.Text.Contains('w')||textBox5.Text.Contains('x')||textBox5.Text.Contains('y')||textBox5.Text.Contains('z')||textBox5.Text.Contains('A')||textBox5.Text.Contains('B')||textBox5.Text.Contains('C')||textBox5.Text.Contains('D')||textBox5.Text.Contains('E')||textBox5.Text.Contains('F')||textBox5.Text.Contains('G')||textBox5.Text.Contains('H')||textBox5.Text.Contains('I')||textBox5.Text.Contains('J')||textBox5.Text.Contains('K')||textBox5.Text.Contains('L')||textBox5.Text.Contains('M')||textBox5.Text.Contains('N')||textBox5.Text.Contains('O')||textBox5.Text.Contains('P')||textBox5.Text.Contains('Q')||textBox5.Text.Contains('R')||textBox5.Text.Contains('S')||textBox5.Text.Contains('T')||textBox5.Text.Contains('U')||textBox5.Text.Contains('V')||textBox5.Text.Contains('W')||textBox5.Text.Contains('X')||textBox5.Text.Contains('Y')||textBox5.Text.Contains('Z'))
             * {
             *  MessageBox.Show("Enter only numbers in the mobile number!");
             * }
             * if(!((textBox7.Text.Contains('@'))&&(textBox7.Text.EndsWith(".com"))))
             * {
             * MessageBox.Show("Invalid email-id!");
             * } */
            else
            {
                MessageBox.Show("Correct the information entered");
            }
        }
Example #8
0
        private void change_Click(object sender, EventArgs e)
        {
            if (!((EID.Text.Contains('@')) && (EID.Text.EndsWith(".com"))))
            {
                MessageBox.Show("Invalid email-id!");
            }
            else
            {
                val = 1;
            }
            if (val == 1)
            {
                connect1();
                OracleCommand cm = new OracleCommand();
                cm.Connection = conn;

                // cm.CommandText = "SELECT Password from Users where User_ID=''"+variegate+"'';";

                /* cm.CommandText = "SELECT Password from Users";
                 *
                 * cm.CommandType = CommandType.Text;
                 * // cm.ExecuteNonQuery();
                 *
                 * string P1, P2, P3;
                 *
                 * ds = new DataSet();
                 * da = new OracleDataAdapter(cm.CommandText, conn);
                 *
                 * da.Fill(ds, "USERS");
                 * dt = ds.Tables["USERS"];
                 *
                 * dr = dt.Rows[i];
                 * int t = dt.Rows.Count;
                 *
                 * string pa = dr["Password"].ToString();
                 *
                 * for (; i < t; i++)
                 * {
                 *   switch (i)
                 *   {
                 *       case 0: P1 = dr["Password"].ToString(); break;
                 *       case 1: P2 = dr["Password"].ToString(); break;
                 *       case 2: P3 = dr["Password"].ToString(); break;
                 *       default: break;
                 *   }
                 *
                 * } */



                if (textBox1.Text == variegatep)
                {
                    // int v = int.Parse(textBox2.Text);
                    cm.Connection  = conn;
                    cm.CommandText = "update users set password=:pk where user_id=:pdn";
                    cm.CommandType = CommandType.Text;

                    OracleParameter pa1 = new OracleParameter();
                    OracleParameter pa2 = new OracleParameter();
                    pa1.ParameterName = "pk";
                    pa1.DbType        = DbType.String;
                    pa1.Value         = textBox2.Text;
                    pa2.ParameterName = "pdn";
                    pa2.DbType        = DbType.String;
                    pa2.Value         = variegate;

                    cm.Parameters.Add(pa1);
                    cm.Parameters.Add(pa2);
                    cm.ExecuteNonQuery();


                    try
                    {
                        MailMessage mail       = new MailMessage();
                        SmtpClient  SmtpServer = new SmtpClient("smtp.gmail.com");

                        string t_add = EID.Text;
                        mail.From = new MailAddress("*****@*****.**");
                        mail.To.Add(t_add);
                        mail.Subject = "Cinnamon Password Reset: Hello," + variegate;
                        mail.Body    = "Your password is: " + textBox2.Text;

                        SmtpServer.Port        = 587;
                        SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "anshumanditi");
                        SmtpServer.EnableSsl   = true;

                        SmtpServer.Send(mail);
                        MessageBox.Show("Mail Sent");
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }

                    this.Hide();
                    Welcome m = new Welcome();
                    m.Show();
                }
                else
                {
                    MessageBox.Show("Password entered is invalid!");
                    this.Hide();
                    Welcome mq = new Welcome();
                    mq.Show();
                }
            }
        }