Beispiel #1
0
 public ActionResult Edit(AllyGradeView view)
 {
     if (ModelState.IsValid)
     {
         tbAllyGrade tballygrade = new tbAllyGrade();// ViewModelConvert.ConvertViewToModel(view);
         db.Entry(tballygrade).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(view));
 }
Beispiel #2
0
        //
        // GET: /AllyGrade/Edit/5

        public ActionResult Edit(int id = 0)
        {
            tbAllyGrade tballygrade = db.tbAllyGrade.Find(id);

            if (tballygrade == null)
            {
                return(HttpNotFound());
            }
            AllyGradeView model = new AllyGradeView();// ViewModelConvert.ConvertViewToModel(tballygrade);

            return(View(model));
        }
Beispiel #3
0
        public ActionResult Create(AllyGradeView view)
        {
            if (ModelState.IsValid)
            {
                tbAllyGrade tballygrade = new tbAllyGrade();// ViewModelConvert.ConvertViewToModel(view);
                tballygrade.Is_Delete = false;
                tballygrade.Is_Hide   = false;
                db.tbAllyGrade.Add(tballygrade);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View());
        }