Esempio n. 1
0
        public IHttpActionResult PostQutationDetailsTableList(List <QutationDetailsTable> ListqutationDetailsTable)
        {
            QutationDetailsEntities db = new QutationDetailsEntities();

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            foreach (QutationDetailsTable List in ListqutationDetailsTable)
            {
                QutationDetailsTable existing = db.QutationDetailsTables.Find(List.ItemId);
                existing.Description = List.Description;
                existing.Quantity    = List.Quantity;
                existing.Rate        = List.Rate;
                existing.Total       = Convert.ToDouble(List.Total);
            }

            //db.QutationDetailsTables.Add(LsitqutationDetailsTable);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = "" }, ListqutationDetailsTable));
        }