This commit is contained in:
@@ -746,25 +746,31 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
protected void LnkTerminarMinuta_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Cambiar el estatus a Terminada para inabilitarla y que no se pueda modificar
|
||||
ClsOIEventos objOI = new ClsOIEventos();
|
||||
int tCveSeguimiento;
|
||||
bool HuboError = false;
|
||||
|
||||
objOI.IniciaTransacSQL();
|
||||
|
||||
tCveSeguimiento = objOI.AddEventoComentario2(RCveEvento, "Termino minuta.", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
|
||||
if (tCveSeguimiento > 0)
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
if (!objOI.UpdateEstatusEvento2(4, tCveSeguimiento, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
HuboError = true;
|
||||
objOI.IniciaTransacSQL();
|
||||
tCveSeguimiento = objOI.AddEventoComentario2(RCveEvento, "Termino minuta.", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
|
||||
if (tCveSeguimiento > 0)
|
||||
{
|
||||
if (!objOI.UpdateEstatusEvento2(4, tCveSeguimiento, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
HuboError = true;
|
||||
}
|
||||
else { HuboError = true; }
|
||||
if (HuboError == false)
|
||||
{
|
||||
objOI.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
objOI.RollBack();
|
||||
}
|
||||
}
|
||||
if (HuboError == false)
|
||||
{
|
||||
if (!EnviarMinuta()) { HuboError = true; Alert("Ocurrió un error al terminar la minuta. no se pudo enviar el correo.", ModExtensiones.TipoMensaje.MsgError); }
|
||||
}
|
||||
else
|
||||
HuboError = true;
|
||||
|
||||
|
||||
// 'Envia minuta si es modificada
|
||||
|
||||
|
||||
|
||||
if (HuboError == false)
|
||||
@@ -775,22 +781,6 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
script = string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEventoPadre={0}\");", RCveEvento);
|
||||
}
|
||||
Alert("La minuta ha finalizado.", ModExtensiones.TipoMensaje.MsgInformacion, script);
|
||||
objOI.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Ocurrió un error al terminar la minuta. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError);
|
||||
objOI.RollBack();
|
||||
}
|
||||
|
||||
objOI.Dispose();
|
||||
|
||||
|
||||
if (HuboError == false)
|
||||
{
|
||||
if (!EnviarMinuta())
|
||||
HuboError = true;
|
||||
Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
|
||||
LnkEnviarMinuta.Visible = true;
|
||||
@@ -833,7 +823,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
private string MailgetBodyMinuta()
|
||||
{
|
||||
|
||||
int Folio=0; string Link=""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai=DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
|
||||
int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
|
||||
string UsuarioDe = "";
|
||||
string UsuarioPara = "";
|
||||
string UsuarioDeAbr = "";
|
||||
@@ -875,7 +865,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
if (UsuarioPara != null)
|
||||
{
|
||||
string[] str = UsuarioPara.Split(' ');
|
||||
if (str.Length > 0 && str[0].Length >0)
|
||||
if (str.Length > 0 && str[0].Length > 0)
|
||||
{
|
||||
UsuariParaAbr = str[0].Substring(0, 1).ToUpper();
|
||||
}
|
||||
@@ -899,7 +889,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
StrMail.Append(" <span style=\"color: #6C6C6C; font-size: 17px;\">Moderador:</span>");
|
||||
StrMail.Append($" <span style=\"color: #ED7D31; font-size: 22px;font-weight: bold;\">{UsuarioDeAbr}</span>");
|
||||
StrMail.Append($" <span style=\"color: #6C6C6C; font-size: 17px;\">{UsuarioDe}</span><br />");
|
||||
StrMail.Append(" <span style=\"color: #6C6C6C; font-size: 17px;\">Fecha:</span>");
|
||||
StrMail.Append(" <span style=\"color: #6C6C6C; font-size: 17px;\">Fecha:</span>");
|
||||
StrMail.Append($" <span style=\"color: #6C6C6C; font-size: 17px;\">{DFechai: dd} de {DFechai: MMMM yyyy HH:mm}</span><br />");
|
||||
StrMail.Append(" </td>");
|
||||
StrMail.Append(" <td style=\"width: 20%;\">");
|
||||
@@ -940,21 +930,21 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
|
||||
|
||||
|
||||
if(dttareas != null && dttareas.Rows.Count > 0)
|
||||
if (dttareas != null && dttareas.Rows.Count > 0)
|
||||
{
|
||||
StrMail.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%\">");
|
||||
StrMail.Append(" <thead>");
|
||||
StrMail.Append(" <tr style=\"background-color:#dddddd;\">");
|
||||
StrMail.Append(" <th scope=\"col\">Folio</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Asunto</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Descripción</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Para</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Inicio</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Fin</th>");
|
||||
StrMail.Append(" </tr>");
|
||||
StrMail.Append(" </thead>");
|
||||
StrMail.Append(" <tbody>");
|
||||
foreach (System.Data.DataRow drow in dttareas.Rows )
|
||||
StrMail.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%\">");
|
||||
StrMail.Append(" <thead>");
|
||||
StrMail.Append(" <tr style=\"background-color:#dddddd;\">");
|
||||
StrMail.Append(" <th scope=\"col\">Folio</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Asunto</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Descripción</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Para</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Inicio</th>");
|
||||
StrMail.Append(" <th scope=\"col\">Fin</th>");
|
||||
StrMail.Append(" </tr>");
|
||||
StrMail.Append(" </thead>");
|
||||
StrMail.Append(" <tbody>");
|
||||
foreach (System.Data.DataRow drow in dttareas.Rows)
|
||||
{
|
||||
|
||||
StrMail.Append(" <tr>");
|
||||
@@ -966,8 +956,8 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
StrMail.Append($" <td>{drow["FechaFin"]: dd/MM/yyyy}</td>");
|
||||
StrMail.Append(" </tr>");
|
||||
}
|
||||
StrMail.Append(" </tbody>");
|
||||
StrMail.Append("</table>");
|
||||
StrMail.Append(" </tbody>");
|
||||
StrMail.Append("</table>");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1006,14 +996,14 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
//System.Threading.Thread Hilo = new System.Threading.Thread(MandaCorreo);
|
||||
//Hilo.Start();
|
||||
string abre = "";
|
||||
using (ClsOIEventos ObjOI_E =new ClsOIEventos())
|
||||
{
|
||||
if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados!=null && ObjOI_E.DtResultados.Rows.Count >0)
|
||||
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
|
||||
{
|
||||
if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados != null && ObjOI_E.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Rows )
|
||||
foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Rows)
|
||||
{
|
||||
if (item["Correo"].ToString().Trim().Length >0)
|
||||
ArrayCC = string.Format("{0}{1}{2}", ArrayCC,abre, item["Correo"].ToString().Trim());
|
||||
if (item["Correo"].ToString().Trim().Length > 0)
|
||||
ArrayCC = string.Format("{0}{1}{2}", ArrayCC, abre, item["Correo"].ToString().Trim());
|
||||
abre = ";";
|
||||
}
|
||||
}
|
||||
@@ -1025,7 +1015,7 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
|
||||
|
||||
ClsSisMail Mail = new ClsSisMail();
|
||||
Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString() +";"+ TxtCorreoExterno.Text, TxtAsunto.Text, Body, CCP: ArrayCC,Archivos: LSRutasMail);
|
||||
Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString() + ";" + TxtCorreoExterno.Text, TxtAsunto.Text, Body, CCP: ArrayCC, Archivos: LSRutasMail);
|
||||
//Alert("Se Envió por correo la Minuta", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
Retorno = true;
|
||||
}
|
||||
@@ -1378,8 +1368,44 @@ public partial class OI_MinutaDetalle : ClsPaginas
|
||||
LnkTerminarMinuta_Click(null, null);
|
||||
}
|
||||
|
||||
public string GenerateIcsContent(DateTime FechaInicio, DateTime FechaFin, string Nombreorganizador, string Correoorganizador, string Ubicacion, string Asunto, string descripcion, string uuid)
|
||||
{
|
||||
var DTSTART = FechaInicio.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
|
||||
var DTEND = FechaFin.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
|
||||
|
||||
|
||||
/*
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
|
||||
BEGIN:VEVENT
|
||||
UID:uid1@example.com
|
||||
DTSTAMP:19970714T170000Z
|
||||
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
|
||||
DTSTART:19970714T170000Z
|
||||
DTEND:19970715T035959Z
|
||||
SUMMARY:Bastille Day Party
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
*/
|
||||
StringBuilder strICS = new StringBuilder();
|
||||
strICS.Append("BEGIN:VCALENDAR");
|
||||
strICS.Append("VERSION:2.0");
|
||||
strICS.Append("METHOD:PUBLISH");
|
||||
strICS.Append("BEGIN:VEVENT");
|
||||
strICS.AppendFormat("ORGANIZER;CN={0}:MAILTO:{1}", Nombreorganizador.Replace(":", "").Replace(";", ""), Correoorganizador);
|
||||
strICS.AppendFormat("DTSTART:{0}", DTSTART);
|
||||
strICS.AppendFormat("DTEND:{0}", DTEND);
|
||||
strICS.AppendFormat("LOCATION:{0}", Ubicacion);
|
||||
strICS.AppendFormat("UID:{0}", uuid);
|
||||
strICS.AppendFormat("DTSTAMP:{0}", DateTime.Now.ToUniversalTime().ToString("yyyyMMddTHHmmssZ"));
|
||||
strICS.AppendFormat("SUMMARY:{0}", Asunto);
|
||||
strICS.AppendFormat("DESCRIPTION:{0}", descripcion);
|
||||
strICS.Append("PRIORITY:5");
|
||||
strICS.Append("CLASS:PUBLIC");
|
||||
strICS.Append("END:VEVENT");
|
||||
strICS.Append("END:VCALENDAR");
|
||||
return strICS.ToString();
|
||||
}
|
||||
|
||||
|
||||
protected void LnkOpenModalAsistencia_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user