public async Task <IActionResult> Edit(string id, [Bind("StoneQltyId,StoneQlty")] StoneQltyMst stoneQltyMst)
        {
            if (id != stoneQltyMst.StoneQltyId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stoneQltyMst);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StoneQltyMstExists(stoneQltyMst.StoneQltyId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(stoneQltyMst));
        }
        public ActionResult DeleteConfirmed(string id)
        {
            StoneQltyMst stoneQltyMst = db.StoneQltyMsts.Find(id);

            db.StoneQltyMsts.Remove(stoneQltyMst);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
 public ActionResult Edit(StoneQltyMst quality)
 {
     if (ModelState.IsValid)
     {
         db.Edit(quality);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
 public ActionResult Edit([Bind(Include = "StoneQltyId,StoneQlty,Description,StoneThumbnail")] StoneQltyMst stoneQltyMst)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stoneQltyMst).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(stoneQltyMst));
 }
        public async Task <IActionResult> Create([Bind("StoneQltyId,StoneQlty")] StoneQltyMst stoneQltyMst)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stoneQltyMst);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stoneQltyMst));
        }
        public ActionResult Create([Bind(Include = "StoneQltyId,StoneQlty,Description,StoneThumbnail")] StoneQltyMst stoneQltyMst)
        {
            stoneQltyMst.StoneQltyId = "stone" + Guid.NewGuid().ToString().GetHashCode().ToString("x");
            if (ModelState.IsValid)
            {
                db.StoneQltyMsts.Add(stoneQltyMst);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(stoneQltyMst));
        }
        // GET: Admin/StoneQltyMsts/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StoneQltyMst stoneQltyMst = db.StoneQltyMsts.Find(id);

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