Beispiel #1
0
        protected void gvMenu_RowEditing(object sender, GridViewEditEventArgs e)
        {
            GridViewRow row         = (GridViewRow)gvMenu.Rows[e.NewEditIndex];
            string      menuitem_id = gvMenu.DataKeys[row.RowIndex].Value.ToString();

            Menu_Item item = new Menu_Item();

            //FileUpload fileUpload = row.Cells[0].Controls[0] as FileUpload;
            //item.image = fileUpload.FileBytes;

            TextBox txtTitle = row.Cells[0].FindControl("title") as TextBox;

            item.title = txtTitle.Text;

            TextBox txtDescription = row.Cells[1].FindControl("description") as TextBox;

            item.description = txtDescription.Text;

            TextBox txtPrice = row.Cells[2].FindControl("price") as TextBox;

            item.price = float.Parse(txtPrice.Text);

            item.UpdateMenuItem(menuitem_id);

            DataSet dataSet = fooddeliverylibrary.Menu.GetMenu(Session["username"].ToString());

            gvMenu.DataSource = dataSet;
            gvMenu.DataBind();
        }