public async Task <IActionResult> Create([Bind("Id,Status_name")] Status status) { if (ModelState.IsValid) { _context.Add(status); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(status)); }
public async Task <IActionResult> Create([Bind("Id,Name_comment")] TypeComment typeComment) { if (ModelState.IsValid) { _context.Add(typeComment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typeComment)); }
public async Task <IActionResult> Create([Bind("Id,Surname,Name,Second_Name,Employee_Number")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Create([Bind("Id,Name_Role")] Role role) { if (ModelState.IsValid) { _context.Add(role); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(role)); }
public async Task <IActionResult> Create([Bind("Id,Path_File,File_Detail,TaskDistributionId")] FileTask fileTask) { if (ModelState.IsValid) { _context.Add(fileTask); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TaskDistributionId"] = new SelectList(_context.TaskDistributions, "Id", "View", fileTask.TaskDistributionId); return(View(fileTask)); }
public async Task <IActionResult> Create([Bind("Id,EmployeeId,PositionId")] Plurality plurality) { if (ModelState.IsValid) { _context.Add(plurality); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmployeeId"] = new SelectList(_context.Employees, "Id", "View", plurality.EmployeeId); ViewData["PositionId"] = new SelectList(_context.Positions, "Id", "View", plurality.PositionId); return(View(plurality)); }
public async Task <IActionResult> Create([Bind("Id,Give_out,RoleId,FunctionId")] Right right) { if (ModelState.IsValid) { _context.Add(right); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FunctionId"] = new SelectList(_context.Functions, "Id", "Name_function", right.FunctionId); ViewData["RoleId"] = new SelectList(_context.Roles, "Id", "Name_Role", right.RoleId); return(View(right)); }
public async Task <IActionResult> Create([Bind("Id,Text_comment,Type_CommentsId,TaskDistributionsId")] TaskComment taskComment) { if (ModelState.IsValid) { _context.Add(taskComment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TaskDistributionsId"] = new SelectList(_context.TaskDistributions, "Id", "View", taskComment.TaskDistributionsId); ViewData["Type_CommentsId"] = new SelectList(_context.TypeComments, "Id", "Name_comment", taskComment.Type_CommentsId); return(View(taskComment)); }
public async Task <IActionResult> Create([Bind("Task_Name,Task_Detail,Date_Open,Date_Close,ZadachiParentId,StatusId")] Zadachi zadachi) { _context.Statuses.Load(); if (ModelState.IsValid) { _context.Add(zadachi); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StatusId"] = new SelectList(_context.Statuses, "Id", "Status_name", zadachi.StatusId); ViewData["ZadachiParentId"] = new SelectList(_context.Zadachis, "Id", "View", zadachi.ZadachiParentId); return(View(zadachi)); }
public async Task <IActionResult> Create([Bind("Id,StartedAt,PeriodUnit,PeriodValue,PluralityId,ZadachiId,StatusId")] TaskDistribution taskDistribution) { if (ModelState.IsValid) { _context.Add(taskDistribution); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } _context.Zadachis.Load(); _context.Employees.Load(); _context.Positions.Load(); ViewData["PluralityId"] = new SelectList(_context.Plurality, "Id", "View", taskDistribution.PluralityId); ViewData["StatusId"] = new SelectList(_context.Statuses, "Id", "Status_name", taskDistribution.StatusId); ViewData["ZadachiId"] = new SelectList(_context.Zadachis, "Id", "View", taskDistribution.ZadachiId); return(View(taskDistribution)); }
public async Task <IActionResult> Create([Bind("Id,Login,Password,Date_Create,Phone_Number,Email,RightsId,PluralityId")] Account account) { if (ModelState.IsValid) { _context.Add(account); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } _context.Roles.Load(); _context.Functions.Load(); _context.Employees.Load(); _context.Positions.Load(); ViewData["PluralityId"] = new SelectList(_context.Plurality, "Id", "View", account.PluralityId); ViewData["RightsId"] = new SelectList(_context.Rights, "Id", "View", account.RightsId); return(View(account)); }