This commit is contained in:
@@ -401,7 +401,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion);
|
||||
System.IO.File.Move(rutaarchivoOri, ruta);
|
||||
}
|
||||
this.Alert("Se ha agregadó la nueva convocatoria", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEvento={0}\");", CveEvento));
|
||||
this.Alert(string.Format("Se ha agregadó la nueva convocatoria.<br/><a href=\"data:text/plain;charset=utf-8,{0}\" download=\"Agendar.ics\" class=\"btn btn-default\">⏰ Agendar</a>", HttpUtility.UrlEncode(ICString)), ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEvento={0}\");", CveEvento));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,7 +422,7 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
{
|
||||
objOI.Commit();
|
||||
enviarConvocatoria(RCveEvento);
|
||||
Alert("Convocatoria actualizada");
|
||||
Alert(string.Format("Convocatoria actualizada.<br/><a href=\"data:text/plain;charset=utf-8,{0}\" download=\"Agendar.ics\" class=\"btn btn-default\">⏰ Agendar</a>", HttpUtility.UrlEncode(ICString)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -585,14 +585,21 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
{
|
||||
return string.Format("{0}/{1}", HttpContext.Current.Request.Url.ToString().Replace(HttpContext.Current.Request.Url.PathAndQuery, ""), addstr);
|
||||
}
|
||||
string UsuarioDemail = "";
|
||||
private string MailgetBodyConvocatoria(int RCveEvento)
|
||||
string UsuarioDemail = "";
|
||||
string ICString = "";
|
||||
private void enviarConvocatoria(int RCveEvento)
|
||||
{
|
||||
|
||||
int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
|
||||
string Body;
|
||||
string UsuarioDe = "";
|
||||
|
||||
#region "Body"
|
||||
int Folio = 0; string Link = ""; string Asunto = ""; string Acuerdos = ""; string Descripcion = ""; DateTime DFechai = DateTime.MinValue; DateTime DFechaf = DateTime.MinValue;
|
||||
UsuarioDe = "";
|
||||
string UsuarioPara = "";
|
||||
string UsuarioDeAbr = "";
|
||||
string CorreoRegistro = "";
|
||||
|
||||
System.Data.DataTable dttareas;
|
||||
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
|
||||
{
|
||||
@@ -600,7 +607,8 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
{
|
||||
System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0];
|
||||
UsuarioDe = drow["NombreRegistro"].ToString();
|
||||
UsuarioDemail= drow["NombreRegistro"].ToString();
|
||||
UsuarioDemail = drow["NombreRegistro"].ToString();
|
||||
CorreoRegistro = drow["CorreoRegistro"].ToString().Split(',')[0].Split(';')[0];
|
||||
Folio = drow["Folio"].ToString().ToEntero();
|
||||
Link = GetDominio(string.Format("OI/ConvocatoriaDetalle.aspx?CveEvento={0}", RCveEvento));
|
||||
Asunto = drow["Asunto"].ToString();
|
||||
@@ -700,13 +708,12 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append("</html></body>");
|
||||
return StrMail.ToString();
|
||||
}
|
||||
private void enviarConvocatoria(int RCveEvento)
|
||||
{
|
||||
|
||||
string Body;
|
||||
Body = MailgetBodyConvocatoria(RCveEvento);
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Body = StrMail.ToString();//MailgetBodyConvocatoria(RCveEvento);
|
||||
string ArrayCC = "";
|
||||
//ViewState("Para") = GlobalDTUsuarios(CveUsuarioIng)(0)("correo").ToString;
|
||||
//ViewState("Asunto") = string.Format("SIG - Minuta {0}", TxtAsunto.Text);
|
||||
@@ -728,7 +735,11 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
}
|
||||
List<ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>();
|
||||
ClsSisMail.ArchivoMail mailfile = new ClsSisMail.ArchivoMail { Ruta = string.Format("{0}Imagenes\\Bell.png", ModExtensiones.DirectorioBaseEmpresas), NombreArchivo = "Bell.png" };
|
||||
LSRutasMail.Add(mailfile);
|
||||
LSRutasMail.Add(mailfile);
|
||||
ICString = GenerateIcsContent(string.Format("{0:yyyy/MM/dd} 00:00", txtFechaI.Text.ToDateTime()).ToDateTime(), string.Format("{0:yyyy/MM/dd} 23:59", txtFechaI.Text.ToDateTime()).ToDateTime(),
|
||||
UsuarioDe, CorreoRegistro, TxtLugar.Text, Asunto,Descripcion,string.Format("Convocatoria_{0}",RCveEvento) );
|
||||
ClsSisMail.ArchivoMail ICSFile = new ClsSisMail.ArchivoMail { Ruta = "",ArchivoBinario= Encoding.ASCII.GetBytes(ICString), NombreArchivo = "Agendar.ics" };
|
||||
LSRutasMail.Add(ICSFile);
|
||||
ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail();
|
||||
|
||||
|
||||
@@ -742,31 +753,44 @@ public partial class OI_ConvocatoriaDetalle : ClsPaginas
|
||||
}
|
||||
|
||||
|
||||
public string GenerateIcsContent(DateTime dateStart,
|
||||
DateTime dateEnd, string email, string location,
|
||||
string summary, string description)
|
||||
public string GenerateIcsContent(DateTime FechaInicio, DateTime FechaFin, string Nombreorganizador, string Correoorganizador, string Ubicacion, string Asunto, string descripcion, string uuid)
|
||||
{
|
||||
string DateFormat = "yyyyMMddTHHmmssZ";
|
||||
var s = dateStart.ToUniversalTime().ToString(DateFormat);
|
||||
var e = dateEnd.ToUniversalTime().ToString(DateFormat);
|
||||
var iCal = string.Format(@"BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
METHOD:PUBLISH
|
||||
BEGIN:VEVENT
|
||||
ORGANIZER:MAILTO:{0}
|
||||
DTSTART:{1}
|
||||
DTEND:{2}
|
||||
LOCATION:{3}
|
||||
UID:{4}
|
||||
DTSTAMP:{4}
|
||||
SUMMARY:{5}
|
||||
DESCRIPTION:{6}
|
||||
PRIORITY:5
|
||||
CLASS:PUBLIC
|
||||
END:VEVENT
|
||||
END:VCALENDAR", email, s, e, location,
|
||||
DateTime.Now.ToUniversalTime().ToString(DateFormat),
|
||||
summary, description);
|
||||
return iCal;
|
||||
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.AppendLine("BEGIN:VCALENDAR");
|
||||
strICS.AppendLine("VERSION:2.0");
|
||||
strICS.AppendLine("METHOD:PUBLISH");
|
||||
strICS.AppendLine("BEGIN:VEVENT");
|
||||
strICS.AppendLine(string.Format("ORGANIZER;CN={0}:MAILTO:{1}", Nombreorganizador.Replace(":", "").Replace(";", ""), Correoorganizador));
|
||||
strICS.AppendLine(string.Format("DTSTART:{0}", DTSTART));
|
||||
strICS.AppendLine(string.Format("DTEND:{0}", DTEND));
|
||||
strICS.AppendLine(string.Format("LOCATION:{0}", Ubicacion));
|
||||
strICS.AppendLine(string.Format("UID:{0}", uuid));
|
||||
strICS.AppendLine(string.Format("DTSTAMP:{0}", DateTime.Now.ToUniversalTime().ToString("yyyyMMddTHHmmssZ")));
|
||||
strICS.AppendLine(string.Format("SUMMARY:{0}", Asunto));
|
||||
strICS.AppendLine(string.Format("DESCRIPTION:{0}", descripcion));
|
||||
strICS.AppendLine("PRIORITY:5");
|
||||
strICS.AppendLine("CLASS:PUBLIC");
|
||||
strICS.AppendLine("END:VEVENT");
|
||||
strICS.AppendLine("END:VCALENDAR");
|
||||
return strICS.ToString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user