Пример #1
0
        /// <summary>
        /// Populates the database with the order details
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSend_Click(object sender, EventArgs e)
        {
            string notes = orderNotes.InnerText;
            string result = "";
            Database obj = new Database();
            try
            {
                obj.Connect();

                obj.Insert("INSERT INTO Orders (OrderDetails, TotalPrice, Notes, OrderDate, Email) VALUES('" + odr.Details + "','" + odr.Price + "','" + notes + "', '" + DateTime.Now + "','"+txtEmail.Text+"');");
                obj.Close();
                result = "true";
            }
            catch (Exception ex)
            {
                result = "false";
                log.LogErrorMessage("Error creating order: " + ex);
            }
            finally
            {
                obj.Close();
            }

            Response.Redirect("~/Project.aspx?LayoutID=" + (Request.QueryString["LayoutID"]), false);
            object refUrl = ViewState["RefUrl"];
            if (refUrl != null)
                Response.Redirect((string)refUrl+"&Request="+result);
        }