nuevo catálogo de tipo gasto, PA en Resp_Today
This commit is contained in:
@@ -41,13 +41,64 @@ public partial class Compras_CatTipoGasto : ClsPaginas
|
||||
ObjAC.Dispose();
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarTiposDModal.Text = "Actualizar";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero();
|
||||
DescripcionTxt.Text = GvRow.DataKey("Descripcion");
|
||||
BtnAgregarTipoGasto.Text = "Agregar";
|
||||
TxtTipoGasto.Text = "";
|
||||
ChkEstatus.Checked = true;
|
||||
ChkEstatus.Enabled = false;
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
BtnAgregarTipoGasto.Text = "Actualizar";
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero();
|
||||
TxtTipoGasto.Text = GvRow.DataKey("TipoGasto");
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo";
|
||||
ChkEstatus.Enabled = true;
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveTipoGasto = GvRow.DataKey("CveTipoGasto").ToEntero();
|
||||
ClsAC ObjAC = new ClsAC();
|
||||
if (ObjAC.RemoveTipoGasto(CveTipoGasto))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se eliminó el Tipo de Gasto correctamente");
|
||||
}
|
||||
ObjAC.Dispose();
|
||||
}
|
||||
|
||||
protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsAC ObjAC = new ClsAC();
|
||||
if (BtnAgregarTipoGasto.Text == "Agregar")
|
||||
{
|
||||
if (ObjAC.AddTipoGasto(TxtTipoGasto.Text,UsuarioActual.CveUsuario))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se agregó el Tipo de Gasto correctamente");
|
||||
}
|
||||
}else
|
||||
{
|
||||
if (ObjAC.UpdateTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,CveTipoGasto))
|
||||
{
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
Alert("Se actualizó el Tipo de Gasto correctamente");
|
||||
}
|
||||
}
|
||||
ObjAC.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user