public async Task <IActionResult> Create([Bind("ID,CreationDate,Name,FamilyName,E_Mail,UserID,Visible")] Profile profile) { if (ModelState.IsValid) { _context.Add(profile); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(profile)); }
public async Task <IActionResult> Create([Bind("ID,Title,CreationDate,ValidFromDate,ValidTillDate,Text,Visible,BelongsToAssocID")] Document document) { if (ModelState.IsValid) { _context.Add(document); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(document)); }
public async Task <IActionResult> Create([Bind("ID,CreationDate,Name,ShortName")] Association association) { if (ModelState.IsValid) { _context.Add(association); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(association)); }
private void Registration() { db.Add(new User() { Surname = textBoxSurname.Text, Login = textBoxLogin.Text, Email = textBoxEmail.Text, Password = textBoxPassword.Password, Name = textBoxName.Text, Role = 1 }); db.SaveChanges(); }
public async Task <IActionResult> Create(List <IFormFile> file, [FromForm] string titulo, [FromForm] string processo, [FromForm] string categoria, Documents documents) { if (ModelState.IsValid) { this.convertFileByte(file, titulo, processo, categoria, documents); _context.Add(documents); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(documents)); }