This commit is contained in:
@@ -9,8 +9,21 @@ using Extensiones;
|
||||
|
||||
public partial class OI_TareaDetalle : ClsPaginas
|
||||
{
|
||||
|
||||
private class OI_TareaDetalle_Permisos
|
||||
{
|
||||
public bool EntrarOI;
|
||||
public bool CheckList;
|
||||
public bool EdicionGeneral;
|
||||
public bool Bitacora;
|
||||
public bool Avance;
|
||||
public bool Reasignar;
|
||||
public bool Estatus1_2_3;
|
||||
public bool Estatus4_5;
|
||||
}
|
||||
|
||||
#region Propiedades
|
||||
public const string iddivAgregarPara = "iddivAgregarPara";
|
||||
public const string iddivAgregarMiembros = "iddivAgregarMiembros";
|
||||
public const string iddivAgregar = "divModalAgregarActividad";
|
||||
public const string iddivAgregarArchivo = "divModalAgregarArchivo";
|
||||
public const string iddivAgregarTema = "divModalAgregartema";
|
||||
@@ -21,18 +34,27 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
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; } }
|
||||
private OI_TareaDetalle_Permisos Permisos { get { return ViewState["Permisos"] == null ? null : (OI_TareaDetalle_Permisos)ViewState["Permisos"]; } set { ViewState["Permisos"] = value; } }
|
||||
public bool EsNuevo { get { return Convert.ToBoolean(ViewState["EsNuevo"]); } set { ViewState["EsNuevo"] = value; } }
|
||||
public bool LnkAgregarCheckListVisible { get { return Convert.ToBoolean(ViewState["LnkAgregarCheckListVisible"]); } set { ViewState["LnkAgregarCheckListVisible"] = value; } }
|
||||
public bool LnkUpFileVisible { get { return Convert.ToBoolean(ViewState["LnkUpFileVisible"]); } set { ViewState["LnkUpFileVisible"] = value; } }
|
||||
public bool LnkUpUsuariosVisible { get { return Convert.ToBoolean(ViewState["LnkUpUsuariosVisible"]); } set { ViewState["LnkUpUsuariosVisible"] = 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)
|
||||
{
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
LnkAgregarCheckListVisible = true;
|
||||
LnkUpFileVisible = false ;
|
||||
LnkUpUsuariosVisible = false;
|
||||
EsNuevo = true;
|
||||
CveUsuarioPara = 0;
|
||||
//System.Xml.Linq.XDocument document = new System.Xml.Linq.XDocument(new System.Xml.Linq.XElement("root", LCveUsuarioCCP.Select(x => new System.Xml.Linq.XElement("item", x))));
|
||||
CveUsuarioDe = 0;
|
||||
if (Request["Archivo"] != null)
|
||||
{
|
||||
@@ -70,7 +92,6 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
CargaTemas();
|
||||
CargaEstatus();
|
||||
cargaUsuarios();
|
||||
@@ -82,6 +103,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
{
|
||||
EsNuevo = false;
|
||||
LoadTarea();
|
||||
SetUsuarios();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -90,11 +112,71 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
TxtArchivo.Visible = true;
|
||||
CveUsuarioDe = UsuarioActual.CveUsuario;
|
||||
}
|
||||
SetUsuarios();
|
||||
|
||||
Setpermisos();
|
||||
HypArchivo.Visible = !TxtArchivo.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void Setpermisos()
|
||||
{
|
||||
bool esmiembro = UsuarioActual.CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>());
|
||||
bool esdeel = UsuarioActual.CveUsuario == CveUsuarioDe;
|
||||
bool esPara = UsuarioActual.CveUsuario == CveUsuarioPara;
|
||||
Permisos = new OI_TareaDetalle_Permisos
|
||||
{
|
||||
EntrarOI = (EsNuevo || esmiembro),
|
||||
CheckList = (EsNuevo || esdeel || esPara),
|
||||
EdicionGeneral = (EsNuevo || esdeel),
|
||||
Bitacora = esmiembro,
|
||||
Avance = esPara,
|
||||
Reasignar = esPara,
|
||||
Estatus1_2_3 = esPara,
|
||||
Estatus4_5 = esdeel
|
||||
};
|
||||
#region Permisos.EntrarOI
|
||||
|
||||
UpAcciones.Visible = Permisos.EntrarOI;
|
||||
UpTitulo.Visible = Permisos.EntrarOI;
|
||||
UpContenido.Visible = Permisos.EntrarOI;
|
||||
|
||||
if (Permisos.EntrarOI && !UsuarioActual.CveUsuario.Contiene(LcveuserVisto.ToArray<int>())) {
|
||||
using (ClsOIEventos oieve =new ClsOIEventos())
|
||||
{
|
||||
oieve.UpUsuarioseventosVisto(RCveEvento, UsuarioActual.CveUsuario);
|
||||
LcveuserVisto.Add(UsuarioActual.CveUsuario);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Permisos.CheckList
|
||||
LnkSinfuncion.Visible = Permisos.CheckList;
|
||||
LnkAgregarchklistitem.Visible = Permisos.CheckList;
|
||||
LnkAgregarCheckList.Visible = Permisos.CheckList && LnkAgregarCheckListVisible;
|
||||
GVcheklist.Columns[0].Visible = Permisos.CheckList;
|
||||
GVcheklist.Columns[3].Visible = Permisos.CheckList;
|
||||
#endregion
|
||||
#region Permisos.EdicionGeneral
|
||||
LnkGuardar.Visible = Permisos.EdicionGeneral;
|
||||
LnkUpFile.Visible = Permisos.EdicionGeneral && LnkUpFileVisible;
|
||||
LnkUpUsuarios.Visible = Permisos.EdicionGeneral && LnkUpUsuariosVisible;
|
||||
#endregion
|
||||
#region Permisos.Bitacora
|
||||
LnkAgregarActividad.Visible = Permisos.Bitacora;
|
||||
#endregion
|
||||
#region Permisos.Avance
|
||||
BtnUpAvance.Visible = Permisos.Avance;
|
||||
TxtAvance.Enabled = Permisos.Avance;
|
||||
#endregion
|
||||
#region Permisos.Reasignar
|
||||
LnkReasignar.Visible = Permisos.Reasignar;
|
||||
#endregion
|
||||
LnkcambiarEstatus.Visible = Permisos.Estatus1_2_3 || Permisos.Estatus4_5;
|
||||
|
||||
UpAcciones.Update();
|
||||
UpTitulo.Update();
|
||||
UpContenido.Update();
|
||||
}
|
||||
private void CargaTemas()
|
||||
{
|
||||
DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario));
|
||||
@@ -176,8 +258,10 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
StringBuilder StrPara = new StringBuilder();
|
||||
StringBuilder StrDeUser = new StringBuilder();
|
||||
StringBuilder StrCCPara = new StringBuilder();
|
||||
|
||||
foreach (GridViewRow gvRow in GVUsuariosB.Rows)
|
||||
{
|
||||
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
|
||||
@@ -201,24 +285,30 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
chkpara.Enabled = false;
|
||||
chkCCpara.Enabled = false;
|
||||
}
|
||||
|
||||
string palomitavisto = "";
|
||||
string palomitasinver = "<i class=\"fa fa-check\" aria-hidden=\"true\"></i>";
|
||||
if (CveUsuario ==UsuarioActual.CveUsuario || CveUsuario.Contiene(LcveuserVisto.ToArray<int>()))
|
||||
{
|
||||
palomitavisto = palomitasinver;
|
||||
palomitasinver = "";
|
||||
}
|
||||
if ((CveUsuario == CveUsuarioPara) || (CveUsuario == CveUsuarioDe))
|
||||
{
|
||||
if (CveUsuario == CveUsuarioPara)
|
||||
{
|
||||
chkpara.Checked = true;
|
||||
StrPara.AppendFormat("<span class=\"linkCorreo\" data-toggle=\"tooltip\" title=\"{1}\">\"{0}\"</span>", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString());
|
||||
StrPara.AppendFormat("{3}<span class=\"linkCorreo\" data-toggle=\"tooltip\" title=\"{1}\">{2}\"{0}\"</span>", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString(), palomitavisto, palomitasinver);
|
||||
}
|
||||
if (CveUsuario == CveUsuarioDe)
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
StrDeUser.AppendFormat("<span class=\"linkCorreo\" data-toggle=\"tooltip\" title=\"{1}\">\"{0}\"</span>", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString());
|
||||
StrDeUser.AppendFormat("{3}<span class=\"linkCorreo\" data-toggle=\"tooltip\" title=\"{1}\">{2}\"{0}\"</span>", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString(), palomitavisto, palomitasinver);
|
||||
}
|
||||
}
|
||||
else if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>()))
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
StrCCPara.AppendFormat("<span class=\"linkCorreo cssnowrap\" data-toggle=\"tooltip\" title=\"{1}\">\"{0}\"</span>; ", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString());
|
||||
StrCCPara.AppendFormat("{3}<span class=\"linkCorreo cssnowrap\" data-toggle=\"tooltip\" title=\"{1}\">{2}\"{0}\"</span>; ", gvRow.DataKey("Nombre").ToString(), gvRow.DataKey("Correo").ToString(), palomitavisto, palomitasinver);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,34 +317,6 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
LtlCCPara.Text = StrCCPara.ToString();
|
||||
|
||||
|
||||
foreach (GridViewRow gvRow in GVUsuarios.Rows)
|
||||
{
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
|
||||
CheckBox chkpara = gvRow.FCCheckBox("ChkPara");
|
||||
CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP");
|
||||
chkpara.Checked = false;
|
||||
chkCCpara.Checked = false;
|
||||
|
||||
|
||||
if ((CveUsuario == CveUsuarioPara) || (CveUsuario == CveUsuarioDe))
|
||||
{
|
||||
if (CveUsuario == CveUsuarioPara)
|
||||
{
|
||||
chkpara.Checked = true;
|
||||
}
|
||||
if (CveUsuario == CveUsuarioDe)
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
}
|
||||
}
|
||||
else if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>()))
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadTarea()
|
||||
@@ -266,7 +328,8 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
{
|
||||
PnlUsuarios.Visible = true;
|
||||
portletMiembros.Visible = false;
|
||||
LnkUpFile.Visible = true;
|
||||
LnkUpFileVisible = true;
|
||||
LnkUpUsuariosVisible = true;
|
||||
System.Data.DataRow drow = ObjOI_E.DtResultados.Rows[0];
|
||||
|
||||
Folio = drow["Folio"].ToString().ToEntero();
|
||||
@@ -297,13 +360,18 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
//OIE.[CveUsuarioIng], OIE.[CveEmpresa], OIE.[CveUsuarioModifico], OIE.[Avance]
|
||||
|
||||
LtlTitulo.Text = drow["Titulo"].ToString();
|
||||
if (ObjOI_E.GetEventosUsuario(RCveEvento, UsuarioActual.CveEmpresa))
|
||||
if (ObjOI_E.GetEventosUsuario2(RCveEvento, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
LCveUsuarioCCP.Clear();
|
||||
foreach (System.Data.DataRow item in ObjOI_E.DtResultados.Select("CveEvento >0"))
|
||||
{
|
||||
LCveUsuarioCCP.Add(item["CveUsuario"].ToString().ToEntero());
|
||||
}
|
||||
int CveUsuario = item["CveUsuario"].ToString().ToEntero();
|
||||
LCveUsuarioCCP.Add(CveUsuario );
|
||||
if(item["Visto"].ToString().ToEntero() == 1)
|
||||
{
|
||||
LcveuserVisto.Add(CveUsuario);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjOI_E.Getcheklist(RCveEvento))
|
||||
{
|
||||
@@ -311,7 +379,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
if (ObjOI_E.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
portletChekList.Visible = true;
|
||||
LnkAgregarCheckList.Visible = false;
|
||||
LnkAgregarCheckListVisible = false;
|
||||
}
|
||||
}
|
||||
cargaActividades(ObjOI_E);
|
||||
@@ -322,9 +390,9 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
|
||||
protected void LnkGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
string errorMessage = "";
|
||||
if (EsNuevo)
|
||||
{
|
||||
string errorMessage = "";
|
||||
int cveUsuarioDe = UsuarioActual.CveUsuario;
|
||||
List<int> listaCCP = new List<int>();
|
||||
int cveUsuarioPara = -1;
|
||||
@@ -347,20 +415,18 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!cveUsuarioDe.Contiene(listaCCP.ToArray<int>()))
|
||||
{
|
||||
listaCCP.Add(cveUsuarioDe);
|
||||
}
|
||||
if (!cveUsuarioPara.Contiene(listaCCP.ToArray<int>()))
|
||||
{
|
||||
listaCCP.Add(cveUsuarioPara);
|
||||
}
|
||||
//if (!cveUsuarioDe.Contiene(listaCCP.ToArray<int>()))
|
||||
//{
|
||||
// listaCCP.Add(cveUsuarioDe);
|
||||
//}
|
||||
//if (!cveUsuarioPara.Contiene(listaCCP.ToArray<int>()))
|
||||
//{
|
||||
// listaCCP.Add(cveUsuarioPara);
|
||||
//}
|
||||
OITipoEventos cveTipoEvento = OITipoEventos.Tarea;
|
||||
string asunto = TxtAsunto.Text;
|
||||
string descripcion = TxtDescripcion.Text;
|
||||
int prioridad = DdlPrioridad.SelectedValue.ToEntero();
|
||||
|
||||
|
||||
string fechaInicio = "";
|
||||
if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999)
|
||||
{
|
||||
@@ -417,6 +483,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
{
|
||||
errorMessage = "No se selecciono el miembro 'C C Para'";
|
||||
}
|
||||
|
||||
if (cveUsuarioPara <= 0)
|
||||
{
|
||||
errorMessage = "No se selecciono el miembro 'Para'";
|
||||
@@ -424,40 +491,26 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
}
|
||||
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, cveUsuarioIng, cveEmpresa);
|
||||
Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, listaCCP, chkList, cveUsuarioIng, cveEmpresa, UsuarioActual.Empresa);
|
||||
CveEvento = objOI.CveEvento;
|
||||
Folio = objOI.Folio;
|
||||
if (CveEvento == 0)
|
||||
{
|
||||
Continuar = false;
|
||||
}
|
||||
if (Continuar && CheckListNew != null)
|
||||
{
|
||||
foreach (System.Data.DataRow item in CheckListNew.Rows)
|
||||
{
|
||||
if (Continuar)
|
||||
{
|
||||
Continuar = objOI.Addcheklist(CveEvento, item["EventoComentario"].ToString(), UsuarioActual.CveUsuario);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
foreach (int item in listaCCP)
|
||||
{
|
||||
if (Continuar)
|
||||
{
|
||||
Continuar = objOI.AddEventoUsuario(CveEvento, item);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
objOI.Commit();
|
||||
@@ -489,12 +542,81 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string asunto = TxtAsunto.Text;
|
||||
string descripcion = TxtDescripcion.Text;
|
||||
int prioridad = DdlPrioridad.SelectedValue.ToEntero();
|
||||
string fechaInicio = "";
|
||||
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");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
|
||||
}
|
||||
string fechaFin = "";
|
||||
if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999)
|
||||
{
|
||||
if (txtFechaF.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", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
|
||||
}
|
||||
int cveRevision = DdlTema.SelectedValue.ToEntero();
|
||||
bool Continuar = true;
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
objOI.IniciaTransacSQL();
|
||||
Continuar = objOI.UP_Eventos2(RCveEvento, asunto, descripcion, prioridad, fechaInicio, fechaFin, cveRevision, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa);
|
||||
|
||||
if (Continuar)
|
||||
{
|
||||
objOI.Commit();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
objOI.RollBack();
|
||||
Continuar = false;
|
||||
}
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
cargaActividades(objOI);
|
||||
}
|
||||
this.Alert("Se actualizó la tarea", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (errorMessage.Length > 0)
|
||||
{
|
||||
this.Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkEliminarchek_Click(object sender, EventArgs e)
|
||||
@@ -527,14 +649,14 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
protected void LnkAgregarCheckList_Click(object sender, EventArgs e)
|
||||
{
|
||||
portletChekList.Visible = true;
|
||||
LnkAgregarCheckList.Visible = false;
|
||||
LnkAgregarCheckListVisible = false;
|
||||
if (RCveEvento > 0)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GVcheklist.Columns[0].Visible = false;
|
||||
GVcheklist.Columns[0].Visible = false;
|
||||
CheckListNew = new System.Data.DataTable();
|
||||
//CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng
|
||||
CheckListNew.Columns.Add("CveEventoCheckList", typeof(int));
|
||||
@@ -557,7 +679,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
{
|
||||
if (objOI.Addcheklist(RCveEvento, TxtActividad.Text, UsuarioActual.CveUsuario))
|
||||
{
|
||||
Alert("Se ha agregó la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
Alert("Se agregó la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(RCveEvento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
@@ -587,7 +709,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
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))
|
||||
if (objOI.Upcheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), gvrow.DataKey("EventoComentario"), chk.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa))
|
||||
{
|
||||
Alert("Se actualizó el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(RCveEvento))
|
||||
@@ -606,27 +728,35 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
|
||||
protected void BtnCambiarEstatus_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
int CveEstatus = DDlEstatus.SelectedValue.ToEntero();
|
||||
|
||||
if ((Permisos.Estatus1_2_3 && CveEstatus.Contiene(new int[] { 1, 2, 3 })) || (Permisos.Estatus4_5 && CveEstatus.Contiene(new int[] { 45 })))
|
||||
{
|
||||
|
||||
|
||||
if (objOI.UpdateEstatusEvento2(DDlEstatus.SelectedValue.ToEntero(), -1, RCveEvento, UsuarioActual.CveUsuario))
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
//CargaEstatusEventos(DdlEventoEstatus.SelectedValue.ToEntero);
|
||||
|
||||
//if (DdlEventoEstatus.SelectedValue.ToEntero == 3 | DdlEventoEstatus.SelectedValue.ToEntero == 1)
|
||||
// EnviarCorreoCambioEstatus(false);
|
||||
//CargaDatos();
|
||||
string mensaje = string.Format("Se cambio el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text);
|
||||
DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue);
|
||||
UpEstatus.Update();
|
||||
this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus));
|
||||
Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
cargaActividades(objOI);
|
||||
|
||||
if (objOI.UpdateEstatusEvento2(CveEstatus, -1, RCveEvento, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa))
|
||||
{
|
||||
//CargaEstatusEventos(DdlEventoEstatus.SelectedValue.ToEntero);
|
||||
|
||||
//if (DdlEventoEstatus.SelectedValue.ToEntero == 3 | DdlEventoEstatus.SelectedValue.ToEntero == 1)
|
||||
// EnviarCorreoCambioEstatus(false);
|
||||
//CargaDatos();
|
||||
string mensaje = string.Format("Se cambio el Estatus de \"{0}\" a \"{1}\"", DdlEventoEstatus.SelectedItem.Text, DDlEstatus.SelectedItem.Text);
|
||||
DdlEventoEstatus.SelectedValueExist(DDlEstatus.SelectedValue);
|
||||
UpEstatus.Update();
|
||||
this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivCambiarEstatus));
|
||||
Alert(mensaje, ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
cargaActividades(objOI);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Alert(string.Format("No tiene permiso para cambiar al estatus '{0}'", DDlEstatus.SelectedItem.Text), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkcambiarEstatus_Click(object sender, EventArgs e)
|
||||
@@ -686,7 +816,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
}
|
||||
using (ClsOIEventos objoi = new ClsOIEventos())
|
||||
{
|
||||
CveComentario = objoi.AddEventoComentario(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario);
|
||||
CveComentario = objoi.AddEventoComentario2(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa);
|
||||
if (CveComentario > 0) { cargaActividades(objoi); }
|
||||
}
|
||||
Txtfilecomentario.Text = "";
|
||||
@@ -711,7 +841,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
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 GvActividades_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
@@ -770,7 +900,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
bool continuar = false;
|
||||
using (ClsOIEventos objoi = new ClsOIEventos())
|
||||
{
|
||||
continuar = objoi.AddUPEventoArchivo(RCveEvento, archivoname, UsuarioActual.CveUsuario);
|
||||
continuar = objoi.AddUPEventoArchivo(RCveEvento, archivoname, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa);
|
||||
|
||||
}
|
||||
if (continuar)
|
||||
@@ -789,7 +919,7 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
bool continuar = false;
|
||||
using (ClsOIEventos objoi = new ClsOIEventos())
|
||||
{
|
||||
continuar = objoi.UPEventoAAvance(RCveEvento, TxtAvance.Text.ToDecimal(), UsuarioActual.CveUsuario);
|
||||
continuar = objoi.UPEventoAAvance(RCveEvento, TxtAvance.Text.ToDecimal(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa);
|
||||
if (continuar)
|
||||
{
|
||||
if (objoi.DtResultados.Rows.Count > 0)
|
||||
@@ -812,14 +942,223 @@ public partial class OI_TareaDetalle : ClsPaginas
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarTema));
|
||||
}
|
||||
|
||||
protected void LnkReasignar_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarMiembros));
|
||||
LtlTituloUsuarios.Text = "Reasignar Tarea";
|
||||
BtnUpMiembros.Visible = false;
|
||||
BtnReasignarTarea.Visible = true;
|
||||
foreach (GridViewRow gvRow in GVUsuarios.Rows)
|
||||
{
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
|
||||
gvRow.FCCheckBox("ChkPara").Checked = false;
|
||||
CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP");
|
||||
chkCCpara.Checked = false;
|
||||
if (CveUsuario == CveUsuarioPara)
|
||||
{
|
||||
chkCCpara.Checked = true ;
|
||||
chkCCpara.Enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
UpUsuarios.Update();
|
||||
}
|
||||
protected void LnkUpUsuarios_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarPara));
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarMiembros));
|
||||
LtlTituloUsuarios.Text = "Actualizar miembros";
|
||||
BtnUpMiembros.Visible = true;
|
||||
BtnReasignarTarea.Visible = false;
|
||||
|
||||
foreach (GridViewRow gvRow in GVUsuarios.Rows)
|
||||
{
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
|
||||
CheckBox chkpara = gvRow.FCCheckBox("ChkPara");
|
||||
CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP");
|
||||
chkpara.Checked = false;
|
||||
chkCCpara.Checked = false;
|
||||
chkCCpara.Enabled = true;
|
||||
chkpara.Enabled = true;
|
||||
|
||||
|
||||
if ((CveUsuario == CveUsuarioPara) || (CveUsuario == CveUsuarioDe))
|
||||
{
|
||||
if (CveUsuario == CveUsuarioPara)
|
||||
{
|
||||
chkpara.Checked = true;
|
||||
}
|
||||
if (CveUsuario == CveUsuarioDe)
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
}
|
||||
}
|
||||
else if (CveUsuario.Contiene(LCveUsuarioCCP.ToArray<int>()))
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
UpUsuarios.Update();
|
||||
}
|
||||
|
||||
protected void BtnUpMiembros_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<int> listaCCP = new List<int>();
|
||||
int _cveUsuarioPara = -1;
|
||||
|
||||
foreach (GridViewRow gvRow in GVUsuarios.Rows)
|
||||
{
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
|
||||
CheckBox chkpara = gvRow.FCCheckBox("ChkPara");
|
||||
CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP");
|
||||
if (chkpara.Checked)
|
||||
{
|
||||
_cveUsuarioPara = CveUsuario;
|
||||
}
|
||||
if (chkCCpara.Checked)
|
||||
{
|
||||
listaCCP.Add(CveUsuario);
|
||||
//cveUsuarioDe = CveUsuario;
|
||||
}
|
||||
}
|
||||
}
|
||||
bool continuar = false;
|
||||
using (ClsOIEventos oieve = new ClsOIEventos())
|
||||
{
|
||||
continuar = oieve.UpEventoMiembros(RCveEvento, _cveUsuarioPara, listaCCP, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario);
|
||||
if (continuar)
|
||||
{
|
||||
cargaActividades(oieve);
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
LCveUsuarioCCP = listaCCP;
|
||||
this.CveUsuarioPara = _cveUsuarioPara;
|
||||
SetUsuarios();
|
||||
Setpermisos();
|
||||
}
|
||||
UpContenido.Update();
|
||||
this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarMiembros));
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void BtnReasignarTarea_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string errorMessage = "";
|
||||
|
||||
if (!EsNuevo)
|
||||
{
|
||||
int cveUsuarioDe = UsuarioActual.CveUsuario;
|
||||
List<int> listaCCP = new List<int>();
|
||||
int cveUsuarioPara = -1;
|
||||
|
||||
foreach (GridViewRow gvRow in GVUsuarios.Rows)
|
||||
{
|
||||
if (gvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
int CveUsuario = gvRow.DataKey("CveUsuario").ToString().ToEntero();
|
||||
CheckBox chkpara = gvRow.FCCheckBox("ChkPara");
|
||||
CheckBox chkCCpara = gvRow.FCCheckBox("ChkCCP");
|
||||
if (chkpara.Checked)
|
||||
{
|
||||
cveUsuarioPara = CveUsuario;
|
||||
}
|
||||
if (chkCCpara.Checked)
|
||||
{
|
||||
listaCCP.Add(CveUsuario);
|
||||
//cveUsuarioDe = CveUsuario;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OITipoEventos cveTipoEvento = OITipoEventos.Tarea;
|
||||
string asunto = TxtAsunto.Text;
|
||||
string descripcion = TxtDescripcion.Text;
|
||||
int prioridad = DdlPrioridad.SelectedValue.ToEntero();
|
||||
string fechaInicio = "";
|
||||
if (txtFechaI.Text.ToDateTimeExcat().Year <= 1999)
|
||||
{
|
||||
fechaInicio = txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").ToString("yyyy/MM/dd HH:mm");
|
||||
}
|
||||
else
|
||||
{
|
||||
fechaInicio = txtFechaI.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
|
||||
}
|
||||
string fechaFin = "";
|
||||
if (txtFechaF.Text.ToDateTimeExcat().Year <= 1999)
|
||||
{
|
||||
fechaFin = string.Format("{0:yyyy/MM/dd} 23:59", txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy"));
|
||||
}
|
||||
else
|
||||
{
|
||||
fechaFin = txtFechaF.Text.ToDateTimeExcat().ToString("yyyy/MM/dd HH:mm");
|
||||
}
|
||||
int cveRevision = DdlTema.SelectedValue.ToEntero();
|
||||
string archivoname = "";
|
||||
string rutaarchivoOri = "";
|
||||
|
||||
|
||||
int cveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||
bool Continuar = false;
|
||||
int Folio = -1;
|
||||
int CveEvento = -1;
|
||||
|
||||
|
||||
if (cveUsuarioPara <= 0)
|
||||
{
|
||||
errorMessage = "No se selecciono el miembro 'Para'";
|
||||
|
||||
}
|
||||
if (cveUsuarioPara == cveUsuarioDe)
|
||||
{
|
||||
errorMessage = "Debe reasignar la tarea a otro usuario ";
|
||||
|
||||
}
|
||||
if (errorMessage.Length > 0)
|
||||
{
|
||||
Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<string> chkList = new List<string>();
|
||||
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, UsuarioActual.Empresa, 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)
|
||||
{
|
||||
this.Alert("Se ha agregadó la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user