This commit is contained in:
138
Nomina/Acumulados.aspx.cs
Normal file
138
Nomina/Acumulados.aspx.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
public partial class Nomina_Acumulados : ClsPaginas
|
||||
{
|
||||
|
||||
#region Propiedades
|
||||
private int RcveAcumulado
|
||||
{
|
||||
get { return (ViewState["RcveAcumulado"] == null) ? 0 : Convert.ToInt32(ViewState["RcveAcumulado"]); }
|
||||
set { ViewState["RcveAcumulado"] = value; }
|
||||
}
|
||||
private int CcveAcumulado
|
||||
{
|
||||
get { return (ViewState["CcveAcumulado"] == null) ? 0: Convert.ToInt32(ViewState["CcveAcumulado"]); }
|
||||
set { ViewState["CcveAcumulado"] = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
RcveAcumulado = Request["cveAcumulado"] == null ? -1: Request["cveAcumulado"].ToString().ToEntero();
|
||||
|
||||
using (ClsNominas ObjAcum = new ClsNominas())
|
||||
{
|
||||
|
||||
ObjAcum.GetAcumuladosTipos();
|
||||
DdlTipoAcumulado.DataSource = ObjAcum.DtResultados;
|
||||
}
|
||||
DdlTipoAcumulado.DataBind();
|
||||
CargaAcumulados();
|
||||
}
|
||||
}
|
||||
protected void CargaAcumulados()
|
||||
{
|
||||
using (ClsNominas ObjAcum = new ClsNominas())
|
||||
{
|
||||
|
||||
ObjAcum.GetAcumulados(RcveAcumulado,UsuarioActual.CveEmpresa );
|
||||
GVAcumulados.DataSource = ObjAcum.DtResultados;
|
||||
}
|
||||
GVAcumulados.DataBind();
|
||||
upDatosAcum.Update();
|
||||
}
|
||||
protected void LimpiaAcumulados()
|
||||
{
|
||||
DdlTipoAcumulado.SelectedValue = "1";
|
||||
TxtAcumacumulado.Text = "";
|
||||
UPModalAcum.Update();
|
||||
}
|
||||
protected void LnkEditarAcum_Click(object sender, EventArgs e)
|
||||
{
|
||||
LimpiaAcumulados();
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CcveAcumulado = gvRow.DataKey("CveAcumulado").ToEntero();
|
||||
int cveTipoAcumulado = gvRow.DataKey("CveTipoAcumulado").ToEntero();
|
||||
string acumulado = gvRow.DataKey("Acumulado");
|
||||
|
||||
DdlTipoAcumulado .SelectedValueExist(cveTipoAcumulado.ToString());
|
||||
TxtAcumacumulado.Text = acumulado.ToString();
|
||||
this.RegistraScript("$('#DModalAcumulados').modal();");
|
||||
BtnAcumADD.Visible = false;
|
||||
BtnAcumEdit.Visible = true;
|
||||
UPModalAcum.Update();
|
||||
}
|
||||
protected void LnkAgregarAcum_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.RegistraScript("$('#DModalAcumulados').modal();");
|
||||
LimpiaAcumulados();
|
||||
BtnAcumADD.Visible = true;
|
||||
BtnAcumEdit.Visible = false;
|
||||
UPModalAcum.Update();
|
||||
}
|
||||
protected void BtnAcumADD_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
int cveTipoAcumulado = DdlTipoAcumulado.SelectedValue.ToEntero();
|
||||
string acumulado = TxtAcumacumulado.Text;
|
||||
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||
bool Continuar = false;
|
||||
using (ClsNominas ObjAcum = new ClsNominas())
|
||||
{
|
||||
|
||||
Continuar = ObjAcum.AcumuladosAdd(cveTipoAcumulado, acumulado, cveEmpresa);
|
||||
ObjAcum.Dispose();
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
this.RegistraScript("$('#DModalAcumulados').modal('hide');");
|
||||
LimpiaAcumulados();
|
||||
CargaAcumulados();
|
||||
UPModalAcum.Update();
|
||||
this.Alert("El Acumulados Se ha agregado");
|
||||
}
|
||||
}
|
||||
protected void BtnAcumEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
int cveTipoAcumulado = DdlTipoAcumulado.SelectedValue.ToEntero();
|
||||
string acumulado = TxtAcumacumulado.Text;
|
||||
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||
bool Continuar = false;
|
||||
using (ClsNominas ObjAcum = new ClsNominas())
|
||||
{
|
||||
Continuar = ObjAcum.AcumuladosUp(CcveAcumulado, cveTipoAcumulado, acumulado, cveEmpresa);
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
this.RegistraScript("$('#DModalAcumulados').modal('hide');");
|
||||
LimpiaAcumulados();
|
||||
UPModalAcum.Update();
|
||||
CargaAcumulados();
|
||||
this.Alert("El Acumulados Se ha actualizado");
|
||||
}
|
||||
}
|
||||
protected void LnkEliminarAcum_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CcveAcumulado = gvRow.DataKey("CveAcumulado").ToEntero();
|
||||
int cveEmpresa = UsuarioActual.CveEmpresa;
|
||||
bool Continuar = false;
|
||||
using (ClsNominas ObjAcum = new ClsNominas())
|
||||
{
|
||||
Continuar = ObjAcum.AcumuladosRemove(CcveAcumulado, cveEmpresa);
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
CargaAcumulados();
|
||||
this.Alert("El Acumulados Se ha Eliminado");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user