public void CreateOrder(float orderPrice)
        {
            CustomerObj currentCustomer = (CustomerObj)Session["currentCustomer"];

            name  = currentCustomer.getName();
            email = currentCustomer.getEmailAddress();
            objCommand.Parameters.Clear();
            objCommand.CommandType = CommandType.StoredProcedure;
            objCommand.CommandText = "Tp_NewOrder";
            DateTime     date           = DateTime.Today;
            SqlParameter inputName      = new SqlParameter("@OrderName", name);
            SqlParameter inputEmail     = new SqlParameter("@UserEmail", email);
            SqlParameter inputRestEmail = new SqlParameter("@RestaurantEmail", restaurantID);
            SqlParameter inputCost      = new SqlParameter("@OrderCost", orderPrice);
            SqlParameter outputID       = new SqlParameter("@OrderID", 1);

            outputID.Direction = ParameterDirection.Output;
            outputID.SqlDbType = SqlDbType.Int;

            objCommand.Parameters.Add(inputName);
            objCommand.Parameters.Add(inputEmail);
            objCommand.Parameters.Add(inputRestEmail);
            objCommand.Parameters.Add(inputCost);
            objCommand.Parameters.Add(outputID);
            db.DoUpdateUsingCmdObj(objCommand);
            orderID            = int.Parse(objCommand.Parameters["@OrderID"].Value.ToString());
            Session["OrderID"] = orderID;
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CustomerObj currentCustomer = (CustomerObj)Session["currentCustomer"];
         txtId.Text              = currentCustomer.getCustomerId();
         txtPassword.Text        = currentCustomer.getPassword();
         txtEmail.Text           = currentCustomer.getEmailAddress();
         txtBillingAddress.Text  = currentCustomer.getBillingAddress();
         txtDeliveryAddress.Text = currentCustomer.getDeliveryAddress();
         txtName.Text            = currentCustomer.getName();
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CustomerObj currentCustomer = (CustomerObj)Session["currentCustomer"];

            lblWelcome.Text = "<h1>Welcome " + currentCustomer.getName() + "!</h1>";
            if (!IsPostBack)
            {
                objCommand.Parameters.Clear();
                objCommand.CommandType = CommandType.StoredProcedure;
                objCommand.CommandText = "TP_GetRestaurants";
                dsRest             = db.GetDataSetUsingCmdObj(objCommand);
                rptRest.DataSource = dsRest;
                rptRest.DataBind();
            }
        }