Ejemplo n.º 1
0
        /// <summary>
        /// Load the order and order lines to the fields.
        /// </summary>
        /// <returns>Returns a service result.</returns>
        private ServiceResult LoadData()
        {
            SvcKitchen.SvcKitchenSoapClient svc = new SvcKitchen.SvcKitchenSoapClient();
            SvcKitchen.ServiceResult        result;
            try
            {
                order               = Session["Order"] as Order;
                lblOrderID.Text     = order.ID.ToString();
                txtAddress.Text     = order.DeliveryAddress;
                txtPhoneNumber.Text = order.PhoneNumber;

                cboMeals.DataSource     = svc.GetMeals(out result);
                cboMeals.DataValueField = "ID";
                cboMeals.DataTextField  = "Name";
                cboMeals.DataBind();


                gvOrderLines.DataSource = svc.GetOrderLines(order.ID, out result);
                gvOrderLines.DataBind();

                return(result);
            }
            catch
            {
                lblStatus.ForeColor = System.Drawing.Color.DarkRed;
                lblStatus.Text      = "Oh no... Looks like it failed to load the page correctly.";
                return(new ServiceResult());
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads the meals and displays them.
        /// </summary>
        private void LoadMeals()
        {
            SvcKitchen.SvcKitchenSoapClient svc    = new SvcKitchen.SvcKitchenSoapClient();
            SvcKitchen.ServiceResult        result = new SvcKitchen.ServiceResult();

            gvMeals.DataSource = svc.GetMeals(out result);
            gvMeals.DataBind();
            lblInfo.DisplayResult(result);
        }