Example #1
0
 public void ActualizarMatriculacion(long clave, int estado, string error)
 {
     using (MoodleWSDataContext ctx = new MoodleWSDataContext(ConfigEnum.ConnString))
     {
         UniMoodleMatriculaciones obj = ctx.UniMoodleMatriculaciones.Single(c => c.Clave == clave);
         obj.Estado = estado;
         obj.Fecha  = DateTime.Now;
         obj.Error  = error;
         ctx.SubmitChanges();
     }
 }
Example #2
0
 public virtual void SubmitChanges()
 {
     try
     {
         using (MoodleWSDataContext dataContext = new MoodleWSDataContext(CONNECTION_STRING))
         {
             dataContext.SubmitChanges();
         }
     }
     catch (Exception)
     {
         throw new Exception(MensajesErrores.ERROR_AL_GUARDAR);
     }
 }
Example #3
0
 public void ActualizarGrupo(string idNumber, long moodleId, int estado, string error)
 {
     using (MoodleWSDataContext ctx = new MoodleWSDataContext(ConfigEnum.ConnString))
     {
         UniMoodleGrupos obj = ctx.UniMoodleGrupos.Single(c => c.IdNumber == idNumber);
         if (moodleId > 0)
         {
             obj.MoodleId = moodleId;
         }
         obj.Estado = estado;
         obj.Fecha  = DateTime.Now;
         obj.Error  = error;
         ctx.SubmitChanges();
     }
 }
Example #4
0
        public virtual void CrearLote(List <TEntity> entityList)
        {
            using (MoodleWSDataContext dataContext = new MoodleWSDataContext(CONNECTION_STRING))
            {
                Table <TEntity> tabla = dataContext.GetTable <TEntity>();

                if (tabla != null)
                {
                    tabla.InsertAllOnSubmit(entityList);

                    dataContext.SubmitChanges();
                }
                else
                {
                    throw new Exception(MensajesErrores.ERROR_AL_GUARDAR);
                }
            }
        }