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(); } }
public virtual void SubmitChanges() { try { using (MoodleWSDataContext dataContext = new MoodleWSDataContext(CONNECTION_STRING)) { dataContext.SubmitChanges(); } } catch (Exception) { throw new Exception(MensajesErrores.ERROR_AL_GUARDAR); } }
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(); } }
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); } } }