public IActionResult CreateField(OneToOneField field) { if (ModelState.IsValid) { fieldManager.CreateField(field); } return(View("Index", GetRoleIndexViewModel())); }
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); }
/// <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); } }
public IActionResult EditField(int onetoonefieldid) { OneToOneField field = _context.OneToOneFields.Where(v => v.OneToOneFieldId == onetoonefieldid).FirstOrDefault(); return(View(field)); }