public async Task <IActionResult> PutDepartment(long id, DBDepartment department) { if (id != department.Iddepartment) { return(BadRequest()); } _context.Entry(department).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DepartmentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <DBDepartment> > PostDepartment(DBDepartment department) { _context.Department.Add(department); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDepartment", new { id = department.Iddepartment }, department)); }
//获取部门列表 public InterfaceOutPut Query(string data) { InterfaceOutPut output = new InterfaceOutPut(); DBDepartment d = new DBDepartment(); output.resultStr = "获取数据成功!"; output.data = d.GetDepartmentList(); return(output); }
public override void Initialize() { base.Initialize(); dbEntity = new DBDepartment(connManager); }