Esempio n. 1
0
        private void submit_btn_Click(object sender, EventArgs e)
        {
            SmtpClient obj = new SmtpClient();

            obj.Host                  = "smtp.live.com";
            obj.Port                  = 25;
            obj.EnableSsl             = true;
            obj.DeliveryMethod        = SmtpDeliveryMethod.Network;
            obj.UseDefaultCredentials = false;
            obj.Credentials           = new NetworkCredential("*****@*****.**", "");


            // mailcompse code

            MailMessage msg = new MailMessage();

            msg.To.Add("*****@*****.**");
            msg.From    = new MailAddress("*****@*****.**");
            msg.Subject = "SMOTO---- TAKE A RIDE ----";
            msg.Body    = "Name : " + name_txt.Text + "\nEmail : " + email_txt.Text + "\nMessage : " + msg_txt.Text;
            obj.Send(msg);
            msgrtn = "Thank you ! :) \n for Your feedback";
            messagebox msgbox = new messagebox();

            msgbox.labelmsg(msgrtn);
            msgbox.Show();
        }
Esempio n. 2
0
        private void insert_btn_Click(object sender, EventArgs e)
        {
            //user table
            if (dataGridView1.Enabled == true)
            {
                cnn.Open();
                cmd.CommandText = "insert into app_users ( username,email,password) values('" + nametxt.Text + "' ,'" + emailtxt.Text + "','" + passtxt.Text + "') ";
                cmd.Connection  = cnn;
                cmd.ExecuteNonQuery();
                cnn.Close();
                msgrtn = "USER INSERTED!";
                messagebox msgbox = new messagebox();
                msgbox.labelmsg(msgrtn);
                msgbox.Show();
            }
            else
            {
                //routes table

                cnn.Open();
                cmd1.CommandText = "insert into Routes  (Pickup_loc,Dropoff_loc,Auto,Go,Go_plus) values ('" + pickuptxt.Text + "','" + dropofftxt.Text + "','" + autotxt.Text + "','" + gotxt.Text + "','" + goplstxt.Text + "')";
                cmd1.Connection  = cnn;
                cmd1.ExecuteNonQuery();
                cnn.Close();
                msgrtn = "ROUTE INSERTED!";
                messagebox msgbox = new messagebox();
                msgbox.labelmsg(msgrtn);
                msgbox.Show();
            }
        }
Esempio n. 3
0
 private void delete_btn_Click(object sender, EventArgs e)
 {
     //user table
     if (dataGridView1.Enabled == true)
     {
         String email = dataGridView1.Rows[rowindex].Cells[2].Value.ToString();
         cnn.Open();
         cmd.CommandText = "delete from app_users where email='" + email + "'";
         cmd.Connection  = cnn;
         cmd.ExecuteNonQuery();
         cnn.Close();
         msgrtn = "USER DELETED !";
         messagebox msgbox = new messagebox();
         msgbox.labelmsg(msgrtn);
         msgbox.Show();
     }
     else
     {
         //routes table
         String rid = dataGridView2.Rows[rowindex].Cells[5].Value.ToString();
         cnn.Open();
         cmd1.CommandText = "delete  from Routes where r_id ='" + rid + "'";
         cmd1.Connection  = cnn;
         cmd1.ExecuteNonQuery();
         cnn.Close();
         msgrtn = "ROUTE DELETED !";
         messagebox msgbox = new messagebox();
         msgbox.labelmsg(msgrtn);
         msgbox.Show();
     }
 }
Esempio n. 4
0
        private void update_btn_Click(object sender, EventArgs e)
        {
            //user table
            if (dataGridView1.Enabled == true)
            {
                cnn.Open();
                cmd.CommandText = "update app_users set username='******' ,email='" + emailtxt.Text + "',password='******' where id='" + idtxt.Text + "'";
                cmd.Connection  = cnn;
                cmd.ExecuteNonQuery();
                cnn.Close();
                msgrtn = "USER UPDATED!";
                messagebox msgbox = new messagebox();
                msgbox.labelmsg(msgrtn);
                msgbox.Show();
            }
            else
            {
                //routes table

                cnn.Open();
                cmd1.CommandText = "update Routes set Pickup_loc='" + pickuptxt.Text + "',Dropoff_loc='" + dropofftxt.Text + "',Auto='" + autotxt.Text + "',Go='" + gotxt.Text + "',Go_plus='" + goplstxt.Text + "' where r_id='" + r_idtxt.Text + "'";
                cmd1.Connection  = cnn;
                cmd1.ExecuteNonQuery();
                cnn.Close();
                msgrtn = "ROUTE UPDATED!";
                messagebox msgbox = new messagebox();
                msgbox.labelmsg(msgrtn);
                msgbox.Show();
            }
        }
Esempio n. 5
0
        private void ridebtn_Click(object sender, EventArgs e)
        {
            msgrtn = "HAVE A NICE RIDE \n PLEASE GIVE US A FEEDBACK";
            messagebox msgbox = new messagebox();

            msgbox.labelmsg(msgrtn);
            msgbox.Show();
            cnn.Open();
            cmd.CommandText = "insert into history values('" + LoginInfo.email + "', '" + pick_lb.Text + "', '" + drop_lb.Text + "' , '" + fare_lb.Text + "')";
            cmd.Connection  = cnn;
            cmd.ExecuteNonQuery();
        }
Esempio n. 6
0
        private void submit_btn_Click(object sender, EventArgs e)
        {
            SmtpClient obj = new SmtpClient();

            obj.Host                  = "smtp.live.com";
            obj.Port                  = 587;
            obj.EnableSsl             = true;
            obj.DeliveryMethod        = SmtpDeliveryMethod.Network;
            obj.UseDefaultCredentials = false;
            obj.Credentials           = new NetworkCredential("*****@*****.**", "");


            // mailcompse code

            MailMessage msg = new MailMessage();

            msg.To.Add(email_txt.Text);
            msg.From    = new MailAddress("*****@*****.**");
            msg.Subject = "SMOTO----- TAKE A RIDE ----your password";

            cnn.Open();
            cmd             = new SqlCommand();
            cmd.CommandText = "select * from app_users where email ='" + email_txt.Text + "'";
            cmd.Connection  = cnn;

            SqlDataReader rd = cmd.ExecuteReader();

            if (rd.HasRows)
            {
                while (rd.Read())
                {
                    msg.Body = "Your Name : " + rd[1].ToString() + "\nYour Email : " + rd[2].ToString() + "\nYour Password : "******"Email has been send";
            messagebox msgbox = new messagebox();

            msgbox.labelmsg(msgrtn);
            msgbox.Show();
        }