Beispiel #1
0
        public ActionResult CreateDefinition(DefinitionModel model)
        {
            Definition target = new Definition();
            target.displayName = model.displayName;
            target.keyName = model.keyName;
            target.keyValue = model.keyValue;
            target.keyGroup = model.keyGroup;
            target.sequence = model.sequence;
            db.Definitions.Add(target);
            db.SaveChanges();

            return RedirectToAction("Index", "System");
        }
Beispiel #2
0
 public ActionResult Definition_Update([DataSourceRequest] DataSourceRequest request, DefinitionModel model)
 {
     if (model != null && ModelState.IsValid)
     {
         {
             var target = db.Definitions.Find(model.definitionId);
             target.displayName = model.displayName;
             target.keyName = model.keyName;
             target.keyValue = model.keyValue;
             target.keyGroup = model.keyGroup;
             target.sequence = model.sequence;
             db.Entry(target).State = EntityState.Modified;
             db.SaveChanges();
         }
     }
     return Json(ModelState.ToDataSourceResult());
 }
Beispiel #3
0
        public ActionResult Create(DefinitionModel model)
        {
            if (ModelState.IsValid)
            {
                Definition target = new Definition();
                target.displayName = model.displayName;
                target.keyName = model.keyName;
                target.keyValue = model.keyValue;
                target.keyGroup = model.keyGroup;
                if (model.sequence == null || model.sequence < 1)
                {
                    model.sequence = 1;
                }
                target.sequence = model.sequence;
                db.Definitions.Add(target);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(model);
        }