Exemplo n.º 1
0
 protected void UpdatePrice_Click(object sender, EventArgs e)
 {
     try
     {
         double price = Convert.ToDouble(Price.Text);
         if (price < 0)
         {
             InvalidSelectionError();
         }
         else
         {
             Products product = ProductsDA.GetProductByID(Convert.ToInt32(MenuItemID.Text));
             product.ProductPrice = price;
             ProductsDA.UpdateProduct(product);
             Price.Text         = "";
             MenuItemID.Text    = "";
             MenuItemName.Text  = "";
             PriceTable.Visible = false;
             ItemTable.Visible  = false;
         }
     }
     catch (Exception ex)
     {
         InvalidSelectionError();
     }
 }
        public HttpResponseMessage Put(Product c)
        {
            ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;

            ProductsDA.UpdateProduct(c, p.Claims);

            return(new HttpResponseMessage(HttpStatusCode.OK));
        }