This commit is contained in:
691
OI/TareaDetalle.aspx.cs
Normal file
691
OI/TareaDetalle.aspx.cs
Normal file
@@ -0,0 +1,691 @@
|
||||
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_TareaDetalle : ClsPaginas
|
||||
{
|
||||
#region Propiedades
|
||||
public const string iddivAgregar = "divModalAgregarActividad";
|
||||
public const string iddivAgregarArchivo = "divModalAgregarArchivo";
|
||||
public const string iddivAgregarTema = "divModalAgregartema";
|
||||
public const string iddivCambiarEstatus = "divModalCambiarEstatus";
|
||||
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 CveUsuarioCCPara { get { return ViewState["CveUsuarioCCPara"].ToString().ToEntero(); } set { ViewState["CveUsuarioCCPara"] = 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)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
EsNuevo = true;
|
||||
CveUsuarioPara = 0;
|
||||
CveUsuarioCCPara = 0;
|
||||
if (Request["Archivo"] != null)
|
||||
{
|
||||
string strArchivo = string.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ModExtensiones.Decripta(Request["Archivo"].ToString()));
|
||||
if (System.IO.File.Exists(strArchivo))
|
||||
{
|
||||
try
|
||||
{
|
||||
string filename = ModExtensiones.Decripta(Request["filename"].ToString());
|
||||
|
||||
System.IO.FileInfo file = new System.IO.FileInfo(strArchivo);
|
||||
string mimeType = "text/plain";
|
||||
try { mimeType = MimeMapping.GetMimeMapping(strArchivo); }
|
||||
catch (Exception) { }
|
||||
// Response.Write(path)
|
||||
Response.Clear();
|
||||
Response.ClearHeaders();
|
||||
Response.ClearContent();
|
||||
Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(filename)}");
|
||||
Response.AddHeader("Content-Length", file.Length.ToString());
|
||||
Response.ContentType = mimeType;
|
||||
Response.Flush();
|
||||
Response.TransmitFile(file.FullName);
|
||||
Response.End();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
this.RegistraScript("window.close();");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RegistraScript("window.close();");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
CargaTemas();
|
||||
CargaEstatus();
|
||||
cargaUsuarios();
|
||||
if (Request["CveEvento"] != null)
|
||||
{
|
||||
RCveEvento = Request["CveEvento"].ToString().ToEntero();
|
||||
}
|
||||
if (RCveEvento > 0)
|
||||
{
|
||||
EsNuevo = false;
|
||||
LoadTarea();
|
||||
}
|
||||
else
|
||||
{
|
||||
LtlTitulo.Text = "Tarea Nueva";
|
||||
TxtArchivo.Visible = true;
|
||||
CveUsuarioCCPara = UsuarioActual.CveUsuario;
|
||||
}
|
||||
SetUsuarios();
|
||||
HypArchivo.Visible = !TxtArchivo.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void CargaTemas()
|
||||
{
|
||||
DdlTema.DataSource = get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario));
|
||||
DdlTema.DataBind();
|
||||
DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
|
||||
}
|
||||
private void CargaEstatus()
|
||||
{
|
||||
|
||||
DdlEventoEstatus.DataSource = GlobalDTOIEstatusEventos;//get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario));
|
||||
DDlEstatus.DataSource = DdlEventoEstatus.DataSource;
|
||||
DdlEventoEstatus.DataBind();
|
||||
DDlEstatus.DataBind();
|
||||
DdlEventoEstatus.Enabled = false;
|
||||
//DdlEventoEstatus.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
|
||||
}
|
||||
private void cargaUsuarios()
|
||||
{
|
||||
string FiltroAD = "";
|
||||
|
||||
GVUsuarios.DataSource = get_GlobalDTUsuarios().FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1 {1}", UsuarioActual.CveEmpresa, FiltroAD), "Rol ASC");
|
||||
GVUsuarios.DataBind();
|
||||
}
|
||||
private void cargaActividades(ClsOIEventos ObjOI)
|
||||
{
|
||||
GvActividades.DataSource = null;
|
||||
if (ObjOI.GetEventosComentarios(RCveEvento))
|
||||
{
|
||||
GvActividades.DataSource = ObjOI.DtResultados;
|
||||
}
|
||||
GvActividades.DataBind();
|
||||
UpActividades.Update();
|
||||
}
|
||||
private void SetUsuarios()
|
||||
{
|
||||
StringBuilder para = new StringBuilder();
|
||||
StringBuilder CCpara = new StringBuilder();
|
||||
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 (EsNuevo)
|
||||
{
|
||||
chkpara.Enabled = true;
|
||||
chkCCpara.Enabled = true;
|
||||
//if (CveUsuario == CveUsuarioCCPara)
|
||||
//{
|
||||
// chkCCpara.Enabled = false;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
chkpara.Enabled = false;
|
||||
chkCCpara.Enabled = false;
|
||||
}
|
||||
|
||||
if (CveUsuario == CveUsuarioPara)
|
||||
{
|
||||
chkpara.Checked = true;
|
||||
para.AppendFormat("\"{0}\"",gvRow.DataKey("Nombre").ToString());
|
||||
}
|
||||
if (CveUsuario == CveUsuarioCCPara)
|
||||
{
|
||||
chkCCpara.Checked = true;
|
||||
CCpara.AppendFormat("\"{0}\"", gvRow.DataKey("Nombre").ToString());
|
||||
}
|
||||
|
||||
}
|
||||
LtlPara.Text = para.ToString();
|
||||
LtlCCPara.Text = CCpara.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadTarea()
|
||||
{
|
||||
GVcheklist.DataSource = new System.Data.DataTable();
|
||||
using (ClsOIEventos ObjOI_E = new ClsOIEventos())
|
||||
{
|
||||
if (ObjOI_E.GetOI_Eventos2(RCveEvento, UsuarioActual.CveEmpresa) && ObjOI_E.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
PnlUsuarios.Visible = true;
|
||||
portletMiembros.Visible = false;
|
||||
LnkUpFile.Visible = 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();
|
||||
DdlPrioridad.SelectedValueExist(drow["Prioridad"].ToString());
|
||||
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 ? "Actualizar archivo" : "Agregar archivo");
|
||||
CveUsuarioCCPara = drow["CveUsuarioDe"].ToString().ToEntero();
|
||||
CveUsuarioPara = drow["CveUsuarioPara"].ToString().ToEntero();
|
||||
TxtAvance.Text = string.Format("{0:##0}", drow["Avance"]);
|
||||
//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]
|
||||
|
||||
LtlTitulo.Text = drow["Titulo"].ToString();
|
||||
if (ObjOI_E.Getcheklist(RCveEvento))
|
||||
{
|
||||
GVcheklist.DataSource = ObjOI_E.DtResultados;
|
||||
if (ObjOI_E.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
portletChekList.Visible = true;
|
||||
LnkAgregarCheckList.Visible = false;
|
||||
}
|
||||
}
|
||||
cargaActividades(ObjOI_E);
|
||||
}
|
||||
}
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
|
||||
protected void LnkGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (EsNuevo)
|
||||
{
|
||||
string errorMessage = "";
|
||||
int cveUsuarioDe = -1;
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (txtFechaI.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
|
||||
{
|
||||
errorMessage = "no se ingreso una fecha de inicio valida";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (txtFechaF.Text.ToDateTimeExcat("dd/MM/yyyy").Year <= 1999)
|
||||
{
|
||||
errorMessage = "no se ingreso 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();
|
||||
string archivoname = "";
|
||||
string rutaarchivoOri = "";
|
||||
string ArchivoExtencion = "";
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
objOI.IniciaTransacSQL();
|
||||
Continuar = objOI.AddOI_Eventos2(cveTipoEvento, asunto, descripcion, prioridad, cveUsuarioDe, cveUsuarioPara, fechaInicio, fechaFin, cveRevision, archivoname, cveUsuarioIng, cveEmpresa);
|
||||
CveEvento = objOI.CveEvento;
|
||||
Folio = objOI.Folio;
|
||||
if (Continuar)
|
||||
{
|
||||
foreach (System.Data.DataRow item in CheckListNew.Rows)
|
||||
{
|
||||
if (Continuar)
|
||||
{
|
||||
Continuar = objOI.Addcheklist(CveEvento, item["EventoComentario"].ToString(), UsuarioActual.CveUsuario);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (Continuar && CveEvento > 0)
|
||||
{
|
||||
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 agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert(errorMessage, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 eliminado la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(RCveEvento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
GVcheklist.DataBind();
|
||||
cargaActividades(objOI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void LnkAgregarCheckList_Click(object sender, EventArgs e)
|
||||
{
|
||||
portletChekList.Visible = true;
|
||||
LnkAgregarCheckList.Visible = false;
|
||||
if (RCveEvento > 0)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GVcheklist.Columns[0].Visible = false;
|
||||
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));
|
||||
|
||||
}
|
||||
UpChkList.Update();
|
||||
}
|
||||
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 ha agregó la actividad", 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))
|
||||
{
|
||||
Alert("Se actualizo el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(RCveEvento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
GVcheklist.DataBind();
|
||||
cargaActividades(objOI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void LnkEditarCheck_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void BtnCambiarEstatus_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
|
||||
|
||||
if (objOI.UpdateEstatusEvento2(DDlEstatus.SelectedValue.ToEntero(), -1, RCveEvento, UsuarioActual.CveUsuario))
|
||||
{
|
||||
//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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void LnkcambiarEstatus_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivCambiarEstatus));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void LnkSinfuncion_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void LnkAgregarTema_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarTema));
|
||||
|
||||
}
|
||||
|
||||
protected void BtnAgregarTema_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
using (ClsOIEventos objoi = new ClsOIEventos())
|
||||
{
|
||||
if (objoi.AddRevisionesEventos(TxtTema.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
Alert("Tema agregada con éxito.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarTema));
|
||||
TxtTema.Text = "";
|
||||
set_GlobalDTOIRevision(-1, objoi.DtResultados);
|
||||
CargaTemas();
|
||||
UpContenido.Update();
|
||||
}
|
||||
else { Alert("Ocurrió un error al agregar la revisión. Por favor vuelva a intentar.", ModExtensiones.TipoMensaje.MsgError); }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkAgregarActividad_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregar));
|
||||
}
|
||||
|
||||
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.AddEventoComentario(RCveEvento, Comentario, archivoname, UsuarioActual.CveUsuario);
|
||||
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 agregado", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
//this.Alert("Se ha agregado la nueva tarea", ModExtensiones.TipoMensaje.MsgInformacion, string.Format("location.replace(\"/OI/TareaDetalle.aspx?CveEvento={0}\");", CveEvento));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 LnkUpFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RegistraScript(string.Format("$('#{0}').modal()", iddivAgregarArchivo));
|
||||
|
||||
}
|
||||
|
||||
protected void BtnActualizarArchivo_Click(object sender, EventArgs e)
|
||||
{
|
||||
string archivoname = "";
|
||||
string rutaarchivoOri = "";
|
||||
string ArchivoExtencion = "";
|
||||
foreach (Archivo item in txtActualizarArchivo.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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
string rutafin = string.Format("{0}{1}", ruta, archivoname);//, ArchivoExtencion);
|
||||
int index = 0;
|
||||
while (System.IO.File.Exists(rutafin))
|
||||
{
|
||||
archivoname = string.Format("{0}{1}", index++, archivoname);
|
||||
rutafin = string.Format("{0}{1}", ruta, archivoname);
|
||||
}
|
||||
System.IO.File.Move(rutaarchivoOri, rutafin);
|
||||
bool continuar = false;
|
||||
using (ClsOIEventos objoi = new ClsOIEventos())
|
||||
{
|
||||
continuar = objoi.AddUPEventoArchivo(RCveEvento, archivoname, UsuarioActual.CveUsuario);
|
||||
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
LoadTarea();
|
||||
this.RegistraScript(string.Format("$('#{0}').modal('hide')", iddivAgregarArchivo));
|
||||
this.Alert("Archivo Actualizado", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
}
|
||||
UpContenido.Update();
|
||||
}
|
||||
|
||||
protected void BtnUpAvance_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
bool continuar = false;
|
||||
using (ClsOIEventos objoi = new ClsOIEventos())
|
||||
{
|
||||
continuar = objoi.UPEventoAAvance(RCveEvento, TxtAvance.Text.ToDecimal(), UsuarioActual.CveUsuario);
|
||||
if (continuar){
|
||||
if (objoi.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
LtlTitulo.Text = objoi.DtResultados.Rows[0]["Titulo"].ToString();
|
||||
}
|
||||
cargaActividades(objoi);
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
this.Alert("Avance Actualizado", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
|
||||
}
|
||||
UpTitulo.Update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user