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 @@
@@ -57,12 +57,13 @@
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