public static bool Eliminar(ComunicaLogica com) { try { string sQuery = ""; sQuery = "DELETE FROM t_correo_bo WHERE folio = " + com.Folio + " "; AccesoDatos.Borrar(sQuery); //sQuery = "DELETE FROM t_correo_to WHERE folio = " + com.Folio + " "; //AccesoDatos.Borrar(sQuery); sQuery = "DELETE FROM t_correo WHERE folio = " + com.Folio + " "; if (AccesoDatos.Borrar(sQuery) != 0) { return(true); } else { return(false); } } catch { return(false); } }
public static bool AlertaMensual(ComunicaLogica com) { DataTable datos = new DataTable(); try { string sQuery; sQuery = "select count(*) from t_correo where proceso = '" + com.Proceso + "' and referencia = '" + com.Referencia + "' and YEAR(fecha) = YEAR('" + DateTime.Today + "') and MONTH(fecha) = MONTH('" + DateTime.Today + "') HAVING COUNT(*) > 0"; datos = AccesoDatos.Consultar(sQuery); if (datos.Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
public static bool AlertaDiaria(ComunicaLogica com) { DataTable datos = new DataTable(); try { string sQuery; sQuery = "select count(*) from t_alerta_dia where proceso = '" + com.Proceso + "' and alerta = '" + com.Referencia + "' and CAST(fecha as date) = CAST('" + DateTime.Today + "' as date) HAVING COUNT(*) > 0 UNION "; sQuery += "select COUNT(*) from t_correo where proceso = '" + com.Proceso + "' and referencia = '" + com.Referencia + "' and CAST(fecha as date) = CAST('" + DateTime.Today + "' as date) HAVING COUNT(*) > 0"; datos = AccesoDatos.Consultar(sQuery); if (datos.Rows.Count > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
public static int Guardar(ComunicaLogica com) { string[] parametros = { "@Folio", "@Proceso", "@Referencia", "@Estado", "@Destino", "@Asunto", "Mensaje", "Usuario" }; return(AccesoDatos.Actualizar("sp_mant_correo", parametros, com.Folio, com.Proceso, com.Referencia, com.Estado, com.Destino, com.Asunto, com.Mensaje, com.Usuario)); }