This commit is contained in:
@@ -210,6 +210,30 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
return ModExtensiones.Encripta(param);
|
||||
}
|
||||
private Boolean Actualizar
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Boolean)ViewState["Actualizar"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["Actualizar"] = value;
|
||||
}
|
||||
}
|
||||
private int CveAcercamientoGasto
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveAcercamientoGasto"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveAcercamientoGasto"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@@ -531,7 +555,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
}
|
||||
|
||||
//AUTOGUARDADO DE CAMBIO DE ETAPA
|
||||
if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1","2","3"))
|
||||
if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1", "2", "3"))
|
||||
GuardarCambioEtapa();
|
||||
}
|
||||
#endregion
|
||||
@@ -653,7 +677,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
CveEtapaActual = CveEtapaProcesoActualActualizar;
|
||||
HdfEtapaSeleccionada.Value = CveEtapaProcesoActualActualizar.ToString();
|
||||
|
||||
|
||||
}
|
||||
|
||||
ObjCRM.Dispose();
|
||||
@@ -1419,7 +1443,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
if (TieneError)
|
||||
{
|
||||
ObjCRM.RollBack();
|
||||
Alert("El archivo el eliminó correctamente.",ModExtensiones.TipoMensaje.MsgError);
|
||||
Alert("El archivo el eliminó correctamente.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1427,11 +1451,11 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
Alert("El archivo se agregó correctamente");
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
|
||||
|
||||
CargaImagenes();
|
||||
UpGaleria.Update();
|
||||
RegistraScript("$('#Modalupfotos').modal('hide');clickgaleria();");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnEliminarFoto_Click(object sender, EventArgs e)
|
||||
@@ -1493,5 +1517,113 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
GvGastos.DataBind();
|
||||
UpGastos.Update();
|
||||
}
|
||||
|
||||
protected void LbAddGastos_Click(object sender, EventArgs e)
|
||||
{
|
||||
LtlTituloModalGasto.Text = "Agregar Gasto";
|
||||
BtnAgregarGastoModal.Text = "Agregar";
|
||||
|
||||
UpModalGastos.Update();
|
||||
|
||||
TxtDescripcionGasto.Text = "";
|
||||
TxtImporteGasto.Text = "";
|
||||
|
||||
Actualizar = false;
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarGasto"));
|
||||
}
|
||||
|
||||
protected void BtnAgregarGastoModal_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
|
||||
if(!Actualizar)
|
||||
{
|
||||
if (ObjCRM.AddAcercamientosGastos(CveAcercamiento, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal(), UsuarioActual.CveUsuario))
|
||||
{
|
||||
CargaGastos();
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarGasto"), "jsHideModalFolioGarantia");
|
||||
Alert("Gasto Agregado Correctamente", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Ocurrió un error al guardar el Gasto", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjCRM.UpdateAcercamientosGastos(CveAcercamientoGasto, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal()))
|
||||
{
|
||||
CargaGastos();
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarGasto"), "jsHideModalFolioGarantia");
|
||||
Alert("Gasto Actualizado Correctamente", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Ocurrió un error al actualizar el Gasto", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
Actualizar = false;
|
||||
CveAcercamientoGasto = -1;
|
||||
|
||||
ObjCRM.Dispose();
|
||||
}
|
||||
|
||||
protected void GvGastos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DBCampo("CveAcercamiento").ToEntero() < 1)
|
||||
{
|
||||
e.Row.CssClass = "Totales";
|
||||
e.Row.Cells[0].Text = "Total";
|
||||
e.Row.FCLinkButton("ImgE").Visible = false;
|
||||
e.Row.FCLinkButton("imgD").Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void ImgE_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||
LtlTituloModalGasto.Text = "Editar Gasto";
|
||||
BtnAgregarGastoModal.Text = "Actualizar";
|
||||
Actualizar = true;
|
||||
|
||||
CveAcercamientoGasto = GvRow.DataKey("CveAcercamientoGasto").ToEntero();
|
||||
|
||||
TxtDescripcionGasto.Text = GvRow.DataKey("Descripcion");
|
||||
TxtImporteGasto.Text = GvRow.DataKey("Importe");
|
||||
|
||||
UpModalGastos.Update();
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarGasto"));
|
||||
}
|
||||
|
||||
protected void imgD_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||
CveAcercamientoGasto = GvRow.DataKey("CveAcercamientoGasto").ToEntero();
|
||||
|
||||
if (ObjCRM.RemoveAcercamientosGastos(CveAcercamientoGasto))
|
||||
{
|
||||
CargaGastos();
|
||||
Alert("Gasto eliminado Correctamente", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Ocurrió un error al eliminar el Gasto", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
ObjCRM.Dispose();
|
||||
|
||||
CveAcercamientoGasto = -1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user