This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -44,7 +45,7 @@ public partial class OI_RepReuniones : ClsPaginas
|
||||
FechaF = TxtCFechaFin.Text.ToDate();
|
||||
|
||||
if (ObjProspectos.GetRepEventos(-1, 11, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaI, FechaF))
|
||||
{ GVConvocatoria.DataSource = ObjProspectos.DtResultados.FiltraParametros("","FechaInicio DESC"); }
|
||||
{ GVConvocatoria.DataSource = ObjProspectos.DtResultados.FiltraParametros("", "FechaInicio DESC"); }
|
||||
}
|
||||
|
||||
GVConvocatoria.DataBind();
|
||||
@@ -135,10 +136,232 @@ public partial class OI_RepReuniones : ClsPaginas
|
||||
UpContenido.Update();
|
||||
}
|
||||
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
protected void BtnCargarReunion_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatosReunion();
|
||||
UpContenido.Update();
|
||||
|
||||
}
|
||||
|
||||
protected void LnkAddMinuta_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||
int RCveEvento = gvrow.DataKey("CveEvento").ToEntero();
|
||||
bool Continuar = false;
|
||||
int CveEvento = -1;
|
||||
List<int> LCveUsuarioCCP = new List<int>();
|
||||
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
|
||||
{
|
||||
if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
LCveUsuarioCCP.Clear();
|
||||
foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Select("CveEvento >0"))
|
||||
{
|
||||
int CveUsuario = item["CveUsuario"].ToString().ToEntero();
|
||||
LCveUsuarioCCP.Add(CveUsuario);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int Folio = -1;
|
||||
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
|
||||
{
|
||||
if (ObjOI_E.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0];
|
||||
ObjOI_E.IniciaTransacSQL();
|
||||
Continuar = ObjOI_E.AddOI_Eventos2(OITipoEventos.Minuta, drow["Asunto"].ToString(), drow["descripcion"].ToString(), drow["Prioridad"].ToString().ToEntero(), drow["cveUsuarioDe"].ToString().ToEntero(),
|
||||
drow["cveUsuarioPara"].ToString().ToEntero(), string.Format("{0:yyyy/MM/dd HH:mm}", drow["fechaInicio"]), string.Format("{0:yyyy/MM/dd HH:mm}", drow["fechaFin"]), drow["cveRevision"].ToString().ToEntero(), "",
|
||||
LCveUsuarioCCP, new List<string>(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CorreoExterno: drow["CorreoExterno"].ToString(), Lugar: drow["Lugar"].ToString(), CveEventoPadre: RCveEvento);
|
||||
CveEvento = ObjOI_E.CveEvento;
|
||||
Folio = ObjOI_E.Folio;
|
||||
if (CveEvento == 0)
|
||||
{
|
||||
Continuar = false;
|
||||
}
|
||||
if (Continuar) { Continuar = ObjOI_E.UpdateEstatusEvento2(2, -1, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); }
|
||||
if (Continuar)
|
||||
{
|
||||
ObjOI_E.Commit();
|
||||
ObjEventosCorreo o = ObjOI_E.objCorreo;
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjOI_E.RollBack();
|
||||
Continuar = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
BtnCargarReunion_Click(null, null);
|
||||
this.Alert(string.Format("Se ha iniciado la minuta<br /> para ir a la minuta <a href=\"/OI/MinutaDetalle.aspx?CveEvento={0}\">click aquí</a>", CveEvento), ModExtensiones.TipoMensaje.ToastInformacion, "", 0);
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkEnviarRecordatorio_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||
int RCveEvento = gvrow.DataKey("CveEvento").ToEntero();
|
||||
enviarConvocatoria(RCveEvento);
|
||||
Alert("se ha enviado la convocatoria",ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
}
|
||||
|
||||
private string GetDominio(string addstr = "")
|
||||
{
|
||||
return string.Format("{0}/{1}", HttpContext.Current.Request.Url.ToString().Replace(HttpContext.Current.Request.Url.PathAndQuery, ""), addstr);
|
||||
}
|
||||
|
||||
private void enviarConvocatoria(int RCveEvento)
|
||||
{
|
||||
|
||||
string Body;
|
||||
Asuntoconvocatoria = "Convocatoria: ";
|
||||
Body = MailgetBodyConvocatoria(RCveEvento);
|
||||
string ArrayCC = "";
|
||||
//ViewState("Para") = GlobalDTUsuarios(CveUsuarioIng)(0)("correo").ToString;
|
||||
//ViewState("Asunto") = string.Format("SIG - Minuta {0}", TxtAsunto.Text);
|
||||
//ViewState("Body") = Body;
|
||||
//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)
|
||||
{
|
||||
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());
|
||||
abre = ";";
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail();
|
||||
|
||||
ClsSisMail Mail = new ClsSisMail();
|
||||
Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString() , Asuntoconvocatoria, Body, CCP: ArrayCC, Archivos: LSRutasMail);
|
||||
}
|
||||
private string Asuntoconvocatoria;
|
||||
private string MailgetBodyConvocatoria(int RCveEvento)
|
||||
{
|
||||
|
||||
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 = "";
|
||||
System.Data.DataTable dttareas;
|
||||
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
|
||||
{
|
||||
if (ObjOI_E.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0];
|
||||
UsuarioDe = drow["NombreRegistro"].ToString();
|
||||
Folio = drow["Folio"].ToString().ToEntero();
|
||||
Link = GetDominio(string.Format("OI/ConvocatoriaDetalle.aspx?CveEvento={0}", RCveEvento));
|
||||
Asuntoconvocatoria = string.Format("Convocatoria: {0}", drow["Asunto"].ToString());
|
||||
Asunto = drow["Asunto"].ToString();
|
||||
Descripcion = drow["Descripcion"].ToString();
|
||||
Acuerdos = drow["Acuerdos"].ToString();
|
||||
DateTime.TryParse(drow["FechaInicio"].ToString(), out DFechai);
|
||||
DateTime.TryParse(drow["FechaFin"].ToString(), out DFechaf);
|
||||
//OIE.[CveEvento], OIE.[CveTipoEvento], OIE.[Folio], OIE.[Asunto], OIE.[Descripcion], OIE.[Prioridad], OIE.[CveUsuarioDe], OIE.[CveUsuarioPara],
|
||||
//OIE.[CveEventoEstatus], OIE.[FechaInicio], OIE.[FechaFin], OIE.[FechaRealTermino], OIE.[CveRevision], OIE.[Archivo], OIE.[FechaIng],
|
||||
//OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance] NombreRegistro
|
||||
}
|
||||
ObjOI_E.GetEventos2(-1, UsuarioActual.CveEmpresa, RCveEvento);
|
||||
dttareas = ObjOI_E.DtResultados;
|
||||
}
|
||||
if (UsuarioDe != null)
|
||||
{
|
||||
string[] str = UsuarioDe.Split(' ');
|
||||
if (str.Length > 0 && str[0].Length > 0)
|
||||
{
|
||||
UsuarioDeAbr = str[0].Substring(0, 1).ToUpper();
|
||||
}
|
||||
if (str.Length > 1 && str[1].Length > 0)
|
||||
{
|
||||
UsuarioDeAbr = string.Format("{0}{1}", UsuarioDeAbr, str[1].Substring(0, 1).ToUpper());
|
||||
|
||||
}
|
||||
}
|
||||
string UsuariParaAbr = "";
|
||||
if (UsuarioPara != null)
|
||||
{
|
||||
string[] str = UsuarioPara.Split(' ');
|
||||
if (str.Length > 0 && str[0].Length > 0)
|
||||
{
|
||||
UsuariParaAbr = str[0].Substring(0, 1).ToUpper();
|
||||
}
|
||||
if (str.Length > 1 && str[1].Length > 0)
|
||||
{
|
||||
UsuariParaAbr = string.Format("{0}{1}", UsuariParaAbr, str[1].Substring(0, 1).ToUpper());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder StrMail = new StringBuilder();
|
||||
StrMail.Append("<html><head><meta charset=\"UTF-8\"></head><body>");
|
||||
StrMail.Append(" <div style=\"text-align: center;\">");
|
||||
StrMail.Append(" <div style=\"display: inline-block; width: 800px; text-align: left;\">");
|
||||
StrMail.Append(" <div style=\"padding: 25px 10px 5px 10px; color: #6C6C6C; font-size: 40px; font-weight: bold;\">SIG Notificaciones</div>");
|
||||
StrMail.Append(" <div style=\"border: 1px solid #ED7D31;\"></div>");
|
||||
StrMail.Append(" <div style=\"padding: 10px 10px; text-align: center;\">");
|
||||
StrMail.Append(" <table style=\"width: 100%\">");
|
||||
StrMail.Append(" <tr>");
|
||||
StrMail.Append(" <td style=\"width: 60%; text-align:left;\" >");
|
||||
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;\">{DFechai: dd} de {DFechai: MMMM yyyy HH:mm}</span><br />");
|
||||
StrMail.Append(" </td>");
|
||||
StrMail.Append(" <td style=\"width: 20%;\">");
|
||||
StrMail.Append(" <span style=\"color: #8877A9; font-size: 25px; font-weight: bold;\">Convocatoria </span>");
|
||||
StrMail.Append(" </td>");
|
||||
StrMail.Append(" <td style=\"width: 100px;\">");
|
||||
StrMail.Append(" <img src=\"Bell.png\" style=\"width: 100px;height: 100px;\">");
|
||||
StrMail.Append(" </td>");
|
||||
StrMail.Append(" </tr>");
|
||||
StrMail.Append(" </table>");
|
||||
StrMail.Append(" <div style=\"text-align: left;color:#262626\">");
|
||||
StrMail.Append("");
|
||||
StrMail.Append(" <div style=\"background-color: #D9D9D9; padding: 5px;\">");
|
||||
StrMail.Append($" <span style=\"font-size: 32px; \">{Asunto}</span>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" <div style=\"background-color: #D9D9D9; padding: 5px; padding: 5px; padding-bottom: 25px;\">");
|
||||
StrMail.Append(" <span style=\"font-size: 18px; font-weight: bold;\">Folio:</span>");
|
||||
StrMail.Append($" <span style=\"font-size: 18px;\">{Folio}</span>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" <div style=\"background-color: #D9D9D9; padding: 5px; padding-bottom: 40px;\">");
|
||||
StrMail.Append($" <span style=\"font-size: 18px;\">{Descripcion}</span>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" <br />");
|
||||
StrMail.Append(" <div style=\"background-color: #D0CECE; padding: 5px;\">");
|
||||
StrMail.Append(" <span style=\"font-size: 20px; color: #70AD47; font-weight: bold;\">ORDEN DEL DÍA</span>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" <div style=\"text-align: left;color:#262626\">");
|
||||
StrMail.Append(Acuerdos);
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" <br />");
|
||||
|
||||
StrMail.Append(" <br />");
|
||||
StrMail.Append(" <br />");
|
||||
StrMail.Append($" <a href=\"{Link}\" style=\"padding: 10px 20px; text-align: center;\">Minuta</a>");
|
||||
StrMail.Append(" <br />");
|
||||
StrMail.Append(" <br />");
|
||||
StrMail.Append(" <div>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append(" </div>");
|
||||
StrMail.Append("</html></body>");
|
||||
return StrMail.ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user