Ejemplo n.º 1
0
        public IActionResult Post([FromBody] Models.Sortimat.Sh1PickAndPlace5220PerBatchPerCycle item)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (item == null)
                {
                    return(BadRequest());
                }

                this.OnSh1PickAndPlace5220PerBatchPerCycleCreated(item);
                this.context.Sh1PickAndPlace5220PerBatchPerCycles.Add(item);
                this.context.SaveChanges();

                return(Created($"odata/Sortimat/Sh1PickAndPlace5220PerBatchPerCycles/{item.RowID}", item));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 2
0
        public IActionResult PutSh1PickAndPlace5220PerBatchPerCycle(int key, [FromBody] Models.Sortimat.Sh1PickAndPlace5220PerBatchPerCycle newItem)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (newItem == null || (newItem.RowID != key))
                {
                    return(BadRequest());
                }

                this.OnSh1PickAndPlace5220PerBatchPerCycleUpdated(newItem);
                this.context.Sh1PickAndPlace5220PerBatchPerCycles.Update(newItem);
                this.context.SaveChanges();

                var itemToReturn = this.context.Sh1PickAndPlace5220PerBatchPerCycles.Where(i => i.RowID == key);
                return(new ObjectResult(SingleResult.Create(itemToReturn)));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 3
0
 partial void OnSh1PickAndPlace5220PerBatchPerCycleUpdated(Models.Sortimat.Sh1PickAndPlace5220PerBatchPerCycle item);