Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //int id = Convert.ToInt32(txtItemId.Text);
                string name = txtItemName.Text;
                string type = txtCategoryName.Text;

                int price = Convert.ToInt32(txtPrice.Text);
                //price = price / 100;
                //string roast = txtRoast.Text;
                //string country = txtCountry.Text;
                string image       = "/Images/" + ddlImage.SelectedValue;
                string description = txtDescription.Text;
                int    selectionId = Convert.ToInt32(txtSelectionId.Text);


                Item item = new Item(name, type, price, image, description, selectionId);
                ConnectionClass.AddItem(item);
                lblResult.Text = "Upload succesful!";
                ClearTextFields();
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc);
                lblResult.Text = "Upload failed!";
            }
        }