public IHttpActionResult GuardarEdicionInstructor(Instructor_Tecnica ObjInstruc) { try { TecnicaBl obj = new TecnicaBl(); obj.GuardarEdicionInstructor(ObjInstruc); return(Ok(new { success = true })); } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public IHttpActionResult Modifcar4(Instructor_Tecnica ObjInstruc) { try { TecnicaBl obj = new TecnicaBl(); var Datos = obj.Modificar4(ObjInstruc.Id); return(Ok(new { success = true, datos = Datos })); } catch (Exception exc) { return(Ok(new { success = false, exc = exc.Message })); } }
public Instructor_Tecnica ConsultarInstructorNombre(string nombre) { Instructor_Tecnica obj = new Instructor_Tecnica(); var Datos = (from i in entity.Instructor_Tecnica select i).ToList(); foreach (var item in Datos) { var nom = item.Nombres + " " + item.Apellidos; if (nom == nombre) { obj = item; break; } } return(obj); }
public bool GuardarInstructor2(Instructor_Tecnica ObjInst) { var Datos = (from i in entity.Instructor_Tecnica where i.Cedula == ObjInst.Cedula select i).FirstOrDefault(); if (Datos == null) { entity.Instructor_Tecnica.Add(ObjInst); entity.SaveChanges(); return(true); } else { return(false); } }
public void GuardarEdicionInstructor(Instructor_Tecnica ObjInstruc) { var Datos = (from i in entity.Instructor_Tecnica where i.Id == ObjInstruc.Id select i).FirstOrDefault(); Datos.Cedula = ObjInstruc.Cedula; Datos.Nombres = ObjInstruc.Nombres; Datos.Apellidos = ObjInstruc.Apellidos; Datos.Correo_Misena = ObjInstruc.Correo_Misena; Datos.Correo_Alternativo = ObjInstruc.Correo_Alternativo; Datos.Municipio = ObjInstruc.Municipio; Datos.Telefono_Fijo = ObjInstruc.Telefono_Fijo; Datos.Celular = ObjInstruc.Celular; Datos.Area = ObjInstruc.Area; Datos.Profesion = ObjInstruc.Profesion; Datos.Programa_Formacion = ObjInstruc.Programa_Formacion; entity.SaveChanges(); }
public IHttpActionResult GuardarInstructor(Instructor_Tecnica ObjInst) { try { TecnicaBl obj = new TecnicaBl(); var Datos = obj.GuardarInstructor2(ObjInst); if (Datos) { return(Ok(new { success = true })); } else { return(Ok(new { success = false })); } } catch (Exception exc) { return(Ok(new { success = false })); } }