示例#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();
     }
 }
示例#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);
     }
 }
示例#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();
     }
 }
示例#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);
                }
            }
        }
示例#5
0
 public virtual List <TEntity> GetData(string procname, object[] parameters)
 {
     try
     {
         using (MoodleWSDataContext dataContext = new MoodleWSDataContext(CONNECTION_STRING))
         {
             if (parameters != null && parameters.Length > 0)
             {
                 return(dataContext.GetDataWithParameters <TEntity>(procname, parameters));
             }
             else
             {
                 return(dataContext.GetDataWithoutParameters <TEntity>(procname));
             }
         }
     }
     catch (Exception)
     {
         throw new Exception(MensajesErrores.ERROR_AL_EJECUTAR_CONSULTA);
     }
 }