This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-05-12 14:14:56 -07:00
parent 2ef099cf27
commit 7a18d716b2
6 changed files with 451 additions and 125 deletions

View File

@@ -766,7 +766,12 @@ public partial class OI_MinutaDetalle : ClsPaginas
if (HuboError == false)
{
Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion);
string script = "";
if (agendar)
{
script = string.Format("location.replace(\"/OI/ConvocatoriaDetalle.aspx?CveEventoPadre={0}\");",RCveEvento );
}
Alert("La minuta se termino con exito.", ModExtensiones.TipoMensaje.MsgInformacion,script);
objOI.Commit();
}
else
@@ -1160,93 +1165,93 @@ public partial class OI_MinutaDetalle : ClsPaginas
{
cargarAgenda();
}
bool agendar = false;
protected void BtnTerminarYAgendar_Click(object sender, EventArgs e)
{
string errorMessage = "";
//string errorMessage = "";
int cveUsuarioDe = UsuarioActual.CveUsuario;
List<int> listaCCP = new List<int>();
//int cveUsuarioPara = CveUsuarioPara;
//int cveUsuarioDe = UsuarioActual.CveUsuario;
//List<int> listaCCP = new List<int>();
////int cveUsuarioPara = CveUsuarioPara;
OITipoEventos cveTipoEvento = OITipoEventos.Agenda;
string asunto = TxtAgendaAsunto.Text;
string descripcion = string.Format("siguiente reunión Minuta \"{0}\"", TxtAsunto.Text);
int prioridad = 1;
int cveAgendaTipo = 4;
string fechaInicio = "";
string fechaFin = "1900/01/01 00:00";
if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999)
{
if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
{
errorMessage = "No se ingresó una fecha de inicio valida";
//OITipoEventos cveTipoEvento = OITipoEventos.Agenda;
//string asunto = TxtAgendaAsunto.Text;
//string descripcion = string.Format("siguiente reunión Minuta \"{0}\"", TxtAsunto.Text);
//int prioridad = 1;
//int cveAgendaTipo = 4;
//string fechaInicio = "";
//string fechaFin = "1900/01/01 00:00";
//if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999)
//{
// if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
// {
// errorMessage = "No se ingresó una fecha de inicio valida";
}
else
{
fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm");
fechaFin = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").AddHours(2).ToString("yyyy/MM/dd HH:mm");
}
}
else
{
fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
fechaFin = txtFechaI.Text.ToDateTimeExcat().AddHours(2).ToString("yyyy/MM/dd HH:mm");
}
int cveRevision = -1;
string archivoname = "";
// }
// else
// {
// fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm");
// fechaFin = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").AddHours(2).ToString("yyyy/MM/dd HH:mm");
// }
//}
//else
//{
// fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
// fechaFin = txtFechaI.Text.ToDateTimeExcat().AddHours(2).ToString("yyyy/MM/dd HH:mm");
//}
//int cveRevision = -1;
//string archivoname = "";
int cveUsuarioIng = UsuarioActual.CveUsuario;
int cveEmpresa = UsuarioActual.CveEmpresa;
bool Continuar = true;
int Folio = -1;
int CveEvento = -1;
//int cveUsuarioIng = UsuarioActual.CveUsuario;
//int cveEmpresa = UsuarioActual.CveEmpresa;
//bool Continuar = true;
//int Folio = -1;
//int CveEvento = -1;
if (errorMessage.Length == 0)
{
//if (errorMessage.Length == 0)
//{
List<string> chkList = new List<string>();
using (ClsOIEventos objOI = new ClsOIEventos())
{
objOI.IniciaTransacSQL();
foreach (var cveUsuarioPara in LCveUsuarioCCP)
{
if (Continuar)
{
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();
// List<string> chkList = new List<string>();
// using (ClsOIEventos objOI = new ClsOIEventos())
// {
// objOI.IniciaTransacSQL();
// foreach (var cveUsuarioPara in LCveUsuarioCCP)
// {
// if (Continuar)
// {
// 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)
{
LnkTerminarMinuta_Click(null, null);
//this.Alert("Se ha agregadó la nueva agenda", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("window.open(\"/OI/TareaDetalle.aspx?CveEvento={0}\", \"_blank\");", CveEvento));
}
}
// }
// else
// {
// objOI.RollBack();
// Continuar = false;
// }
// }
//if (Continuar && CveEvento > 0)
//{
agendar = true;
LnkTerminarMinuta_Click(null, null);
//this.Alert("Se ha agregadó la nueva agenda", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("window.open(\"/OI/TareaDetalle.aspx?CveEvento={0}\", \"_blank\");", CveEvento));
// }
//}
}