Beispiel #1
0
        public bool ValidarColegio(Colegio_Web colegio)
        {
            Colegio_Web cw = new Colegio_Web();

            _dictionaryError = new Dictionary <string, string>();
            if (string.IsNullOrWhiteSpace(colegio.Nombre) || string.IsNullOrEmpty(colegio.Nombre))
            {
                _dictionaryError.Add("Nombre", "Este campo es obligatorio.");
            }

            return(_dictionaryError.Count == 0);
        }
Beispiel #2
0
        public async Task <bool> Read(int id)
        {
            try
            {
                HttpResponseMessage responseMessage = await client.GetAsync(string.Format("{0}/{1}/{2}", url, "colegio", id));

                if (responseMessage.IsSuccessStatusCode)
                {
                    var         responseData = responseMessage.Content.ReadAsStringAsync().Result;
                    Colegio_Web retorno      = JsonConvert.DeserializeObject <Colegio_Web>(responseData);

                    MappingThisFromAnother(retorno);
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                return(false);

                throw;
            }
        }
Beispiel #3
0
 public void MappingThisFromAnother(Colegio_Web objeto)
 {
     this.Id     = objeto.Id;
     this.Nombre = objeto.Nombre;
 }