public JsonResult GetDepartmentById() { string dId = HttpContext.Session.GetString("UpdateId"); DepartmentOutput departmentOutput = _departmentManageService.GetDepartmentById(dId); HttpContext.Session.Remove("UpdateId"); return(Json(departmentOutput)); }
public async Task<IHttpActionResult> CreateProxyUser(DepartmentOutput input) { AuthRepository _repo = new AuthRepository(); await _repo.RegisterUser(new RegisterViewModel() { Email = input.Name, Password = input.Password}); return Ok(); }
public DepartmentOutput GetDepartmentById(string id) { IQueryable <DepartmentInfo> departmentInfos = _dbContext.Set <DepartmentInfo>(); DepartmentOutput department = (from d in departmentInfos where d.DepartmentId == id select new DepartmentOutput { Id = d.Id, DepartmentId = d.DepartmentId, DepartmentName = d.DepartmentName, LeaderId = d.LeaderId, ParentId = d.ParentId, Description = d.Description }).OrderBy(o => o.Id).FirstOrDefault(); return(department); }