Exemplo n.º 1
0
        public async Task <HttpResponseMessage> GetAllPrincipals([FromUri] SchoolBaseReq req)
        {
            var obj = await employeeBE.GetAllPrincipals(req);

            if (obj != null)
            {
                return(this.OkResult(obj));
            }

            return(this.ErrorResult(new Error(EnumError.EmployeeNotExist)));
        }
Exemplo n.º 2
0
        public async Task <List <SchoolDepartment> > GetBySchoolId(SchoolBaseReq req)
        {
            var obj = await GetAsync(c => c.SchoolId == req.SchoolId);

            if (obj != null &&
                obj.Any())
            {
                return(obj.ToList());
            }

            return(null);
        }
Exemplo n.º 3
0
        public async Task <School> GetById(SchoolBaseReq req)
        {
            var obj = await GetAsync(c => c.SchoolId == req.SchoolId);

            if (obj != null &&
                obj.Any())
            {
                return(obj.FirstOrDefault());
            }

            return(null);
        }
        public async Task <HttpResponseMessage> GetBySchoolId([FromUri] SchoolBaseReq req)
        {
            var objs = await SchoolDepartmentBE.GetBySchoolId(req);

            if (objs != null &&
                objs.Any())
            {
                return(this.OkResult(objs));
            }

            return(this.ErrorResult(new Error(EnumError.DataNotFound)));
        }
Exemplo n.º 5
0
 public async Task <List <Employee> > GetAllPrincipals(SchoolBaseReq req)
 {
     return((await GetAsync(p => p.SchoolId == req.SchoolId &&
                            (p.UserGroupCode == EnumUserGroup.SubSchoolPrimary || p.UserGroupCode == EnumUserGroup.SchoolPrimary)
                            ))?.ToList());
 }