Exemple #1
0
        private async void FoodGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            Food f = e.ClickedItem as Food;

            var contentDialog = new ContentDialog()
            {
                Content           = new FoodDialog(f),
                PrimaryButtonText = "确定",
                FullSizeDesired   = false
            };

            contentDialog.Style = transparent;

            contentDialog.Closed += async(_s, _e) =>
            {
                await FoodGrid.Blur(value : 0, duration : 0, delay : 0).StartAsync();

                contentDialog.Hide();
            };

            contentDialog.PrimaryButtonClick += async(_s, _e) =>
            {
                await FoodGrid.Blur(value : 0, duration : 0, delay : 0).StartAsync();

                contentDialog.Hide();
            };
            await FoodGrid.Blur(value : 7, duration : 100, delay : 0).StartAsync();

            await contentDialog.ShowAsync();
        }
    protected void showFoodStation(object sender, EventArgs e)
    {
        localhost.WebService food = new localhost.WebService();

        FoodGrid.DataSource = food.getFoodStation();
        FoodGrid.DataBind();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            Hotel.Text = Session["Hname"] as string;
            //Debug.Text = "Hi";
            if (!IsPostBack)
            {
                Hotel.Text = Session["Hname"] as string;
                int x = Convert.ToInt32(Session["HotelId"]);
                //Debug.Text = x.ToString()+x.GetType().ToString();


                //"SELECT \"food_name\" as \"Food Name\" ,\"menu_type\" as \"Availability\",\"price\" as \"Price(tk)\" FROM FOOD WHERE \"hotel_id\"= " + hotelID;
                string queryHotel = "SELECT \"food_id\" as \"ID\" ,\"food_name\" as \"Food Name\" ,\"menu_type\" as \"Availability\",\"price\" as \"Price(tk)\" FROM FOOD WHERE \"hotel_id\"= " + x;
                FoodDataSource.SelectCommand     = queryHotel;
                FoodDataSource.SelectCommandType = SqlDataSourceCommandType.Text;
                DataView foods = FoodDataSource.Select(DataSourceSelectArguments.Empty) as DataView;


                FoodGrid.DataSource   = foods;
                FoodGrid.DataSourceID = null;
                FoodGrid.DataBind();
            }


            /*
             * if (!IsPostBack)
             * {
             *  if (Request.QueryString["key"] != null)
             *  {
             *      DropDownListTime.SelectedValue = QueryString["key"];
             *  }
             *
             *  BindData();
             *
             * }
             */

            /*
             *
             * string queryHotel = "SELECT \"food_name\" ,\"menu_type\" ,\"price\" FROM FOOD WHERE \"hotel_id\"= " + hotelID;
             * sadf.SelectCommand = queryHotel;
             * SqlDataSource2.SelectCommandType = SqlDataSourceCommandType.Text;
             * DataView foods = SqlDataSource1.Select(DataSourceSelectArguments.Empty) as DataView;
             *
             *
             *             DropDownList1.AutoPostBack = true;
             * DropDownList1.DataSource = deptList;
             * //DropDownList1.DataSourceID = null;
             *
             * DropDownList1.DataTextField = "Deptname";
             * DropDownList1.DataValueField = "Deptid";
             * DropDownList1.DataBind();*/
        }
Exemple #4
0
        protected void FillFoodItems(object sender, EventArgs e)
        {
            myDAL     objmyDAL = new myDAL();
            DataTable GetData  = new DataTable();
            int       AdminID  = (int)Session["ID"];

            objmyDAL.AdminFoodsList(AdminID, ref GetData);

            FoodGrid.DataSource = GetData;
            if (GetData.Rows.Count > 0)
            {
                FoodGrid.DataBind();
            }
        }
 /// <summary>
 /// Fill record into GridView
 /// </summary>
 public void FillGridView()
 {
     FoodGrid.DataSource = Get_Food();
     FoodGrid.DataBind();
 }