From 57c72a98ecadd66d3b3f03f348ecc6b2ca6f8212 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 14 Jul 2020 19:39:27 -0700 Subject: [PATCH] =?UTF-8?q?nuevo=20cat=C3=A1logo=20de=20tipo=20gasto,=20PA?= =?UTF-8?q?=20en=20Resp=5FToday?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/CatTipoGasto.aspx | 13 ++++---- Compras/CatTipoGasto.aspx.cs | 61 +++++++++++++++++++++++++++++++++--- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/Compras/CatTipoGasto.aspx b/Compras/CatTipoGasto.aspx index 0857adb09..f930bc624 100644 --- a/Compras/CatTipoGasto.aspx +++ b/Compras/CatTipoGasto.aspx @@ -8,13 +8,13 @@ - Catálogo de Motivos de Rechazo de Paquetes + Catálogo de Tipo Gastos de Rechazo de Paquetes
  • - +
  • @@ -23,7 +23,7 @@ - + @@ -45,7 +45,7 @@
    - + +

    diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs index e10e6156f..88885b992 100644 --- a/Compras/CatTipoGasto.aspx.cs +++ b/Compras/CatTipoGasto.aspx.cs @@ -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(); + } } \ No newline at end of file