Пример #1
0
        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));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
 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));
        }