예제 #1
0
        public async Task <IActionResult> PutLocalTraderOrderDetails(int id, LocalTraderOrderDetailsVM ltodvm)
        {
            if (id != ltodvm.Local_Trader_Order_ID)
            {
                return(BadRequest());
            }

            Local_Trader_Order_Details ltod = new Local_Trader_Order_Details();

            ltod.Local_Trader_Order_ID = Convert.ToInt32(ltodvm.Local_Trader_Order_ID);

            //pc.Product_Category_Name = pcvm.Product_Category_Name;

            db.Entry(ltod).State = EntityState.Modified;
            await db.SaveChangesAsync();

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Local_Trader_Order_DetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <Local_Trader_Order_Details> > PostLocalTraderOrderDetails([FromBody] LocalTraderOrderDetailsVM ltodvm)
        {
            Local_Trader_Order_Details ltod = new Local_Trader_Order_Details();

            ltod.Local_Trader_Order_ID = Convert.ToInt32(ltodvm.Local_Trader_Order_ID);
            //pc.Product_Category_Name = pcvm.Product_Category_Name;

            db.Local_Trader_Order_Details.Add(ltod);


            await db.SaveChangesAsync();

            return(Ok());
        }