Files
SIG/OI/MinutaDetalle.aspx.cs
JORGE LUIS CAUDILLO ESPARZA a7d5417c2a oi cambios
2020-05-02 11:24:04 -07:00

1170 lines
57 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class OI_MinutaDetalle : ClsPaginas
{
#region Propiedades
public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } }
public int Folio { get { return ViewState["Folio"] != null ? ViewState["Folio"].ToString().ToEntero() : 0; } set { ViewState["Folio"] = value; } }
public decimal Avance { get { return ViewState["Avance"] != null ? ViewState["Avance"].ToString().ToEntero() : 0; } set { ViewState["Avance"] = value; } }
public int CveUsuarioPara { get { return ViewState["CveUsuarioPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioPara"] = value; } }
public int CveUsuarioDe { get { return ViewState["CveUsuarioDe"].ToString().ToEntero(); } set { ViewState["CveUsuarioDe"] = value; } }
public List<int> LCveUsuarioCCP { get { if (ViewState["LCveUsuarioCCP"] == null) { ViewState["LCveUsuarioCCP"] = new List<int>(); } return (List<int>)ViewState["LCveUsuarioCCP"]; } set { ViewState["LCveUsuarioCCP"] = value; } }
public List<int> LcveuserVisto { get { if (ViewState["LcveuserVisto"] == null) { ViewState["LcveuserVisto"] = new List<int>(); } return (List<int>)ViewState["LcveuserVisto"]; } set { ViewState["LcveuserVisto"] = value; } }
public bool EsNuevo { get { return Convert.ToBoolean(ViewState["EsNuevo"]); } set { ViewState["EsNuevo"] = value; } }
public System.Data.DataTable CheckListNew { get { return ViewState["CheckListNew"] != null ? (System.Data.DataTable)ViewState["CheckListNew"] : null; } set { ViewState["CheckListNew"] = value; } }
public int chklistitemindex { get { return ViewState["chklistitemindex"] != null ? ViewState["chklistitemindex"].ToString().ToEntero() : 0; } set { ViewState["chklistitemindex"] = value; } }
#endregion
protected void Page_Load(object sender, EventArgs e)
{
chklistitemindex = 0;
if (!IsPostBack)
{
EsNuevo = true;
DdlRoles.DataSource = get_GlobalDTRoles(UsuarioActual.CveEmpresa);
DdlRoles.DataBind();
DdlRoles.Items.Insert(0, new ListItem("Todos", "-1"));
DdlSucursales.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa);
DdlSucursales.DataBind();
DdlSucursales.Items.Insert(0, new ListItem("Todos", "-1"));
GVUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros("Estatus =1 ", "Rol ASC");
GVUsuariosB.DataSource = GVUsuarios.DataSource;
DdlTareaPara.DataSource = GVUsuarios.DataSource;
DdlTareaPara.DataBind();
DdlAgendaPara.DataSource = GVUsuarios.DataSource;
DdlAgendaPara.DataBind();
GVUsuarios.DataBind();
GVUsuariosB.DataBind();
if (Request["CveEvento"] != null)
{
RCveEvento = Request["CveEvento"].ToString().ToEntero();
}
if (RCveEvento > 0)
{
Tab.Visible = true;
EsNuevo = false;
LnkGuardar.Visible = false;
using (ClsOIEventos oieve = new ClsOIEventos())
{
oieve.UpUsuarioseventosVisto(RCveEvento, UsuarioActual.CveUsuario);
}
LoadMinuata();
}
else
{
Tab.Visible = false;
HypArchivo.Visible = false;
GVcheklist.Columns[0].Visible = false;
#region "carga check list new "
CheckListNew = new System.Data.DataTable();
//CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng
CheckListNew.Columns.Add("CveEventoCheckList", typeof(int));
CheckListNew.Columns.Add("CveEvento", typeof(int));
CheckListNew.Columns.Add("CveTipoEvento", typeof(int));
CheckListNew.Columns.Add("EventoComentario", typeof(String));
CheckListNew.Columns.Add("Estatus", typeof(bool));
CheckListNew.Columns.Add("CveUsuario", typeof(int));
CheckListNew.Columns.Add("Usuario", typeof(string));
CheckListNew.Columns.Add("FechaIng", typeof(DateTime));
#endregion
}
}
}
public void LoadMinuata()
{
GVcheklist.DataSource = new System.Data.DataTable();
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
{
if (ObjOI_E.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0)
{
portletUserNew.Visible = false;
pnlmiembrosvista.Visible = true;
TabTareas.Visible = true;
TabAgendas.Visible = true;
TabArchivos.Visible = true;
LnkTerminar_EnviarMinuta.Visible = true;
LnkEnviarMinuta.Visible = false;
TxtAsunto.Enabled = false;
TxtDescripcion.Enabled = false;
//LnkUpFileVisible = true;
//LnkUpUsuariosVisible = true;
System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0];
Folio = drow["Folio"].ToString().ToEntero();
Avance = drow["Avance"].ToString().ToDecimal();
TxtAsunto.Text = drow["Asunto"].ToString();
TxtDescripcion.Text = drow["Descripcion"].ToString();
TxtAcuerdos.Text = drow["Acuerdos"].ToString().Replace("<", "< ");
//txtFechaI.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaInicio"]);
//txtFechaF.Text = string.Format("{0:dd/MM/yyyy HH:mm}", drow["FechaFin"]);
//DdlTema.SelectedValueExist(drow["CveRevision"].ToString());
//DdlEventoEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString());
//DDlEstatus.SelectedValueExist(drow["CveEventoEstatus"].ToString());
HypArchivo.Text = string.Format("{0}<br /><i class=\"fa fa-download\"></i>", drow["Archivo"].ToString());
HypArchivo.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString()));
TxtArchivo.Visible = (drow["Archivo"].ToString().Length == 0);
portletArchivo.Visible = !TxtArchivo.Visible;
//LnkUpFile.Text = (portletArchivo.Visible ? "<i class=\"fa fa-pencil\"></i> Actualizar archivo" : "<i class=\"fa fa-plus\"></i> Agregar archivo");
//Literal3.Text = portletArchivo.Visible ? "Actualizar archivo" : "Agregar archivo";
//BtnActualizarArchivo.Text = portletArchivo.Visible ? "Actualizar" : "Agregar";
int CveUsuarioIng = drow["CveUsuarioIng"].ToString().ToEntero();
CveUsuarioDe = drow["CveUsuarioDe"].ToString().ToEntero();
CveUsuarioPara = drow["CveUsuarioPara"].ToString().ToEntero();
int CveEventoEstatus = drow["CveEventoEstatus"].ToString().ToEntero();
if (CveEventoEstatus ==4)
{
LnkEnviarMinuta.Visible = true;
LnkSaveAcuerdos.Visible = false;
LnkAgregarAgenda.Visible = false;
LnkTerminar_EnviarMinuta.Visible = false;
LnkEnviarMinuta.Visible = true;
LnkAgregarTarea.Visible = false;
}
hdnCveEventoEstatus.Value = CveEventoEstatus.ToString();
hdnCveEvento.Value = RCveEvento.ToString();
//TxtAvance.Text = string.Format("{0:##0}", drow["Avance"]);
//TxtUsuarioreg.Text = string.Format("{0}", drow["NombreRegistro"]);
//TxtFechaIng.Text = string.Format("{0:dd/MM/yyyy}", drow["FechaIng"]);
//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]
StringBuilder StrDeUser = new StringBuilder();
StringBuilder StrCCPara = new StringBuilder();
ltlTituloPage.Text = drow["Asunto"].ToString();
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);
string palomitavisto = "";
string palomitasinver = "<i class=\"fa fa-check\" aria-hidden=\"true\"></i>";
if (item["Visto"].ToString().ToEntero() == 1)
{
LcveuserVisto.Add(CveUsuario);
palomitavisto = palomitasinver;
palomitasinver = "";
}
string user = string.Format("{3}<span class=\"linkCorreo\" data-toggle=\"tooltip\" title=\"{1}\">{2}\"{0}\"</span>", item["Nombre"].ToString(), item["Correo"].ToString(), palomitavisto, palomitasinver);
if (CveUsuarioIng == CveUsuario)
{
StrDeUser.Append(user);
}
else
{
StrCCPara.Append(user);
}
}
LtlDeUser.Text = StrDeUser.ToString();
LtlCCPara.Text = StrCCPara.ToString();
}
foreach (GridViewRow gvRow in GVUsuariosB.Rows)
{
if (gvRow.RowType == DataControlRowType.DataRow)
{
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
CheckBox ChkOk = gvRow.FCCheckBox("ChkOk");
if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>()))
{
ChkOk.Checked = true;
}
}
}
if (ObjOI_E.Getcheklist(RCveEvento))
{
GVcheklist.DataSource = ObjOI_E.DtResultados;
if (ObjOI_E.DtResultados.Rows.Count > 0)
{
portletChekList.Visible = true;
}
}
cargaActividades(ObjOI_E);
}
}
cargarAgenda();
GVcheklist.DataBind();
}
#region "Acuerdos"
private void cargaActividades(ClsOIEventos ObjOI)
{
GvActividades.DataSource = null;
if (ObjOI.GetEventosComentarios(RCveEvento))
{
GvActividades.DataSource = ObjOI.DtResultados;
}
GvActividades.DataBind();
UpActividades.Update();
}
protected void GvActividades_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink HplA = e.Row.FCHyperLink("HplA");
string archivoname = e.Row.DBCampo("Archivo");
string CveComentario = e.Row.DBCampo("CveEventoComentario");
HplA.Visible = archivoname != "";
if (HplA.Visible)
{
HplA.NavigateUrl = string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, archivoname)), ModExtensiones.Encripta(archivoname));
}
}
//Visible='<%# Eval("Archivo").ToString() != "" %>' data-archivo ='<%# string.Format("",Eval("CveEventoComentario").ToString()) %>'
//string.Format("~/OI/TareaDetalle.aspx?Archivo={0}&filename={1}", ModExtensiones.Encripta(string.Format("OIFiles\\{0}\\{1}", Folio, drow["Archivo"])), ModExtensiones.Encripta(drow["Archivo"].ToString()))
}
protected void LnkAgregarchklistitem_Click(object sender, EventArgs e)
{
if (RCveEvento > 0)
{
using (ClsOIEventos objOI = new ClsOIEventos())
{
if (objOI.Addcheklist(RCveEvento, TxtActividad.Text, UsuarioActual.CveUsuario))
{
Alert("Se agregó el acuerdo", ModExtensiones.TipoMensaje.ToastInformacion);
if (objOI.Getcheklist(RCveEvento))
{
GVcheklist.DataSource = objOI.DtResultados;
GVcheklist.DataBind();
cargaActividades(objOI);
}
}
}
}
else
{
System.Data.DataRow drow = CheckListNew.NewRow();
drow["CveEventoCheckList"] = chklistitemindex++;
drow["EventoComentario"] = TxtActividad.Text;
drow["Estatus"] = false;
//CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng
CheckListNew.Rows.Add(drow);
GVcheklist.DataSource = CheckListNew;
GVcheklist.DataBind();
}
TxtActividad.Text = "";
}
protected void ChkEstatus_CheckedChanged(object sender, EventArgs e)
{
CheckBox chk = (CheckBox)sender;
GridViewRow gvrow = (GridViewRow)chk.NamingContainer;
using (ClsOIEventos objOI = new ClsOIEventos())
{
if (objOI.Upcheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), gvrow.DataKey("EventoComentario"), chk.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
Alert("Se actualizó el estatus del acuerdo", ModExtensiones.TipoMensaje.ToastInformacion);
if (objOI.Getcheklist(RCveEvento))
{
GVcheklist.DataSource = objOI.DtResultados;
GVcheklist.DataBind();
cargaActividades(objOI);
}
}
}
}
protected void LnkEliminarchek_Click(object sender, EventArgs e)
{
GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer;
if (EsNuevo)
{
CheckListNew = CheckListNew.FiltraParametros(string.Format("CveEventoCheckList <> {0}", gvrow.DataKey("CveEventoCheckList")));
GVcheklist.DataSource = CheckListNew;
GVcheklist.DataBind();
}
else
{
using (ClsOIEventos objOI = new ClsOIEventos())
{
if (objOI.Removecheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), UsuarioActual.CveUsuario))
{
Alert("Se ha eliminadó el acuerdo", ModExtensiones.TipoMensaje.ToastInformacion);
if (objOI.Getcheklist(RCveEvento))
{
GVcheklist.DataSource = objOI.DtResultados;
GVcheklist.DataBind();
cargaActividades(objOI);
}
}
}
}
}
protected void LnkSinfuncion_Click(object sender, EventArgs e)
{
}
#endregion
protected void GVUsuarios_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string CveRol = e.Row.DBCampo("CveRol");
string CveSubProyecto = e.Row.DBCampo("CveSubProyecto");
e.Row.CssClass = "items";
e.Row.Attributes.Add("data-rol", CveRol);
e.Row.Attributes.Add("data-sucursal", CveRol);
}
}
protected void LnkGuardar_Click(object sender, EventArgs e)
{
string asunto = TxtAsunto.Text;
string descripcion = TxtDescripcion.Text;
string acuerdos = TxtAcuerdos.Text.Replace("< ", "<");
int cveusuarioDe = -1;
int cveusuarioPara = -1;
if (EsNuevo)
{
string archivoname = "";
string rutaarchivoOri = "";
string ArchivoExtencion = "";
int Folio = -1;
int CveEvento = -1;
foreach (Archivo item in TxtArchivo.getfiles().Archivos)
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
}
bool Continuar = true;
List<int> lMiembros = new List<int>();
lMiembros.Add(UsuarioActual.CveUsuario);
foreach (GridViewRow gvRow in GVUsuarios.Rows)
{
if (gvRow.RowType == DataControlRowType.DataRow)
{
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
CheckBox ChkOk = gvRow.FCCheckBox("ChkOk");
if (ChkOk.Checked)
{
lMiembros.Add(CveUsuario);
//cveUsuarioDe = CveUsuario;
}
}
}
List<string> chkList = new List<string>();
if (CheckListNew != null)
{
foreach (System.Data.DataRow item in CheckListNew.Rows)
{
chkList.Add(item["EventoComentario"].ToString());
}
}
using (ClsOIEventos oieve = new ClsOIEventos())
{
oieve.IniciaTransacSQL();
Continuar = oieve.AddEventoMinuta2(asunto, descripcion, acuerdos, cveusuarioDe, cveusuarioPara, DateTime.Now, archivoname, lMiembros, chkList, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
CveEvento = oieve.CveEvento;
Folio = oieve.Folio;
if (Continuar)
{
oieve.Commit();
}
else
{
oieve.RollBack();
Continuar = false;
}
}
if (Continuar && CveEvento > 0)
{
if (rutaarchivoOri.Length > 0)
{
string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}\\", ruta, Folio);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion);
System.IO.File.Move(rutaarchivoOri, ruta);
}
this.Alert("Se ha agregadó la nueva minuta", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/MinutaDetalle.aspx?CveEvento={0}\");", CveEvento));
}
}
}
private void cargarAgenda()
{
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
{
if (ObjOI_E.GetEventos2(-1, UsuarioActual.CveEmpresa, RCveEvento) && ObjOI_E.DtResultados.Rows.Count > 0)
{
System.Data.DataTable dt = ObjOI_E.DtResultados;
GVTareas.DataSource = dt.FiltraParametros(string.Format("CveTipoEvento ={0}", (int)OITipoEventos.Tarea));
GvAgenda.DataSource = dt.FiltraParametros(string.Format("CveTipoEvento ={0}", (int)OITipoEventos.Agenda));
GVTareas.DataBind();
GvAgenda.DataBind();
}
}
}
protected void LnkAgregarTarea_Click(object sender, EventArgs e)
{
if (RCveEvento > 0)
{
string errorMessage = "";
int cveUsuarioDe = UsuarioActual.CveUsuario;
List<int> listaCCP = new List<int>();
foreach (GridViewRow gvRow in GVUsuariosB.Rows)
{
if (gvRow.RowType == DataControlRowType.DataRow)
{
CheckBox ChkOk = gvRow.FCCheckBox("ChkOk");
if (ChkOk.Checked)
{
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
listaCCP.Add(CveUsuario);
}
}
}
int cveUsuarioPara = DdlTareaPara.SelectedValue.ToEntero();
OITipoEventos cveTipoEvento = OITipoEventos.Tarea;
string asunto = TxtTareaAsunto.Text;
string descripcion = TxtTareaDescripcion.Text;
int prioridad = DdlTareaPrioridad.SelectedValue.ToEntero();
string fechaInicio = "";
if (txtTareaFechaI.Text.ToDateTimeExcat().Year <= 1999)
{
if (txtTareaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
{
errorMessage = "No se ingresó una fecha de inicio valida";
}
else
{
fechaInicio = txtTareaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm");
}
}
else
{
fechaInicio = txtTareaFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
}
string fechaFin = "";
if (txtTareaFechaF.Text.ToDateTimeExcat().Year <= 1999)
{
if (txtTareaFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
{
errorMessage = "No se ingresó una fecha fin valida";
}
else
{
fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtTareaFechaF.Text.ToDateTimeExcat("dd/MM/yyyy"));
}
}
else
{
fechaFin = txtTareaFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
}
int cveRevision = -1;
string archivoname = "";
string rutaarchivoOri = "";
string ArchivoExtencion = "";
foreach (Archivo item in TxtTareaArchivo.getfiles().Archivos)
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
}
int cveUsuarioIng = UsuarioActual.CveUsuario;
int cveEmpresa = UsuarioActual.CveEmpresa;
bool Continuar = false;
int Folio = -1;
int CveEvento = -1;
if (cveUsuarioDe <= 0)
{
errorMessage = "No se selecciono el miembro 'C C Para'";
}
if (cveUsuarioPara <= 0)
{
errorMessage = "No se selecciono el miembro 'Para'";
}
if (errorMessage.Length == 0)
{
List<string> chkList = new List<string>();
//if (CheckListNew != null)
//{
// foreach (System.Data.DataRow item in CheckListNew.Rows)
// {
// chkList.Add(item["EventoComentario"].ToString());
// }
//}
using (ClsOIEventos objOI = new ClsOIEventos())
{
objOI.IniciaTransacSQL();
Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEvento);
CveEvento = objOI.CveEvento;
Folio = objOI.Folio;
if (CveEvento == 0)
{
Continuar = false;
}
if (Continuar)
{
objOI.Commit();
}
else
{
objOI.RollBack();
Continuar = false;
}
}
if (Continuar && CveEvento > 0)
{
if (rutaarchivoOri.Length > 0)
{
string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}\\", ruta, Folio);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion);
System.IO.File.Move(rutaarchivoOri, ruta);
}
cargarAgenda();
this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion);
TxtTareaAsunto.Text = "";
TxtTareaDescripcion.Text = "";
txtTareaFechaI.Text = "";
txtTareaFechaF.Text = "";
//this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("window.open(\"/OI/TareaDetalle.aspx?CveEvento={0}\", \"_blank\");", CveEvento));
}
}
}
}
protected void LnkAgregarAgenda_Click(object sender, EventArgs e)
{
if (RCveEvento > 0)
{
string errorMessage = "";
int cveUsuarioDe = UsuarioActual.CveUsuario;
List<int> listaCCP = new List<int>();
int cveUsuarioPara = DdlAgendaPara.SelectedValue.ToEntero();
OITipoEventos cveTipoEvento = OITipoEventos.Agenda;
string asunto = TxtAgendaAsunto.Text;
string descripcion = TxtAgendaDescripcion.Text;
int prioridad = DdlAgendaPrioridad.SelectedValue.ToEntero();
int cveAgendaTipo = DdlAgendaTipo.SelectedValue.ToEntero();
string fechaInicio = "";
if (txtAgendaFechaI.Text.ToDateTimeExcat().Year <= 1999)
{
if (txtAgendaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
{
errorMessage = "No se ingresó una fecha de inicio valida";
}
else
{
fechaInicio = txtAgendaFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm");
}
}
else
{
fechaInicio = txtAgendaFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
}
string fechaFin = "1900/01/01 00:00";
int cveRevision = -1;
string archivoname = "";
string rutaarchivoOri = "";
string ArchivoExtencion = "";
foreach (Archivo item in TxtAgendaArchivo.getfiles().Archivos)
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
}
int cveUsuarioIng = UsuarioActual.CveUsuario;
int cveEmpresa = UsuarioActual.CveEmpresa;
bool Continuar = false;
int Folio = -1;
int CveEvento = -1;
if (cveUsuarioDe <= 0)
{
errorMessage = "No se selecciono el miembro 'C C Para'";
}
if (cveUsuarioPara <= 0)
{
errorMessage = "No se selecciono el miembro 'Para'";
}
if (errorMessage.Length == 0)
{
List<string> chkList = new List<string>();
//if (CheckListNew != null)
//{
// foreach (System.Data.DataRow item in CheckListNew.Rows)
// {
// chkList.Add(item["EventoComentario"].ToString());
// }
//}
using (ClsOIEventos objOI = new ClsOIEventos())
{
objOI.IniciaTransacSQL();
Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, RCveEvento, null, cveAgendaTipo);
CveEvento = objOI.CveEvento;
Folio = objOI.Folio;
if (CveEvento == 0)
{
Continuar = false;
}
if (Continuar)
{
objOI.Commit();
}
else
{
objOI.RollBack();
Continuar = false;
}
}
if (Continuar && CveEvento > 0)
{
if (rutaarchivoOri.Length > 0)
{
string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}\\", ruta, Folio);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion);
System.IO.File.Move(rutaarchivoOri, ruta);
}
this.Alert("Se ha agregadó la nueva agenda");
TxtAgendaAsunto.Text = "";
TxtAgendaDescripcion.Text = "";
txtAgendaFechaI.Text = "";
txtAgendaFechaF.Text = "";
cargarAgenda();
//this.Alert("Se ha agregadó la nueva agenda", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("window.open(\"/OI/TareaDetalle.aspx?CveEvento={0}\", \"_blank\");", CveEvento));
}
}
}
}
protected void BtnAgregarComentario_Click(object sender, EventArgs e)
{
string Comentario = TxtComentario.Text;
int CveComentario = 0;
string archivoname = "";
string rutaarchivoOri = "";
string ArchivoExtencion = "";
foreach (Archivo item in Txtfilecomentario.getfiles().Archivos)
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
}
using (ClsOIEventos objoi = new ClsOIEventos())
{
CveComentario = objoi.AddEventoComentario2(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
if (CveComentario > 0) { cargaActividades(objoi); }
}
Txtfilecomentario.Text = "";
if (CveComentario > 0)
{
if (rutaarchivoOri.Length > 0)
{
string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}\\", ruta, Folio);
if (!System.IO.Directory.Exists(ruta))
{
System.IO.Directory.CreateDirectory(ruta);
}
ruta = string.Format("{0}{1}{2}", ruta, CveComentario, archivoname);//, ArchivoExtencion);
System.IO.File.Move(rutaarchivoOri, ruta);
}
//this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregar));
this.Alert("Comentario agregadó", ModExtensiones.TipoMensaje.ToastInformacion);
//this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento));
}
TxtComentario.Text = "";
}
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)
{
if (!objOI.UpdateEstatusEvento2(4, tCveSeguimiento, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
HuboError = true;
}
else
HuboError = true;
// 'Envia minuta si es modificada
if (HuboError == false)
{
Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion);
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;
//CargaDatos();
}
protected void LnkEnviarMinuta_Click(object sender, EventArgs e)
{
EnviarMinuta();
Alert("La minuta se envió con exito.", ModExtensiones.TipoMensaje.MsgInformacion);
}
#region "enviarminuta"
private bool EnviarMinuta()
{
var Retorno = false;
StringBuilder Body;
try
{
Body = GeneraContenido(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();
ClsSisMail Mail = new ClsSisMail();
Mail.SendMail(EmpresaNotificaciones, get_GlobalDTUsuarios(UsuarioActual.CveUsuario).Rows[0]["correo"].ToString(), TxtAsunto.Text, Body.ToString(), CCP: ArrayCC);
Alert("Se Envió por correo la Minuta", ModExtensiones.TipoMensaje.MsgInformacion);
Retorno = true;
}
catch (Exception ex)
{
this.OnError("Ocurrió error al mandar MAIL", ex);
}
return Retorno;
}
private StringBuilder GeneraContenido(int CveEvento)
{
StringBuilder StrSB = new StringBuilder();
string DireccionURL = "";// GlobalDTParametros(SisParametros.URL).Cadena1;
string Variables = "";
string Tarea;
string De;
string Para;
// Dim CCP As String
string Fecha;
string Prioridad;
string Descripcion;
int Tipo;
ClsOIEventos objEvento = new ClsOIEventos();
if (objEvento.GetEvento(CveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
Tarea = objEvento.Asunto;
De = objEvento.UsuarioDe;
Para = objEvento.UsuarioPara;
Fecha = objEvento.FechaIng.ToString("dd/MM/yyyy");
Prioridad = objEvento.Prioridad;
Descripcion = objEvento.Descripcion;
Tipo = objEvento.CveTipoEvento;
StrSB.Append("<html xmlns=\"http: //www.w3.org/1999/xhtml\"> ");
StrSB.Append("<head> ");
// StrSB.AppendFormat("<link href=""{0}/Styles/Estilos.css"" rel=""stylesheet"" type=""text/css""> ", DireccionURL)
StrSB.Append(" <style type=\"text/css\"> ");
StrSB.Append(" body ");
StrSB.Append(" { ");
StrSB.Append(" margin:0px; ");
StrSB.Append(" padding:0px 0px 0px 0px; ");
StrSB.Append(" font-family: Verdana, Arial, Helvetica, sans-serif; ");
StrSB.Append(" font-size: 10px; ");
StrSB.Append(" background-color:#F0F0F0; ");
StrSB.Append(" } ");
StrSB.Append(" a.Texto ");
StrSB.Append(" { ");
StrSB.Append(" font-size:11px; ");
StrSB.Append(" background-color:#F7F6F3; ");
StrSB.Append(" text-decoration:none; ");
StrSB.Append(" font-weight:bold; ");
StrSB.Append(" } ");
StrSB.Append(" .Texto ");
StrSB.Append(" { ");
StrSB.Append(" background-color:#F7F6F3; color:Black; font-family:Verdana; font-size:10px; text-align:center; vertical-align:middle; height:20px;");
StrSB.Append(" } ");
StrSB.Append(" .TextoAlterno ");
StrSB.Append(" { ");
StrSB.Append(" background-color:White; color:Black; font-family:Verdana; font-size:10px; text-align:center; ");
StrSB.Append(" vertical-align:middle; height:20px;");
StrSB.Append(" } ");
StrSB.Append(" .BarraIdentidad ");
StrSB.Append(" { ");
StrSB.Append(" color:#FFFFFF; ");
StrSB.Append(" background:#F0F0F0; ");
StrSB.Append(" font-weight:bold; ");
StrSB.Append(" font-size:19px; ");
StrSB.Append(" font-style:oblique; ");
StrSB.Append(" } ");
StrSB.Append(" .Titulos ");
StrSB.Append(" { ");
StrSB.Append(" font-family:Verdana; font-size:12px; text-align:center; ");
StrSB.Append(" vertical-align:middle; font-weight:bold; height:30px; ");
StrSB.Append(" text-decoration:none; ");
StrSB.Append(" } ");
StrSB.Append(" .Verde {color: #00CC00;} ");
StrSB.Append(" .Negro {color: #000000;} ");
StrSB.Append(" .Rojo {color: #FF0000;} ");
StrSB.Append(" </style> ");
StrSB.Append("</head> ");
StrSB.Append("<body>");
StrSB.Append(" <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"980px\">");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">");
StrSB.Append(" <fieldset>");
StrSB.Append(" <legend>Minuta</legend>");
StrSB.Append(" <table width=\"970px\">");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"3\" style=\"width: 80px;font-weight:bold\" class=\"Texto\">ASUNTO:</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.AppendFormat(" <td colspan=\"3\" style=\"text-align:left\" ><b><a href=\"{0}{1}{2}\">{3}</a></b></td>", DireccionURL, "/OI/MinutaDetalle.aspx?CveEvento=", CveEvento, objEvento.Asunto);
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"3\" style=\"width: 80px;font-weight:bold\" class=\"Texto\">DESCRIPCION:</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.AppendFormat(" <td colspan=\"3\" style=\"text-align:left\" class=\"Texto\">{0}</td>", objEvento.Descripcion);
StrSB.Append(" </tr>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"3\" style=\"width: 80px;vertical-align: top;font-weight:bold\" class=\"Texto\">ACUERDOS:</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.AppendFormat(" <td colspan=\"3\" style=\"text-align:left\" class=\"Texto\">{0}</td>", objEvento.Acuerdos.Replace("&lt;", "<").Replace("&gt;", ">"));
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td style=\"font-weight:bold\" class=\"Texto\">FECHA:</td>");
StrSB.Append(" <td style=\"font-weight:bold\" class=\"Texto\">PARTICIPANTES:</td>");
StrSB.Append(" <td style=\"font-weight:bold\" class=\"Texto\">ARCHIVO:</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.AppendFormat(" <td style=\"\" class=\"Texto\">{0}</td>", objEvento.FechaIng.ToString("dd/MM/yyyy HH:mm"));
StrSB.AppendFormat(" <td style=\"\" class=\"Texto\">{0}</td>", objEvento.DtResultados.Rows[0]["UsuariosCCP"]);
// StrSB.AppendFormat(" <td style="""" class=""Texto"">{0}</td>", If(Not objEvento.Archivo Is Nothing AndAlso objEvento.Archivo <> "", String.Format("<a href=""{0}/Empresas/{1}/OI/{2}"">Ver archivo adjunto</a>", DireccionURL, objEvento.CveEmpresa, objEvento.Archivo), "Sin archivo adjunto"))
StrSB.AppendFormat(" <td style=\"\" class=\"Texto\">{0}</td>", objEvento.Archivo != null && objEvento.Archivo != "" ? "Con archivo adjunto" : "Sin archivo adjunto");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </fieldset>");
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">&nbsp;</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">");
StrSB.Append(" <fieldset>");
StrSB.Append(" <legend><h3>TAREAS</h3></legend>");
StrSB.Append(" <table>");
StrSB.Append(" <tr>");
StrSB.Append(" <td>");
if (objEvento.GetEventos(-1, 1, -1, "-1", "-1", -1, -1, -1, -1, -1, CveEvento, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
if (objEvento.DtResultados.Rows.Count == 0)
{
StrSB.Append(" <div>");
StrSB.Append(" <table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"width: 980px; border-collapse: collapse;\">");
StrSB.Append(" <tr class=\"Texto\">");
StrSB.Append(" <td colspan=\"6\">MINUTA SIN TAREAS</td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </div>");
}
else
{
StrSB.Append(" <div>");
StrSB.Append(" <table border=\"1\" style=\"border-collapse: collapse;\" width=\"980px\" cellpadding=\"0\" cellspacing=\"0\">");
StrSB.Append(" <tr class=\"Titulos\">");
StrSB.Append(" <td style=\"width: 202px;\">Asunto</td>");
StrSB.Append(" <td>Descripcion</td>");
StrSB.Append(" <td style=\"width: 152px\">Para</td>");
StrSB.Append(" <td style=\"width: 112px\">Inicio</td>");
StrSB.Append(" <td style=\"width: 112px\">Fin</td>");
StrSB.Append(" <td style=\"width: 102px\">Estatus</td>");
StrSB.Append(" </tr>");
// StrSB.Append(" </table>")
// StrSB.Append(" <div>")
// StrSB.Append(" <table cellspacing=""0"" rules=""all"" border=""1"" style=""width: 980px; border-collapse: collapse;"">")
int i = 0;
foreach (System.Data.DataRow RowTarea in objEvento.DtResultados.FiltraParametros("", "FechaIng Desc").Rows)
{
StrSB.AppendFormat(" <tr class=\"{0}\">", i % 2 == 0 ? "Texto" : "TextoAlterno");
StrSB.AppendFormat(" <td style=\"width: 200px;text-align:left;\">&#160;{0}</td>", RowTarea["Asunto"]);
StrSB.AppendFormat(" <td style=\"text-align:left;\">&#160;{0}</td>", RowTarea["Descripcion"]);
StrSB.AppendFormat(" <td style=\"width: 150px;text-align:left;\">&#160;{0}</td>", RowTarea["UsuarioPara"]);
StrSB.AppendFormat(" <td style=\"width: 110px;text-align:left;\">{0}</td>", RowTarea["FechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm"));
StrSB.AppendFormat(" <td style=\"width: 110px;text-align:left;\">{0}</td>", RowTarea["FechaFin"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm"));
StrSB.AppendFormat(" <td style=\"width: 100px;text-align:left;\"><a class=\"Texto\" href=\"{0}/OI/EventoDetalle.aspx?CveEvento={1}\">{2}</a></td>", DireccionURL, RowTarea["CveEvento"], RowTarea["EventoEstatus"]);
StrSB.Append(" </tr>");
i = i + 1;
}
StrSB.Append(" </table>");
StrSB.Append(" </div>");
}
}
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </fieldset>");
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">&nbsp;</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">");
StrSB.Append(" <fieldset>");
StrSB.Append(" <legend><h3>AGENDAS</h3></legend>");
StrSB.Append(" <table>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">");
if (objEvento.GetEventos(-1, 2, -1, "-1", "-1", -1, -1, -1, -1, -1, CveEvento, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
if (objEvento.DtResultados.Rows.Count == 0)
{
StrSB.Append(" <div>");
StrSB.Append(" <table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"width: 980px; border-collapse: collapse;\">");
StrSB.Append(" <tr class=\"Texto\">");
StrSB.Append(" <td colspan=\"6\">MINUTA SIN AGENDAS</td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </div>");
}
else
{
StrSB.Append(" <div>");
StrSB.Append(" <table border=\"1\" style=\"border-collapse: collapse;\" width=\"980px\" cellpadding=\"0\" cellspacing=\"0\">");
StrSB.Append(" <tr class=\"Titulos\">");
StrSB.Append(" <td style=\"width: 202px\">Asunto</td>");
StrSB.Append(" <td>Descripcion</td>");
StrSB.Append(" <td style=\"width: 152px\">Para</td>");
StrSB.Append(" <td style=\"width: 112px\">Fecha</td>");
StrSB.Append(" <td style=\"width: 112px\">Tipo Agenda</td>");
StrSB.Append(" <td style=\"width: 102px\">Estatus</td>");
StrSB.Append(" </tr>");
int i = 0;
foreach (System.Data.DataRow RowAgenda in objEvento.DtResultados.FiltraParametros("", "FechaIng Desc").Rows)
{
StrSB.AppendFormat(" <tr class=\"{0}\">", i % 2 == 0 ? "Texto" : "TextoAlterno");
StrSB.AppendFormat(" <td style=\"width: 200px;text-align:left;\" >&#160;{0}</td>", RowAgenda["Asunto"]);
StrSB.AppendFormat(" <td style=\"text-align:left;\">&#160;{0}</td>", RowAgenda["Descripcion"]);
StrSB.AppendFormat(" <td style=\"width: 150px;text-align:left;\">&#160;{0}</td>", RowAgenda["UsuarioPara"]);
StrSB.AppendFormat(" <td style=\"width: 110px;text-align:left;\">{0}</td>", RowAgenda["FechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm"));
StrSB.AppendFormat(" <td style=\"width: 110px;text-align:left;\">{0}</td>", RowAgenda["AgendaTipo"]);
StrSB.AppendFormat(" <td style=\"width: 100px;text-align:left;\">{0}</td>", RowAgenda["EventoEstatus"]);
StrSB.Append(" </tr>");
i = i + 1;
}
StrSB.Append(" </table>");
StrSB.Append(" </div>");
}
}
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </fieldset>");
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">&nbsp;</td>");
StrSB.Append(" </tr>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">");
StrSB.Append(" <fieldset>");
StrSB.Append(" <legend><h3>ARCHIVOS</h3></legend>");
StrSB.Append(" <table>");
StrSB.Append(" <tr>");
StrSB.Append(" <td colspan=\"2\">");
if (objEvento.GetEventosComentarios(CveEvento))
{
if (objEvento.DtResultados.Rows.Count == 0)
{
StrSB.Append(" <div>");
StrSB.Append(" <table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"width: 980px; border-collapse: collapse;\">");
StrSB.Append(" <tr class=\"Texto\">");
StrSB.Append(" <td colspan=\"6\">MINUTA SIN ARCHIVOS</td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </div>");
}
else
{
StrSB.Append(" <div>");
StrSB.Append(" <table border=\"1\" style=\"border-collapse: collapse;\" width=\"980px\" cellpadding=\"0\" cellspacing=\"0\">");
StrSB.Append(" <tr class=\"Titulos\">");
StrSB.Append(" <td>Descripcion</td>");
StrSB.Append(" <td style=\"width: 152px\">Adjunto</td>");
StrSB.Append(" </tr>");
int i = 0;
foreach (System.Data.DataRow RowArchivo in objEvento.DtResultados.FiltraParametros("", "FechaIng Desc").Rows)
{
StrSB.AppendFormat(" <tr class=\"{0}\">", i % 2 == 0 ? "Texto" : "TextoAlterno");
StrSB.AppendFormat(" <td style=\"text-align:left;\">&#160;{0}</td>", RowArchivo["EventoComentario"]);
if (RowArchivo["Archivo"].ToString() != "")
StrSB.AppendFormat(" <td style=\"text-align:left;\">&#160;{0}</td>", "Si");
else
StrSB.AppendFormat(" <td style=\"text-align:left;\">&#160;{0}</td>", "No");
StrSB.Append(" </tr>");
i = i + 1;
}
StrSB.Append(" </table>");
StrSB.Append(" </div>");
}
}
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append(" </fieldset>");
StrSB.Append(" </td>");
StrSB.Append(" </tr>");
StrSB.Append(" </table>");
StrSB.Append("</body>");
StrSB.Append("</html> ");
}
return StrSB;
}
#endregion
protected void LnkSaveAcuerdos_Click(object sender, EventArgs e)
{
using (ClsOIEventos ObjEventos =new ClsOIEventos()) {
ObjEventos.UpdateEventoMinuta(TxtAsunto.Text, TxtDescripcion.Text, TxtAcuerdos.Text.Replace("< ", "<"), new DateTime(1999, 1, 1), "-1", RCveEvento);
}
}
}