Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(Request.QueryString["id"]);

            if (id == null)
            {
                id = 1;
            }
            order_details.order r = new order_details.order();
            string res = r.order_details(id);

            string[] a = res.Split('^');

            string details = a[2];

            string price = a[3];

            string street = a[5];

            string city = a[6];

            string state = a[7];

            string phone = a[8];

            price1.Text = price;

            string[] each_details = details.Split('&');

            int len = each_details.Length;

            DataTable newsDataTable = new DataTable();

            // add some columns to our datatable
            newsDataTable.Columns.Add("item_name");
            newsDataTable.Columns.Add("price");

            for (int i = 0; i < len - 1; i++)
            {
                string[] each_single = each_details[i].Split(',');

                DataRow newsDataRow = newsDataTable.NewRow();
                newsDataRow["item_name"] = each_single[0];
                newsDataRow["price"] = each_single[1];

                newsDataTable.Rows.Add(newsDataRow);

            }

            //Binding data to repeater

            cart.DataSource = newsDataTable;
            cart.DataBind();

            /*  city1.Text = city;
              street1.Text = street;
              state1.Text = state;
              phone1.Text = phone;
             * /*/
        }
Ejemplo n.º 2
0
        protected void checkout_Click(object sender, EventArgs e)
        {
            int    result    = 0;
            string det       = details1.Text;
            string main_user = Session["main_name"].ToString();
            string ven_id    = Session["vn"].ToString();
            string tott      = price.Text;
            int    tot       = Convert.ToInt32(tott);

            order_details.order r = new order_details.order();
            result = r.order_enter(main_user, ven_id, det, tot);
            if (result != 0)
            {
                Response.Redirect("order_address.aspx?id=" + result);
            }
            else
            {
                price.Text = "zero";
            }

            /*
             * order_details.order r = new order_details.order();
             * result = r.order_enter(main_user, ven_id, det, tot);*/
            //Declare Connection by passing the connection string from the web config file

            /*SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbString"].ConnectionString);
             * //Open the connection
             * conn.Open();
             *
             * //  SqlCommand cmd1 = new SqlCommand("insert into order_details (user_id,res_id,details,total,date) values('"+user_id + "'," +user_id + "',"+details +"',"+total +",' sysdate()')",conn);
             * SqlCommand cmd1 = new SqlCommand("insert into order_details (user_id,ven_id,details,total) values('" + main_user + "','" + ven_id + "','" + det + "','" + tott + "')", conn);
             * int x = cmd1.ExecuteNonQuery();
             *
             * int y = 0;
             * if (x != 0)
             * {
             *  SqlCommand cm = new SqlCommand("select id from order_details where user_id = '" + main_user + "' and ven_id='" + ven_id + "' and details = '" + det + "' and total = '" + tot + "'", conn);
             *  SqlDataReader red = cm.ExecuteReader();
             *
             *  while (red.Read())
             *  {
             *
             *      y = Convert.ToInt32(red["id"]);
             *  }
             *
             * }
             *
             * if (y != 0)
             * {
             *  Response.Redirect("order_address.aspx?id=" + y);
             *
             * }
             * else
             * {
             *  price.Text = "zero";
             * }
             * cmd1.Dispose();
             * conn.Close();*/
        }
        protected void checkout_Click(object sender, EventArgs e)
        {
            int result = 0;
            string det = details1.Text;
            string main_user = Session["main_name"].ToString();
            string ven_id = Session["vn"].ToString();
            string tott = price.Text;
            int tot = Convert.ToInt32(tott);

            order_details.order r = new order_details.order();
            result = r.order_enter(main_user, ven_id, det, tot);
            if (result != 0)
            {
                Response.Redirect("order_address.aspx?id=" + result);

            }
            else
            {
                price.Text = "zero";
            }
            /*
            order_details.order r = new order_details.order();
            result = r.order_enter(main_user, ven_id, det, tot);*/
            //Declare Connection by passing the connection string from the web config file
            /*SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbString"].ConnectionString);
            //Open the connection
            conn.Open();

            //  SqlCommand cmd1 = new SqlCommand("insert into order_details (user_id,res_id,details,total,date) values('"+user_id + "'," +user_id + "',"+details +"',"+total +",' sysdate()')",conn);
            SqlCommand cmd1 = new SqlCommand("insert into order_details (user_id,ven_id,details,total) values('" + main_user + "','" + ven_id + "','" + det + "','" + tott + "')", conn);
            int x = cmd1.ExecuteNonQuery();

            int y = 0;
            if (x != 0)
            {
                SqlCommand cm = new SqlCommand("select id from order_details where user_id = '" + main_user + "' and ven_id='" + ven_id + "' and details = '" + det + "' and total = '" + tot + "'", conn);
                SqlDataReader red = cm.ExecuteReader();

                while (red.Read())
                {

                    y = Convert.ToInt32(red["id"]);
                }

            }

            if (y != 0)
            {
                Response.Redirect("order_address.aspx?id=" + y);

            }
            else
            {
                price.Text = "zero";
            }
            cmd1.Dispose();
            conn.Close();*/
        }
