Example #1
0
 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 }));
     }
 }
Example #2
0
 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 }));
     }
 }
Example #3
0
        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);
        }
Example #4
0
        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);
            }
        }
Example #5
0
        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();
        }
Example #6
0
 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 }));
     }
 }