Beispiel #1
0
        /// <summary>
        /// Método para la carga inicial del módulo
        /// </summary>
        /// <returns></returns>
        public HttpResponseMessage Get()
        {
            DepartamentHandler departamentHandler = new DepartamentHandler();

            var dep = departamentHandler.GetDepartamentByIdCountry(Constants.IdCountryColombia);

            return(Request.CreateResponse(HttpStatusCode.OK, new
            {
                Departament = dep != null ? dep : null
            }));
        }
        private string GetDepartamentNameById(int id)
        {
            var    dep  = departamentHandler.GetDepartamentByIdCountry(1);
            string name = string.Empty;

            if (dep != null)
            {
                var fil = dep.FirstOrDefault(c => c.Id == id);
                name = fil != null ? fil.Name : string.Empty;
            }
            return(name);
        }