public Int32 postItemPrice()
        {
            try
            {
                Data.MstItemPrice newItemPrice = new Data.MstItemPrice();
                newItemPrice.ItemId           = ItemId();
                newItemPrice.PriceDescription = "n/a";
                newItemPrice.Price            = 0;
                newItemPrice.TriggerQuantity  = 0;
                db.MstItemPrices.InsertOnSubmit(newItemPrice);
                db.SubmitChanges();

                return(newItemPrice.Id);
            }
            catch (Exception e)
            {
                return(0);
            }
        }
        public HttpResponseMessage postItemPrice(Entities.MstItemPrice itemPrice)
        {
            try
            {
                Data.MstItemPrice newItemPrice = new Data.MstItemPrice();
                newItemPrice.ItemId           = itemPrice.ItemId;
                newItemPrice.PriceDescription = itemPrice.PriceDescription;
                newItemPrice.Price            = itemPrice.Price;
                newItemPrice.TriggerQuantity  = itemPrice.TriggerQuantity;
                db.MstItemPrices.InsertOnSubmit(newItemPrice);
                db.SubmitChanges();

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Something's wrong from the server."));
            }
        }
Exemplo n.º 3
0
        public int Post(Models.MstItemPrice itemPrice)
        {
            try
            {

                Data.MstItemPrice newItemPrice = new Data.MstItemPrice();

                newItemPrice.ItemId = itemPrice.ItemId;
                newItemPrice.PriceDescription = itemPrice.PriceDescription;
                newItemPrice.Price = itemPrice.Price;
                newItemPrice.TriggerQuantity = itemPrice.TriggerQuantity;

                db.MstItemPrices.InsertOnSubmit(newItemPrice);
                db.SubmitChanges();

                return newItemPrice.Id;
            }
            catch
            {
                return 0;
            }
        }