public tInstitucion Find() { Query oQuery = new Query( "api/institution/information" ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) { throw new ArgumentNullException( "No se Encontro un El registro de la Institución", "No se Encontró Institución" ); } else if ( oQuery.ResponseStatusCode != HttpStatusCode.Found ) { throw new ArgumentNullException( "Error en el Servidor la consulta a sido detenida" ); } return JsonConvert.DeserializeObject<tInstitucion>( oQuery.ResponseContent ); } catch( Exception e ) { this.ExceptionInfo = e.Message; return null; } }
public bool AsignBranch( int CodigoSucursal ) { Query oQuery = new Query( "api/initial/institution/" + CodigoSucursal ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); AsignBranches asign = JsonConvert.DeserializeObject<AsignBranches>( resp.data ); this.setAppSettings( "InstitutionCode", asign.Codigo ); this.setAppSettings( "InstitutionName", asign.Name ); this.setAppSettings( "InstitutionLogo", asign.Logo ); this.setAppSettings( "BranchCode", asign.CodigoSucursal.ToString() ); this.setAppSettings( "BranchAddress", asign.BranchAddress ); return true; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return false; } }
public tPersonal Find( int ID ) { Query oQuery = new Query( "api/personal/" + ID ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._msgExceptionPersonal, "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); return JsonConvert.DeserializeObject<tPersonal>( resp.data ); } catch ( Exception ex ) { this._msgExceptionPersonal = ex.Message.ToString(); return null; } }
public tBranch Find( string Codigo ) { if ( string.IsNullOrEmpty( Codigo ) ) throw new InvalidOperationException( "No hay un Codigo Asignado a este recurso" ); Query oQuery = new Query( "api/institution/branches/" + Codigo ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionHistory, "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); return JsonConvert.DeserializeObject<tBranch>( resp.data ); } catch ( Exception e ) { this.ExceptionHistory = e.Message; return null; } }
public TVisionMision Find() { Query oQuery = new Query( "api/institution/vision_mision" ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionHistory, "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); return JsonConvert.DeserializeObject<TVisionMision>( resp.data ); } catch ( Exception e ) { this.ExceptionHistory = e.Message; return null; } }
public DataSet ListaGradoSeccion( DataSet dts ) { Query query = new Query( "api/initial/gradoseccion" ); try { query.SendRequestGET(); dts.Tables["Grados"].Clear(); dts.Tables["Secciones"].Clear(); dts.Tables["Niveles"].Clear(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) { throw new ArgumentNullException( "No se ha podido acceder a los datos", "Datos de Grados y Secciones" ); } GradoSeccion grs = JsonConvert.DeserializeObject<GradoSeccion>( query.ResponseContent ); foreach ( tGrado Item in grs.Grados ) { object[] td = new object[7] { Item.Codigo, Item.CodigoNivel, Item.Name, Item.Preview, Item.Next, Item.Description, Item.ModifiedDate }; dts.Tables["Grados"].Rows.Add( td ); } foreach ( tSeccion Item in grs.Secciones ) { object[] td = new object[4] { Item.Codigo, Item.Name, Item.Character, Item.ModifiedDate }; dts.Tables["Secciones"].Rows.Add( td ); } foreach ( tNivel Item in grs.Niveles ) { object[] td = new object[4] { Item.Codigo, Item.Name, Item.Description, Item.ModifiedDate }; dts.Tables["Niveles"].Rows.Add( td ); } return dts; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return null; } }
public List<lMaterialOfAula>ListforAula(int codAula) { Query query = new Query("api/material/aula/" + codAula); try { query.SendRequestGET(); if (query.ResponseStatusCode != HttpStatusCode.OK) throw new ArgumentNullException("No se encontraron datos", "Materiales"); return JsonConvert.DeserializeObject<List<lMaterialOfAula>>(query.ResponseContent); } catch (Exception ex) { this._msgExceptionRegMateriales = ex.Message; return null; } }
public tApoderado Find( int CodigoStudents, int CodigoParent ) { Query query = new Query( "api/students/" + CodigoStudents + "/parents/" + CodigoParent ); try { query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Docoumentos no encontrados", "NO SE ENCONTRO NIUNGUN PARIENTE" ); return JsonConvert.DeserializeObject<tApoderado>( query.ResponseContent ); } catch ( Exception ex ) { this.MsgExceptionParents = ex.Message; return null; } }
public tMaterial Find(int Codigo , int codigoMaterial) { Query query = new Query("api/students/show/" + Codigo); try { query.SendRequestGET(); if (query.ResponseStatusCode != HttpStatusCode.OK) throw new ArgumentNullException(query.ResponseContent, "ERROR AL OBTENER INFORMACION DEL MATERIAL "); return JsonConvert.DeserializeObject<tMaterial>(query.ResponseContent); } catch (Exception ex) { this._msgException = ex.Message; return null; } }
public tKardex Find(int CodigoMaterial, int CodigoIngreso) { Query query = new Query("api/material/"+ CodigoMaterial + "/entry/" + CodigoIngreso); try { query.SendRequestGET(); if (query.ResponseStatusCode != HttpStatusCode.OK) throw new ArgumentNullException("Docoumentos no encontrados", "No se encontro ningun Detalle"); tKardex result = JsonConvert.DeserializeObject<tKardex>(query.ResponseContent); return result; } catch (Exception ex) { this.MsExecpcion = ex.Message; return null; } }
public bool VerifyApplication( string strUrl ) { strUrl = (strUrl.Substring( ( strUrl.Length - 1 ), 1 ) != "/") ? strUrl + "/" : strUrl; Query query = new Query( "api", strUrl ); try { query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.Accepted ) throw new ArgumentNullException( "Existen errores en el servidor", "Errores en Servidor" ); return true; } catch ( Exception e ) { this._msgException = e.Message; return false; } }
public DataSet ListUbigeo( DataSet dts ) { Query query = new Query( this._ubigeoController ); try { query.SendRequestGET(); dts.Tables["Departamentos"].Clear(); dts.Tables["Provincias"].Clear(); dts.Tables["Distritos"].Clear(); if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( query.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); List<tDepartamentos> departamentos = JsonConvert.DeserializeObject<List<tDepartamentos>>( query.ResponseContent ); int countProv = 1, countDist = 1; foreach ( tDepartamentos depItem in departamentos ) { string[] camposdep = new string[2] { depItem.Id.ToString(), depItem.Departamento}; dts.Tables["Departamentos"].Rows.Add(camposdep); foreach ( tProvincias proItem in depItem.Provincias ) { string[] campospro = new string[4] { countProv.ToString(), camposdep[0], proItem.Id.ToString(), proItem.Provincia }; dts.Tables["Provincias"].Rows.Add( campospro ); foreach ( tDistritos disItem in proItem.Distritos ) { string[] camposdis = new string[4] { countDist.ToString(), campospro[0], disItem.Id.ToString(), disItem.Distrito }; dts.Tables["Distritos"].Rows.Add( camposdis ); countDist++; } countProv++; } } return dts; }catch(Exception e) { this._exceptionUbigeo = e.Message; return null; } }
public DataSet ListSucursales( DataSet dts ) { Query oQuery = new Query( "api/initial/branches" ); try { dts.Tables["Sucursal"].Clear(); oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( oQuery.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); List<tBranch> tipos = JsonConvert.DeserializeObject<List<tBranch>>( oQuery.ResponseContent ); foreach ( tBranch item in tipos ) { object[] temp = new object[6] { item.Codigo, item.Address, item.IsMain, item.LocalCode, item.ModifiedDate, item.LocalCode + " - " + item.Address }; dts.Tables["Sucursal"].Rows.Add( temp ); } } catch ( Exception ex ) { this._exceptionUbigeo = ex.Message; } return dts; }
public DataSet ListSalones( DataSet dts ) { Query oQuery = new Query( "api/institution/branches/" + this.getAppSettings( "BranchCode" ) + "/lounge" ); try { dts.Tables["ListaSalones"].Clear(); oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); List<tSalon> tipos = JsonConvert.DeserializeObject<List<tSalon>>( resp.data ); foreach ( tSalon item in tipos ) { object[] temp = new object[3] { item.Codigo, item.Name, item.ModifiedDate }; dts.Tables["ListaSalones"].Rows.Add( temp ); } } catch ( Exception e ) { this._exceptionUbigeo = e.Message; } return dts; }
public DataSet ListPeriodos( DataSet dts ) { Query query = new Query( "api/initial/periods" ); try { query.SendRequestGET(); dts.Tables["Periodo"].Clear(); if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( query.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); List<tPeriodo> peri = JsonConvert.DeserializeObject<List<tPeriodo>>( query.ResponseContent ); foreach ( tPeriodo Item in peri ) { object[] td = new object[8] { Item.Codigo, Item.Name, Item.Year, Item.Description, Item.StartDate, Item.EndDate, Item.Active, Item.ModifiedDate }; dts.Tables["Periodo"].Rows.Add( td ); } return dts; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return null; } }
public DataSet ListCategorias( DataSet dts ) { Query oQuery = new Query( "api/initial/categoria/" ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); List<tCategoria> categ = JsonConvert.DeserializeObject<List<tCategoria>>( resp.data ); foreach ( tCategoria item in categ ) { object[] temp = new object[3] { item.Codigo, item.Name, item.Modifieddate }; dts.Tables["ListaCategoria"].Rows.Add( temp ); } } catch ( Exception e ) { this._exceptionUbigeo = e.Message; } return dts; }
public DataSet ListaStudents( DataSet dts ) { Query query = new Query( "api/students" ); try { query.SendRequestGET(); dts.Tables["ListaAlumnos"].Clear(); if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( query.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); List<lAlumnos> tipo = JsonConvert.DeserializeObject<List<lAlumnos>>( query.ResponseContent ); foreach ( lAlumnos Item in tipo ) { object[] td = new object[4] { Item.Codigo, Item.Key, Item.Names, Item.ModifiedDate }; dts.Tables["ListaAlumnos"].Rows.Add( td ); } return dts; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return null; } }
public DataSet ListaGradoSeccion( DataSet dts ) { Query query = new Query( "api/initial/gradoseccion" ); try { query.SendRequestGET(); dts.Tables["Grados"].Clear(); dts.Tables["Secciones"].Clear(); dts.Tables["Niveles"].Clear(); if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( query.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); GradoSeccion grs = JsonConvert.DeserializeObject<GradoSeccion>( query.ResponseContent ); foreach ( tGrado Item in grs.Grados ) { object[] td = new object[7] { Item.Codigo, Item.CodigoNivel, Item.Name, Item.Preview, Item.Next, Item.Description, Item.ModifiedDate }; dts.Tables["Grados"].Rows.Add( td ); } foreach ( tSeccion Item in grs.Secciones ) { object[] td = new object[4] { Item.Codigo, Item.Name, Item.Character, Item.ModifiedDate }; dts.Tables["Secciones"].Rows.Add( td ); } foreach ( tNivel Item in grs.Niveles ) { object[] td = new object[4] { Item.Codigo, Item.Name, Item.Description, Item.ModifiedDate }; dts.Tables["Niveles"].Rows.Add( td ); } return dts; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return null; } }
public List<FillClases> FindClases( int pgrado, int pseccion ) { Query query = new Query( "api/process/enrollment/filter/classes/degree/" + pgrado + "/section/" + pseccion ); try { query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "No se encontraron datos", "Clases" ); List<FillClases> classes = JsonConvert.DeserializeObject<List<FillClases>>( query.ResponseContent ); return classes; } catch ( Exception ex ) { this._msgExceptionRegAlumno = ex.Message; return null; } }
public tAlumno FindStudents( int CodigoAlumno ) { Query query = new Query( this._AlumnoCtrl + "/" + CodigoAlumno ); try { query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( query.ResponseContent, "Busqueda de Alumno" ); return JsonConvert.DeserializeObject<tAlumno>( query.ResponseContent ); } catch ( Exception ex ) { this._msgExceptionRegAlumno = ex.Message; return null; } }
public DataSet ListSchool( DataSet dts ) { Query query = new Query( this._schoolsCtrl ); try { if ( dts.Tables["UltimoColegio"].Rows.Count > 0 ) dts.Tables["UltimoColegio"].Clear(); query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "No se encontraron datos", "Ultimos Colegios" ); List<tUltimoColegio> schools = JsonConvert.DeserializeObject<List<tUltimoColegio>>( query.ResponseContent ); foreach ( tUltimoColegio Items in schools ) { object[] temp = new object[4] { Items.Codigo, Items.Name, Items.TypeSchool ? "PARTICULAR" : "ESTATAL", Items.ModifiedDate }; dts.Tables["UltimoColegio"].Rows.Add( temp ); } return dts; } catch ( Exception ex ) { this._msgExceptionRegAlumno = ex.Message; return null; } }
public DataSet ListStudents( DataSet dts ) { Query query = new Query( this._AlumnoCtrl ); try { if ( dts.Tables["ListaAlumnos"].Rows.Count > 0 ) dts.Tables["ListaAlumnos"].Clear(); query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "No se encontraron datos", "Estudiantes" ); List<lAlumnos> AlumnosData = JsonConvert.DeserializeObject<List<lAlumnos>>( query.ResponseContent ); foreach ( lAlumnos Items in AlumnosData ) { object[] temp = new object[4] { Items.Codigo, Items.Key, Items.Names, Items.ModifiedDate }; dts.Tables["ListaAlumnos"].Rows.Add( temp ); } return dts; } catch ( Exception ex ) { this._msgExceptionRegAlumno = ex.Message; return null; } }
public DataSet ListSchool( DataSet dts ) { Query query = new Query( this._schoolController ); try { if( dts.Tables["lastschool"].Rows.Count > 0 ) dts.Tables["lastschool"].Clear(); query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "No se encontraron datos", "Ultimos Colegios" ); List<LastSchool> schools = JsonConvert.DeserializeObject<List<LastSchool>>( query.ResponseContent ); foreach ( LastSchool Items in schools ) { var temp = new object[3] { Items.Id, Items.Name, Items.type }; dts.Tables["lastschool"].Rows.Add( temp ); } return dts; } catch ( Exception ex ) { this._msgExceptionRegAlumno = ex.Message; return null; } }
public DataSet ListTipoDocumento( DataSet dts ) { Query query = new Query( this._tipoDocController ); try { query.SendRequestGET(); dts.Tables["TipoDocumento"].Clear(); if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( query.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); List<tTipoDocumento> tipo = JsonConvert.DeserializeObject<List<tTipoDocumento>>( query.ResponseContent ); foreach ( tTipoDocumento Item in tipo ) { object[] td = new object[8] { Item.Codigo, Item.Name, Item.ShortName, Item.Length, Item.Numeric, Item.Numeric, Item.Description, Item.ModifiedDate }; dts.Tables["TipoDocumento"].Rows.Add( td ); } return dts; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return null; } }
public tNivelParametro ParametersLevel( int idClass ) { Query query = new Query( "api/clase/cursos/" + idClass ); try { query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "No se encontraron datos", "Cursos" ); return JsonConvert.DeserializeObject<tNivelParametro>( query.ResponseContent ); } catch ( Exception ex ) { this._msgExceptionRegAlumno = ex.Message; return null; } }
public List<tBranch> List() { Query oQuery = new Query( "api/institution/branches" ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( oQuery.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionHistory, "Error en el Servidor" ); return JsonConvert.DeserializeObject<List<tBranch>>( oQuery.ResponseContent ); } catch ( Exception e ) { this.ExceptionHistory = e.Message; return null; } }
public DataSet ListTipoPersonal( DataSet dts ) { Query oQuery = new Query( "api/initial/type/personal" ); try { dts.Tables["TipoPersonal"].Clear(); oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( oQuery.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); List<tTipoPersonal> tipos = JsonConvert.DeserializeObject<List<tTipoPersonal>>( oQuery.ResponseContent ); foreach ( tTipoPersonal item in tipos ) { object[] temp = new object[6] { item.Codigo, item.Name, item.Description, item.isUser, item.TypeUserAsoc, item.ModifiedDate }; dts.Tables["TipoPersonal"].Rows.Add( temp ); } return dts; } catch ( Exception ex ) { this._exceptionUbigeo = ex.Message; return null; } }
public List<tMaterialSalon> ListforAula( int CodigoSalon ) { Query oQuery = new Query( string.Format("api/control/aula/{0}/material", CodigoSalon ) ); try { oQuery.SendRequestGET(); if ( oQuery.ResponseStatusCode == HttpStatusCode.InternalServerError ) throw new ArgumentNullException( "Existe un error en el servidor:\n", "Error en el Servidor" ); else if ( oQuery.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); msgResponse resp = JsonConvert.DeserializeObject<msgResponse>( oQuery.ResponseContent ); if ( oQuery.ResponseStatusCode == HttpStatusCode.BadRequest ) throw new InvalidOperationException( resp.message ); return JsonConvert.DeserializeObject<List<tMaterialSalon>>( resp.data ); } catch ( Exception ex ) { this._ExceptionCM = ex.Message; return null; } }
public bool InfoInstitution() { Query query = new Query( "api/initial/periods" ); try { query.SendRequestGET(); if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "No se encontro recurso al cual acceder", "Recurso no encontrado" ); else if ( query.ResponseStatusCode == HttpStatusCode.NoContent ) throw new ArgumentNullException( "No se han encontrado datos", "Lista Vacia" ); else if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "Existe un error en el servidor:\n" + this._exceptionUbigeo, "Error en el Servidor" ); InstitutionData data = JsonConvert.DeserializeObject< InstitutionData >( query.ResponseContent ); return true; } catch ( Exception e ) { this._exceptionUbigeo = e.Message; return false; } }
public List<lApoderados> List( int CodigoStudents = 0 ) { Query query = new Query( "api/students/" + CodigoStudents + "/parents" ); try { query.SendRequestGET(); if ( query.ResponseStatusCode != HttpStatusCode.OK ) throw new ArgumentNullException( "ERROR EN LA BUSQUEDA", "HUBO UN ERROR EN LA BUSQUEDA DE LOS APODERADOS" ); else if ( query.ResponseStatusCode == HttpStatusCode.NotFound ) throw new ArgumentNullException( "LISTA VACIA", "NO SE ENCONTRARON APODERADOS ASIGNADOS A ESTE ALUMNO" ); return JsonConvert.DeserializeObject<List<lApoderados>>( query.ResponseContent ); } catch ( Exception ex ) { this.MsgExceptionParents = ex.Message; return (new List<lApoderados>()); } }