Esempio n. 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            BodyOrder bodyOrder = await db.BodyOrders.FindAsync(id);

            db.BodyOrders.Remove(bodyOrder);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,HeadOrderId,ServiceId,Price,Count,Sum")] BodyOrder bodyOrder)
        {
            if (ModelState.IsValid)
            {
                db.Entry(bodyOrder).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(bodyOrder));
        }
Esempio n. 3
0
        public async Task <ActionResult> Create([Bind(Include = "Id,HeadOrderId,ServiceId,Price,Count,Sum")] BodyOrder bodyOrder)
        {
            if (ModelState.IsValid)
            {
                db.BodyOrders.Add(bodyOrder);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(bodyOrder));
        }
Esempio n. 4
0
        // GET: BodyOrders/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BodyOrder bodyOrder = await db.BodyOrders.FindAsync(id);

            if (bodyOrder == null)
            {
                return(HttpNotFound());
            }
            return(View(bodyOrder));
        }