예제 #1
0
 public IActionResult CreateField(OneToOneField field)
 {
     if (ModelState.IsValid)
     {
         fieldManager.CreateField(field);
     }
     return(View("Index", GetRoleIndexViewModel()));
 }
예제 #2
0
        public bool EditField(OneToOneField field)
        {
            OneToOneField possiblevalue = _context.OneToOneFields.Where(v => v.OneToOneFieldId == field.OneToOneFieldId).FirstOrDefault();

            possiblevalue.Type        = field.Type;
            possiblevalue.Description = field.Description;
            possiblevalue.Name        = field.Name;

            _context.Update(possiblevalue);
            _context.SaveChanges();
            return(true);
        }
예제 #3
0
 /// <summary>
 /// This makes a dynamic field
 /// </summary>
 /// <param name="field">The field they want to add</param>
 /// <returns>True if it was successful, false if not successful.</returns>
 public bool CreateField(OneToOneField field)
 {
     try
     {
         _context.OneToOneFields.Add(field);
         _context.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
예제 #4
0
        public IActionResult EditField(int onetoonefieldid)
        {
            OneToOneField field = _context.OneToOneFields.Where(v => v.OneToOneFieldId == onetoonefieldid).FirstOrDefault();

            return(View(field));
        }