public async Task <IActionResult> Edit(int id, [Bind("CompanyId,DeptName,ParentId,DeptCode,DepteType,DeptLevel,DeleteFlag,RecordMan,RecordDate,UpdateMan,UpdateDate,CheckMan,CheckDate,Id")] BaseDeparment baseDeparment) { if (id != baseDeparment.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(baseDeparment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BaseDeparmentExists(baseDeparment.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CompanyId"] = new SelectList(_context.BaseCompany, "Id", "CompanyName", baseDeparment.CompanyId); return(View(baseDeparment)); }
public async Task <IActionResult> Create([Bind("CompanyId,DeptName,ParentId,DeptCode,DepteType,DeptLevel,DeleteFlag,RecordMan,RecordDate,UpdateMan,UpdateDate,CheckMan,CheckDate,Id")] BaseDeparment baseDeparment) { if (ModelState.IsValid) { _context.Add(baseDeparment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CompanyId"] = new SelectList(_context.BaseCompany, "Id", "CompanyName", baseDeparment.CompanyId); return(View(baseDeparment)); }
public TableData getSysUserList(Param param, BaseDeparment dept) { throw new NotImplementedException(); }