コード例 #1
0
ファイル: EspecialBl.cs プロジェクト: 1000VIA/SRA
        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();
        }
コード例 #2
0
ファイル: EspecialController.cs プロジェクト: 1000VIA/SRA
 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 }));
     }
 }
コード例 #3
0
ファイル: EspecialController.cs プロジェクト: 1000VIA/SRA
 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 }));
     }
 }
コード例 #4
0
ファイル: EspecialBl.cs プロジェクト: 1000VIA/SRA
        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();
        }
コード例 #5
0
ファイル: EspecialBl.cs プロジェクト: 1000VIA/SRA
        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);
            }
        }
コード例 #6
0
ファイル: EspecialController.cs プロジェクト: 1000VIA/SRA
 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 }));
     }
 }