コード例 #1
0
        public ActionResult Edit(Sellers model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.Entry(model).State = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();

                    return RedirectToAction("Index");
                }
                return View();
            }
            catch (Exception ex)
            {
                return View();
            }
        }
コード例 #2
0
        public ActionResult Create(Sellers model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    // TODO: Add insert logic here
                    db.Sellers.Add(model);
                    db.SaveChanges();

                    return RedirectToAction("Index");
                }
                return View();

            }
            catch (Exception ex)
            {
                return View();
            }
        }
コード例 #3
0
        public ActionResult Delete(Sellers model)
        {
            try
            {
                // TODO: Add delete logic here
                db.Entry(model).State = System.Data.Entity.EntityState.Deleted;
                db.SaveChanges();

                return RedirectToAction("Index");

            }
            catch (Exception ex)
            {
                return View();
            }
        }