Ejemplo n.º 4
0
        protected void checkout_Click(object sender, EventArgs e)
        {
            int result = 0;
            string det = details1.Text;
            string main_user = Session["main_name"].ToString();
            string ven_id = Session["vn"].ToString();
            string tott = price.Text;
            int tot = Convert.ToInt32(tott);
            order_details.order r = new order_details.order();
            result = r.order_enter(main_user, ven_id, det, tot);
            if (result != 0)
            {
                Response.Redirect("order_address.aspx?id=" + result);

            }
            else
            {
                price.Text = "zero";
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string ven_id = "";
            if (Session["main_vname"] != null)
            {
                ven_id = Session["main_vname"].ToString();
            }
            else
            {
                ven_id = "Plaza Catering";
            }

            int[] ab = new int[12];
            order_details.order r = new order_details.order();
            for (int i = 1; i < 13; i++)
            {
                ab[i - 1] = r.chart_ven(i, ven_id);

            }

            StringBuilder xmlData = new StringBuilder();
            xmlData.Append("<chart bgImageAlpha='30' bgImage='img1.jpg'  canvasBgAlpha='0' caption='Monthly Order Sales' xAxisName='Month' yAxisName='Amount'>");
            xmlData.Append("<set label='Jan' value='" + ab[0] + "' />");
            xmlData.Append("<set label='Feb' value='" + ab[1] + "' />");
            xmlData.Append("<set label='Mar' value='" + ab[2] + "' />");
            xmlData.Append("<set label='Apr' value='" + ab[3] + "' />");
            xmlData.Append("<set label='May' value='" + ab[4] + "' />");
            xmlData.Append("<set label='Jun' value='" + ab[5] + "' />");
            xmlData.Append("<set label='Jul' value='" + ab[6] + "' />");
            xmlData.Append("<set label='Aug' value='" + ab[7] + "' />");
            xmlData.Append("<set label='Sep' value='" + ab[8] + "' />");
            xmlData.Append("<set label='Oct' value='" + ab[9] + "' />");
            xmlData.Append("<set label='Nov' value='" + ab[10] + "' />");
            xmlData.Append("<set label='Dec' value='" + ab[11] + "' />");
            xmlData.Append("</chart>");

            Literal1.Text = FusionCharts.RenderChart("js/Column3D.swf", "", xmlData.ToString(), "myNext", "500", "300", false, true);
        }
Ejemplo n.º 6
0
        protected void submit_Click(object sender, EventArgs e)
        {
            order_details.order r = new order_details.order();
            string street1        = street.Text;
            string city1          = city.Text;
            string email1         = email.Text;
            string state1         = state.Text;
            string phone1         = phone.Text;
            int    id             = Convert.ToInt32(Request.QueryString["id"]);
            string date1          = lblbday.Text;
            string email2         = "";

            /* int x = r.address_insert(street1,email1, city1, state1, phone1, id,date1);*/
            //Declare Connection by passing the connection string from the web config file
            SqlConnection conn4 = new SqlConnection(ConfigurationManager.ConnectionStrings["dbString"].ConnectionString);

            //Open the connection
            conn4.Open();
            string yDate = Convert.ToDateTime(date1).ToString("MM-dd-yyyy");
            //SqlCommand cmd1 = new SqlCommand("UPDATE order_details SET street = '" + street + "', city = '" + city + "', state = '" + state + "', phone = '" + phone + "' where id = " + id + ")", conn);
            SqlCommand cmd1 = new SqlCommand("UPDATE order_details SET email = '" + email1 + "', street = '" + street1 + "', city = '" + city1 + "', state = '" + state1 + "' , phone = '" + phone1 + "', date = '" + yDate + "' where id = '" + id + "'", conn4);
            int        x    = cmd1.ExecuteNonQuery();


            string main_name = Session["main_name"].ToString();
            // string res_id = Session["mail_res"].ToString();
            string        ven_id = Session["vn"].ToString();
            SqlConnection conn   = new SqlConnection(ConfigurationManager.ConnectionStrings["dbString"].ConnectionString);

            //Open the connection
            conn.Open();
            string[] b = new string[10];
            // string main_vname = Session["main_vname"].ToString();
            SqlCommand    cmd = new SqlCommand("select * from vendor where vname='" + ven_id + "' ", conn);
            SqlDataReader f   = cmd.ExecuteReader();


            while (f.Read())
            {
                email2 = f["vemail"].ToString();
            }
            if (x != 0)
            {
                Label1.Visible = true;
                //Label1.Text = "Success";

                //Email to User
                string message1 = "Your Order has been successfully Placed.";

                var          fromAddress  = new MailAddress("*****@*****.**", "Occasions on the Go");
                var          toAddress    = new MailAddress(email1, "To Name");
                const string fromPassword = "******";
                const string subject      = "Your Order Confirmation from Occasions On The Go";
                string       body         = message1;

                var smtp = new SmtpClient
                {
                    Host           = "smtp.gmail.com",
                    Port           = 587,
                    EnableSsl      = true,
                    DeliveryMethod = SmtpDeliveryMethod.Network,
                    Credentials    = new NetworkCredential(fromAddress.Address, fromPassword),
                    Timeout        = 20000
                };
                using (var message = new MailMessage(fromAddress, toAddress)
                {
                    Subject = subject,
                    Body = body
                })
                {
                    smtp.Send(message);
                }
                //Email to Vendor

                string message2 = "A new Order has been placed. Please Login to your profile to process the order";

                var          fromAddress1  = new MailAddress("*****@*****.**", "Occasions on the Go");
                var          toAddress1    = new MailAddress(email2, "To Name");
                const string fromPassword1 = "aseproject";
                const string subject1      = "New order from Occasions on the Go";
                string       body1         = message2;

                var smtp1 = new SmtpClient
                {
                    Host           = "smtp.gmail.com",
                    Port           = 587,
                    EnableSsl      = true,
                    DeliveryMethod = SmtpDeliveryMethod.Network,
                    Credentials    = new NetworkCredential(fromAddress1.Address, fromPassword1),
                    Timeout        = 20000
                };
                using (var message = new MailMessage(fromAddress, toAddress)
                {
                    Subject = subject1,
                    Body = body1
                })
                {
                    smtp.Send(message);
                }

                Response.Redirect("order_success.aspx");
                cmd1.Dispose();
                conn4.Close();
            }
            else if (x == 0)
            {
                Label1.Visible = true;
                Label1.Text    = "Placing order failed !! Please retry after sometime !!";
            }


            cmd.Dispose();
            conn.Close();


            //Response.Redirect("order_success.aspx");
        }
        protected void submit_Click(object sender, EventArgs e)
        {
            order_details.order r = new order_details.order();
            string street1 = street.Text;
            string city1 = city.Text;
            string email1 = email.Text;
            string state1 = state.Text;
            string phone1 = phone.Text;
            int id = Convert.ToInt32(Request.QueryString["id"]);
            string date1 = lblbday.Text;
            string email2 = "";

               /* int x = r.address_insert(street1,email1, city1, state1, phone1, id,date1);*/
            //Declare Connection by passing the connection string from the web config file
            SqlConnection conn4 = new SqlConnection(ConfigurationManager.ConnectionStrings["dbString"].ConnectionString);
            //Open the connection
            conn4.Open();
            string yDate = Convert.ToDateTime(date1).ToString("MM-dd-yyyy");
            //SqlCommand cmd1 = new SqlCommand("UPDATE order_details SET street = '" + street + "', city = '" + city + "', state = '" + state + "', phone = '" + phone + "' where id = " + id + ")", conn);
            SqlCommand cmd1 = new SqlCommand("UPDATE order_details SET email = '" + email1 + "', street = '" + street1 + "', city = '" + city1 + "', state = '" + state1 + "' , phone = '" + phone1 + "', date = '" + yDate + "' where id = '" + id + "'", conn4);
            int x = cmd1.ExecuteNonQuery();

            string main_name = Session["main_name"].ToString();
               // string res_id = Session["mail_res"].ToString();
            string ven_id = Session["vn"].ToString();
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbString"].ConnectionString);
            //Open the connection
            conn.Open();
            string[] b = new string[10];
               // string main_vname = Session["main_vname"].ToString();
            SqlCommand cmd = new SqlCommand("select * from vendor where vname='" + ven_id + "' ", conn);
            SqlDataReader f = cmd.ExecuteReader();

            while (f.Read())
            {

                email2 = f["vemail"].ToString();

            }
            if (x != 0)
            {
                Label1.Visible = true;
                //Label1.Text = "Success";

                //Email to User
                string message1 = "Your Order has been successfully Placed.";

                var fromAddress = new MailAddress("*****@*****.**", "Occasions on the Go");
                var toAddress = new MailAddress(email1, "To Name");
                const string fromPassword = "******";
                const string subject = "Your Order Confirmation from Occasions On The Go";
                string body = message1;

                var smtp = new SmtpClient
                {
                    Host = "smtp.gmail.com",
                    Port = 587,
                    EnableSsl = true,
                    DeliveryMethod = SmtpDeliveryMethod.Network,
                    Credentials = new NetworkCredential(fromAddress.Address, fromPassword),
                    Timeout = 20000
                };
                using (var message = new MailMessage(fromAddress, toAddress)
                {
                    Subject = subject,
                    Body = body
                })
                {
                    smtp.Send(message);
                }
                //Email to Vendor

                string message2 = "A new Order has been placed. Please Login to your profile to process the order";

                var fromAddress1 = new MailAddress("*****@*****.**", "Occasions on the Go");
                var toAddress1 = new MailAddress(email2, "To Name");
                const string fromPassword1 = "aseproject";
                const string subject1 = "New order from Occasions on the Go";
                string body1 = message2;

                var smtp1 = new SmtpClient
                {
                    Host = "smtp.gmail.com",
                    Port = 587,
                    EnableSsl = true,
                    DeliveryMethod = SmtpDeliveryMethod.Network,
                    Credentials = new NetworkCredential(fromAddress1.Address, fromPassword1),
                    Timeout = 20000
                };
                using (var message = new MailMessage(fromAddress, toAddress)
                {
                    Subject = subject1,
                    Body = body1
                })
                {
                    smtp.Send(message);
                }

                Response.Redirect("order_success.aspx");
                cmd1.Dispose();
                conn4.Close();

            }
            else if (x == 0)
            {
                Label1.Visible = true;
                Label1.Text = "Placing order failed !! Please retry after sometime !!";
            }

            cmd.Dispose();
            conn.Close();

            //Response.Redirect("order_success.aspx");
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string venid = "";
            if (Session["main_vname"] != null)
            {
                venid = Session["main_vname"].ToString();
            }
            order_details.order r = new order_details.order();
            ArrayList b = new ArrayList(r.ven_order(venid));
            ArrayList c = new ArrayList();
            c = (ArrayList)b;

            string[,] data = new string[100, 6];

            int iterator = 0;

            foreach (string d in c)
            {

                string[] row = d.Split('#');

                int ab = row.Length;

                data[iterator, 0] = row[0];

                data[iterator, 1] = row[1];

                data[iterator, 2] = row[2];

                data[iterator, 3] = row[3];

                data[iterator, 4] = row[4];

                /* data[iterator, 5] = row[5];*/

                iterator++;

            }

            DataTable newsDataTable = new DataTable();

            // add some columns to our datatable

            newsDataTable.Columns.Add("user_id");

            newsDataTable.Columns.Add("date");

            newsDataTable.Columns.Add("price");

            newsDataTable.Columns.Add("id");

            // adding new rows

            for (int i = 0; i < iterator; i++)
            {

                DataRow newsDataRow = newsDataTable.NewRow();

                newsDataRow["user_id"] = data[i, 0];

                newsDataRow["price"] = data[i, 2];

                newsDataRow["date"] = data[i, 3];

                newsDataRow["id"] = data[i, 4];

                newsDataTable.Rows.Add(newsDataRow);

            }

            // bind our datatable to our repeater

            details.DataSource = newsDataTable;

            details.DataBind();
        }