Example #1
0
        public void GuardarModificacionInstructor(instructor_PEspecial obj)
        {
            var Datos = (from i in entity.instructor_PEspecial
                         where i.Id == obj.Id
                         select i).FirstOrDefault();

            Datos.Nombre   = obj.Nombre;
            Datos.Apellido = obj.Apellido;
            Datos.Email    = obj.Email;
            Datos.Celular  = obj.Celular;
            entity.SaveChanges();
        }
Example #2
0
 public IHttpActionResult CambiarEstado(instructor_PEspecial objI)
 {
     try
     {
         EspecialBl obj = new EspecialBl();
         obj.CambiarEstado(objI);
         return(Ok(new { success = true }));
     }
     catch (Exception exc)
     {
         return(Ok(new { success = false, exc = exc.Message }));
     }
 }
Example #3
0
 public IHttpActionResult GuardarModificacionInstructor(instructor_PEspecial objI)
 {
     try
     {
         EspecialBl obj = new EspecialBl();
         obj.GuardarModificacionInstructor(objI);
         return(Ok(new { success = true }));
     }
     catch (Exception exc)
     {
         return(Ok(new { success = false, exc = exc.Message }));
     }
 }
Example #4
0
        public void CambiarEstado(instructor_PEspecial obj)
        {
            var Datos = (from i in entity.instructor_PEspecial
                         where i.Id == obj.Id
                         select i).FirstOrDefault();

            if (Datos.Estado)
            {
                Datos.Estado = false;
            }
            else
            {
                Datos.Estado = true;
            }
            entity.SaveChanges();
        }
Example #5
0
        public bool GuardarInstructor(instructor_PEspecial obj)
        {
            var Datos = (from i in entity.instructor_PEspecial
                         where i.Email == obj.Email
                         select i).FirstOrDefault();

            if (Datos == null)
            {
                entity.instructor_PEspecial.Add(obj);
                entity.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #6
0
 public IHttpActionResult GuardarInstructor(instructor_PEspecial oInstructor)
 {
     try
     {
         EspecialBl oInstructorBl = new EspecialBl();
         var        Instructor    = oInstructorBl.GuardarInstructor(oInstructor);
         if (Instructor == true)
         {
             return(Ok(new { success = true }));
         }
         else
         {
             return(Ok(new { success = false }));
         }
     }
     catch (Exception exc)
     {
         return(Ok(new { success = false, exc = exc.Message }));
     }
 }