public static Result <List <ControlAtraso.Entity.Grado> > GetAll(ControlAtraso.Entity.TipoEducacion tipoEducacion) { ControlAtraso.Result <List <ControlAtraso.Entity.Grado> > result; if (tipoEducacion.Codigo < 0) { result = new ControlAtraso.Result <List <ControlAtraso.Entity.Grado> > { Status = ControlAtraso.Status.Ok, Entity = new List <ControlAtraso.Entity.Grado>() }; return(result); } ControlAtraso.Parameters parameters = new ControlAtraso.Parameters(); string url = string.Format("{0}/Grados?anioNumero={1}&tipoEducacionCodigo={2}&rbdCuerpo={3}&rbdDigito={4}", parameters.Url, DateTime.Today.Year, (tipoEducacion == null ? "-1" : tipoEducacion.Codigo.ToString()), parameters.Rbd.Substring(0, parameters.Rbd.Length - 1), parameters.Rbd.Substring(parameters.Rbd.Length - 1, 1)); ControlAtraso.Helper h = new Helper(); result = h.Call <List <ControlAtraso.Entity.Grado> >(CallType.CallTypeGet, url); return(result); }
public static Result <List <ControlAtraso.Entity.Curso> > GetAll(ControlAtraso.Entity.Grado grado) { ControlAtraso.Parameters parameters = new ControlAtraso.Parameters(); string url = string.Format("{0}/Cursos?anioNumero={1}&rbdCuerpo={2}&rbdDigito={3}&tipoEducacionCodigo={4}&gradoCodigo={5}", parameters.Url, DateTime.Today.Year, parameters.Rbd.Substring(0, parameters.Rbd.Length - 1), parameters.Rbd.Substring(parameters.Rbd.Length - 1, 1), (grado == null ? "-1" : grado.TipoEducacionCodigo.ToString()), (grado == null ? "-1" : grado.Codigo.ToString())); ControlAtraso.Helper h = new Helper(); ControlAtraso.Result <List <ControlAtraso.Entity.Curso> > result = h.Call <List <ControlAtraso.Entity.Curso> >(CallType.CallTypeGet, url); return(result); }
public static Result <List <ControlAtraso.Entity.TipoEducacion> > GetAll() { ControlAtraso.Parameters parameters = new ControlAtraso.Parameters(); string url = string.Format("{0}/TiposEducacion?anioNumero={1}&rbdCuerpo={2}&rbdDigito={3}", parameters.Url, DateTime.Today.Year, parameters.Rbd.Substring(0, parameters.Rbd.Length - 1), parameters.Rbd.Substring(parameters.Rbd.Length - 1, 1)); ControlAtraso.Helper h = new Helper(); ControlAtraso.Result <List <ControlAtraso.Entity.TipoEducacion> > result = h.Call <List <ControlAtraso.Entity.TipoEducacion> >(CallType.CallTypeGet, url); return(result); }
public static Result <ControlAtraso.Entity.Alumno> Get(int runCuero, char runDigito) { ControlAtraso.Parameters parameters = new ControlAtraso.Parameters(); string url = string.Format("{0}/Alumno?anioNumero={1}&rbdCuerpo={2}&rbdDigito={3}&runCuerpo={4}&runDigito={5}", parameters.Url, DateTime.Today.Year, parameters.Rbd.Substring(0, parameters.Rbd.Length - 1), parameters.Rbd.Substring(parameters.Rbd.Length - 1, 1), runCuero, runDigito); ControlAtraso.Helper h = new Helper(); ControlAtraso.Result <ControlAtraso.Entity.Alumno> result = h.Call <ControlAtraso.Entity.Alumno>(CallType.CallTypeGet, url); return(result); }
public static Result <List <ControlAtraso.Entity.Alumno> > GetAll(string nombre) { ControlAtraso.Parameters parameters = new ControlAtraso.Parameters(); string url = url = string.Format("{0}/AlumnosFindName?anioNumero={1}&rbdCuerpo={2}&rbdDigito={3}&nombre={4}", parameters.Url, DateTime.Today.Year, parameters.Rbd.Substring(0, parameters.Rbd.Length - 1), parameters.Rbd.Substring(parameters.Rbd.Length - 1, 1), nombre); ControlAtraso.Helper h = new Helper(); ControlAtraso.Result <List <ControlAtraso.Entity.Alumno> > result = h.Call <List <ControlAtraso.Entity.Alumno> >(CallType.CallTypeGet, url); if (result.Entity.Count > 1) { result.Entity = result.Entity.OrderBy(x => x.Persona.Nombre).ToList <ControlAtraso.Entity.Alumno>(); } return(result); }
public static Result <List <ControlAtraso.Entity.Alumno> > GetAll(ControlAtraso.Entity.Curso curso) { if (curso == null || curso.Id.Equals(default(Guid))) { return(null); } ControlAtraso.Parameters parameters = new ControlAtraso.Parameters(); string url = string.Format("{0}/Alumnos?anioNumero={1}&rbdCuerpo={2}&rbdDigito={3}&cursoId={4}", parameters.Url, DateTime.Today.Year, parameters.Rbd.Substring(0, parameters.Rbd.Length - 1), parameters.Rbd.Substring(parameters.Rbd.Length - 1, 1), (curso == null ? default(Guid) : curso.Id)); ControlAtraso.Helper h = new Helper(); ControlAtraso.Result <List <ControlAtraso.Entity.Alumno> > result = h.Call <List <ControlAtraso.Entity.Alumno> >(CallType.CallTypeGet, url); if (result.Entity.Count > 1) { result.Entity = result.Entity.OrderBy(x => x.Persona.Nombre).ToList <ControlAtraso.Entity.Alumno>(); } return(result); }