private bool ActualizaMenciones() { clsDAL oDAL = new clsDAL(); // Primero borrar string strMenciones = string.Empty; string strSQL; for (int x = 0; x <= (this.m_Menciones.Length - 1); x++) { if (strMenciones != string.Empty) { strMenciones += ", "; } strMenciones += this.m_Menciones[x].Id.ToString(); } strSQL = "DELETE FROM " + this.m_TBL_MisMenciones + " WHERE Id_TemaProyecto=" + this.m_Id + " AND Id_Mencion NOT IN(" + strMenciones + ");"; oDAL.ExecCommand(strSQL); // Hacer el update o insert for (int x = 0; x <= (this.m_Menciones.Length - 1); x++) { strSQL = "SELECT Id FROM " + this.m_TBL_MisMenciones + " WHERE Id_TemaProyecto=" + this.m_Id + " AND Id_Mencion=" + this.m_Menciones[x].Id + ";"; if (!(System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)))) { strSQL = "INSERT INTO " + this.m_TBL_MisMenciones + " VALUES(null, " + this.m_Menciones[x].Id + ", " + this.m_Id + ");"; oDAL.ExecCommand(strSQL); } } return(true); }
public System.Byte getCantGruposByMencion(System.Byte IdMencion) { clsDAL oDAL = new clsDAL(); System.Byte bytCant = System.Convert.ToByte(oDAL.getEscalarValue("SELECT COUNT(Id) FROM " + this.m_TableName + " WHERE Id_Mencion=" + IdMencion + ";")); oDAL = null; return bytCant; }
public System.Byte getCantGruposTotal() { clsDAL oDAL = new clsDAL(); System.Byte bytCant = System.Convert.ToByte(oDAL.getEscalarValue("SELECT COUNT(Id) FROM " + this.m_TableName + ";")); oDAL = null; return bytCant; }
/// <summary> /// Devuelve la cantidad de registros de esta entidad que estén en la base de datos. /// </summary> /// <returns></returns> public new System.UInt32 getCantidad() { clsDAL oDAL = new clsDAL(); System.UInt32 bytCant = System.Convert.ToUInt32(oDAL.getEscalarValue("SELECT COUNT(Id_Usuario) FROM " + this.m_TableName + ";")); oDAL = null; return(bytCant); }
/// <summary> /// Comprueba si existe el NoCI pasado como parámetro. /// </summary> /// <param name="NoCI"></param> /// <returns></returns> public bool existNoCI(string NoCI) { clsDAL oDAL = new clsDAL(); string strSQL = "SELECT COUNT(Id_Usuario) FROM " + this.m_TableName + " WHERE NoCI='" + NoCI + "';"; bool boResult = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); return(boResult); }
public string getNombre(System.Byte Id) { clsDAL oDAL = new clsDAL(); string strNombre = System.Convert.ToString(oDAL.getEscalarValue("SELECT Nombre FROM " + this.m_TableName + " WHERE Id=" + Id + ";")); oDAL = null; return(strNombre); }
public string getNombre(System.Byte Id) { clsDAL oDAL = new clsDAL(); string strNombre = System.Convert.ToString(oDAL.getEscalarValue("SELECT Nombre FROM tbl_provincia WHERE Id=" + Id + ";")); oDAL = null; return(strNombre); }
/// <summary> /// Comprueba que el número de orden que se pasa como parámetro no existe, /// si existe devuelve true. /// </summary> /// <param name="NoOrden"></param> /// <returns></returns> public bool ExistNoOrden(System.Byte NoOrden) { string strSQL = "SELECT NoOrden FROM " + this.m_TableName + " WHERE NoOrden=" + NoOrden + ";"; clsDAL oDAL = new clsDAL(); bool boExist = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boExist); }
public System.Byte getNextNoOrden() { string strSQL = "SELECT NoOrden FROM " + this.m_TableName + " ORDER BY NoOrden DESC LIMIT 0,1;"; clsDAL oDAL = new clsDAL(); System.Byte bytNoOrden = System.Convert.ToByte(oDAL.getEscalarValue(strSQL)); oDAL = null; return(++bytNoOrden); }
public string getNombreCompleto(System.Byte Id) { string strSQL = "SELECT NombreCompleto FROM " + this.m_TableName + " WHERE Id=" + Id + ";"; clsDAL oDAL = new clsDAL(); string strResult = System.Convert.ToString(oDAL.getEscalarValue(strSQL)); oDAL = null; return(strResult); }
/// <summary> /// Comprueba si existe la URL pasado como parámetro, pero teniendo en cuenta /// que no debe revisar en la fila del propio Id_Bibliografia pasado como parámetro. /// </summary> /// <param name="Id">Id de bibliografía en la tabla "tbl_bibliografia_file"</param> /// <param name="FullURL">Dirección URL completa del registro que se pretende actualizar.</param> /// <returns></returns> public bool existURL(System.UInt32 Id, string FullURL) { string strSQL = "SELECT COUNT(Id_Bibliografia) FROM tbl_bibliografia_file WHERE FullURL='" + FullURL + "' AND Id_Bibliografia!=" + Id + ";"; clsDAL oDAL = new clsDAL(); bool boResult = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boResult); }
/// <summary> /// Comprueba que el Nombre corto que se pasa como parámetro no existe, /// si existe devuelve true. /// </summary> /// <param name="NombreCorto"></param> /// <returns></returns> public bool ExistNombreCorto(System.String NombreCorto) { string strSQL = "SELECT COUNT(NombreCorto) FROM " + this.m_TableName + " WHERE NombreCorto='" + NombreCorto + "';"; clsDAL oDAL = new clsDAL(); bool boExist = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boExist); }
/// <summary> /// Devuelve la cantidad de mensajes sin leer que tiene el usuario cuyo /// Id se pase como valor de parámetro "IdUsuario". /// </summary> /// <param name="IdUsuario"></param> /// <returns></returns> public System.UInt16 getMensajesNoLeidos(System.UInt32 IdUsuario) { string strSQL = "SELECT COUNT(Id_Usuario_To) AS CANT FROM tbl_usuario_mensaje WHERE Id_Usuario_To=" + IdUsuario + ";"; clsDAL oDAL = new clsDAL(); System.UInt16 intResult = System.Convert.ToUInt16(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
/// <summary> /// Devuelve la cantidad de usuarios, supuestamente maestrantes, /// haciendo solicitud de autorización de registro. /// </summary> /// <returns></returns> public System.UInt16 getCantSolicitandoRegistro() { clsDAL oDAL = new clsDAL(); string strSQL = "SELECT COUNT(Id_Usuario) FROM tbl_usuario_maestrante " + "WHERE Id_AcademicoAutoriza NOT IN (SELECT Id_Usuario FROM tbl_usuario_academico);"; System.UInt16 intResult = System.Convert.ToUInt16(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
public System.UInt32 getCantRespuestas() { string strSQL = "SELECT COUNT(Id_Consulta) AS CantRespuestas FROM tbl_consulta_respuesta;"; clsDAL oDAL = new clsDAL(); System.UInt32 intResult; intResult = System.Convert.ToUInt32(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
/// <summary> /// Devuelve el número total de consultas que no tiene respuesta aún, /// sin tener en cuenta de quien proviene o a quien está dirigida. /// </summary> /// <returns></returns> public System.UInt16 getCantConsultasSinRespuesta() { string strSQL = "SELECT COUNT(tbl_consulta.Id) FROM tbl_consulta " + "WHERE tbl_consulta.Id NOT IN(SELECT Id_Consulta FROM tbl_consulta_respuesta);"; clsDAL oDAL = new clsDAL(); System.UInt16 intResult = System.Convert.ToUInt16(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
public bool IsAuthorized(System.UInt32 Id) { clsDAL oDAL = new clsDAL(); string strSQL = "SELECT Id_Usuario FROM tbl_usuario_maestrante WHERE Id_Usuario=" + Id + " " + "AND Id_AcademicoAutoriza IN(SELECT Id_Usuario FROM tbl_usuario_academico);"; System.Boolean boResult = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boResult); }
/// <summary> /// Chequea si existe algún número de orden que sea igual al pasado como parámetro NoOrden, /// para el que el Id sea diferente, o sea, es util para cuando se está editando el módulo /// y se necesita comprobar que el NoOrden que se está proponiendo no está asignado a otro /// módulo. /// </summary> /// <param name="Id"></param> /// <param name="NoOrden"></param> /// <returns></returns> public bool ExistNoOrden(System.Byte Id, System.Byte NoOrden) { string strSQL = "SELECT NoOrden FROM " + this.m_TableName + " WHERE Id!=" + Id + " AND NoOrden=" + NoOrden + ";"; System.Diagnostics.Debug.WriteLine(strSQL); clsDAL oDAL = new clsDAL(); bool boExist = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boExist); }
/// <summary> /// Devuelve el número de consultas que han sido respondidas, pero que no /// han sido leídas para el Maestrante cuyo Id se pase como parámetro. /// </summary> /// <param name="IdMaestrante"></param> /// <returns></returns> public System.UInt16 getCantConsultasRespondidas(System.UInt32 IdMaestrante) { string strSQL = "SELECT COUNT(tbl_consulta.Id) FROM tbl_consulta " + "WHERE tbl_consulta.Id IN(SELECT Id_Consulta FROM tbl_consulta_respuesta WHERE Leida=0) " + "AND tbl_consulta.Id_UsuarioMaestrante=" + IdMaestrante + ";"; clsDAL oDAL = new clsDAL(); System.UInt16 intResult = System.Convert.ToUInt16(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
public System.UInt16 getCantTemasProyecto() { string strSQL = "SELECT COUNT(tbl_maestrante_tema_proyecto.Id_Usuario) " + "FROM tbl_maestrante_tema_proyecto WHERE Estado=0;"; clsDAL oDAL = new clsDAL(); System.UInt16 intResult; intResult = System.Convert.ToUInt16(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
/// <summary> /// Devuelve la cantidad de mensajes sin leer que tiene el usuario cuyo /// UserId se pase como valor de parámetro "UserId". /// </summary> /// <param name="IdUsuario"></param> /// <returns></returns> public System.UInt16 getMensajesNoLeidos(System.String UserId) { string strSQL = "SELECT COUNT(Id_Usuario_To) AS CANT FROM tbl_usuario_mensaje " + "INNER JOIN tbl_usuario ON tbl_usuario_mensaje.Id_Usuario_To = tbl_usuario.Id " + "WHERE tbl_usuario.UserId = '" + UserId + "';"; clsDAL oDAL = new clsDAL(); System.UInt16 intResult = System.Convert.ToUInt16(oDAL.getEscalarValue(strSQL)); oDAL = null; return(intResult); }
/// <summary> /// Chequea si existe algún Nombre corto que sea igual al pasado como parámetro NombreCorto, /// para el que el Id sea diferente, o sea, es util para cuando se está editando el módulo /// y se necesita comprobar que el NombreCorto que se está proponiendo no está asignado a otro /// módulo. /// </summary> /// <param name="Id"></param> /// <param name="NombreCorto"></param> /// <returns></returns> public bool ExistNombreCorto(System.Byte Id, System.String NombreCorto) { string strSQL = "SELECT COUNT(NombreCorto) FROM " + this.m_TableName + " WHERE Id!=" + Id + " AND NombreCorto='" + NombreCorto + "';"; System.Diagnostics.Debug.WriteLine(strSQL); clsDAL oDAL = new clsDAL(); bool boExist = System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boExist); }
public bool areValidKeyValuesForUpdate() { string strSQL = "SELECT Id FROM " + this.m_TableName + " " + "WHERE (Id_UsuarioDocente=" + this.m_IdUsuarioDocente + " " + "AND Id_Grupo=" + this.m_IdGrupo + " " + "AND datFecha='" + clsUtiles.getStringMySqlFormatedDate(this.m_datFecha) + "') AND (Id<>" + this.m_Id + ");"; clsDAL oDAL = new clsDAL(); bool boResult = !System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL)); oDAL = null; return(boResult); }