public ActionResult Index(int?page, string search) { CustomHelper.setTitulo("Colegio", "Listado"); List <Entities.Colegio> Colegios = new List <Entities.Colegio>(); try { if (!string.IsNullOrWhiteSpace(search) && search != null) { Colegios = new ColegioBL().Buscar(search).ToList(); } else { Colegios = new ColegioBL().ObtenerListado(true); } } catch (Exception ex) { ViewBag.Error = string.Format("Message: {0} StackTrace: {1}", ex.Message, ex.StackTrace); return(View("~/Views/Shared/Error.cshtml")); } ViewBag.Search = search; int pageSize = 15; int pageNumber = (page ?? 1); return(View(Colegios.ToPagedList(pageNumber, pageSize))); }
public void GuardarModificacion(Colegios ObjColegio) { var Item = (from i in entity.Colegios where i.Id == ObjColegio.Id select i).FirstOrDefault(); Item.NIT = ObjColegio.NIT; Item.Codigo_DANE = ObjColegio.Codigo_DANE; Item.Nombre_Colegio = ObjColegio.Nombre_Colegio; Item.Direccion = ObjColegio.Direccion; Item.Correo_Colegio = ObjColegio.Correo_Colegio; Item.Num_Resolucion = ObjColegio.Num_Resolucion; Item.Municipio = ObjColegio.Municipio; Item.Tipo = ObjColegio.Tipo; Item.Categoria = ObjColegio.Categoria; Item.Nombre_Rector = ObjColegio.Nombre_Rector; Item.Apellidos_Rector = ObjColegio.Apellidos_Rector; Item.Telefono_Rector = ObjColegio.Telefono_Rector; Item.Correo_Rector = ObjColegio.Correo_Rector; Item.Nombre_Coordinador = ObjColegio.Nombre_Coordinador; Item.Apellidos_Coordinador = ObjColegio.Apellidos_Coordinador; Item.Telefono_Coordinador = ObjColegio.Telefono_Coordinador; Item.Correo_Coordinador = ObjColegio.Correo_Coordinador; entity.SaveChanges(); }
public IHttpActionResult GuardarModificacion(Colegios ObjColegio) { try { TecnicaBl obj = new TecnicaBl(); obj.GuardarModificacion(ObjColegio); return(Ok(new { success = true })); } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public IHttpActionResult inhabilitarinstitucion(Colegios ObjColegios) { try { TecnicaBl obj = new TecnicaBl(); obj.inhabilitarinstitucion(ObjColegios.Id); return(Ok(new { success = true })); } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public IHttpActionResult verDetalleInst(Colegios oCOlegios) { try { TecnicaBl oColegioBl = new TecnicaBl(); var Colegio = oColegioBl.ConsultarColegioId(oCOlegios.Id); return(Ok(new { success = true, Colegio })); } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public bool GuardarInstitucion(Colegios ObjColegio) { var datos = (from i in entity.Colegios where i.NIT == ObjColegio.NIT select i).FirstOrDefault(); if (datos == null) { ObjColegio.Estado = true; entity.Colegios.Add(ObjColegio); entity.SaveChanges(); return(true); } else { return(false); } }
public IHttpActionResult Modificar(Colegios ObjColegio) { try { TecnicaBl obj = new TecnicaBl(); var Datos = obj.Modificar(ObjColegio.Id); if (Datos != null) { return(Ok(new { success = true, datos = Datos })); } else { return(Ok(new { success = false })); } } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public IHttpActionResult GuardarInstitucion(Colegios ObjColegio) { try { TecnicaBl obj = new TecnicaBl(); var datos = obj.GuardarInstitucion(ObjColegio); if (datos) { return(Ok(new { success = true })); } else { return(Ok(new { success = false })); } } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }