示例#1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            LoaPriceComponent loaPriceComponent = await db.LoaPriceComponents.FindAsync(id);

            db.LoaPriceComponents.Remove(loaPriceComponent);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "ID,LoaPackageId,Name,Price")] LoaPriceComponent loaPriceComponent)
        {
            if (ModelState.IsValid)
            {
                db.Entry(loaPriceComponent).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.LoaPackageId = new SelectList(db.LoaPackages, "ID", "No", loaPriceComponent.LoaPackageId);
            return(View(loaPriceComponent));
        }
示例#3
0
        // GET: LoaPriceComponents/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LoaPriceComponent loaPriceComponent = await db.LoaPriceComponents.FindAsync(id);

            if (loaPriceComponent == null)
            {
                return(HttpNotFound());
            }
            return(View(loaPriceComponent));
        }
示例#4
0
        // GET: LoaPriceComponents/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LoaPriceComponent loaPriceComponent = await db.LoaPriceComponents.FindAsync(id);

            if (loaPriceComponent == null)
            {
                return(HttpNotFound());
            }
            ViewBag.LoaPackageId = new SelectList(db.LoaPackages, "ID", "No", loaPriceComponent.LoaPackageId);
            return(View(loaPriceComponent));
        }