x
This commit is contained in:
158
Nomina/RepMovtosPermanentes.aspx.cs
Normal file
158
Nomina/RepMovtosPermanentes.aspx.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
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_RepMovtosPermanentes : ClsPaginas
|
||||
{
|
||||
#region Propiedades
|
||||
|
||||
private int RcvePersonal
|
||||
{
|
||||
get { return ViewState["RcvePersonal"] != null ? (int)ViewState["RcvePersonal"] : 0; }
|
||||
set { ViewState["RcvePersonal"] = value; }
|
||||
}
|
||||
|
||||
private int RcveTipo
|
||||
{
|
||||
get { return ViewState["RcveTipo"] != null ? (int)ViewState["RcveTipo"] : 0; }
|
||||
set { ViewState["RcveTipo"] = value; }
|
||||
}
|
||||
|
||||
private int RcveSaldo
|
||||
{
|
||||
get { return ViewState["RcveSaldo"] != null ? (int)ViewState["RcveSaldo"] : 0; }
|
||||
set { ViewState["RcveSaldo"] = value; }
|
||||
}
|
||||
|
||||
private int RcveEstatus
|
||||
{
|
||||
get { return ViewState["RcveEstatus"] != null ? (int)ViewState["RcveEstatus"] : 0; }
|
||||
set { ViewState["RcveEstatus"] = value; }
|
||||
}
|
||||
|
||||
private int RcveConcepto
|
||||
{
|
||||
get { return ViewState["RcveConcepto"] != null ? (int)ViewState["RcveConcepto"] : 0; }
|
||||
set { ViewState["RcveConcepto"] = value; }
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
RcvePersonal = Request["cvePersonal"] != null ? Convert.ToInt32(Request["cvePersonal"]) : -1;
|
||||
RcveTipo = Request["cveTipo"] != null ? Convert.ToInt32(Request["cveTipo"]) : -1;
|
||||
RcveSaldo = Request["cveSaldo"] != null ? Convert.ToInt32(Request["cveSaldo"]) : -1;
|
||||
RcveEstatus = Request["cveEstatus"] != null ? Convert.ToInt32(Request["cveEstatus"]) : -1;
|
||||
RcveConcepto = Request["cveConcepto"] != null ? Convert.ToInt32(Request["cveConcepto"]) : -1;
|
||||
|
||||
CargaCombos();
|
||||
cargardatos();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void CargaCombos()
|
||||
{
|
||||
using (ClsRH orh = new ClsRH())
|
||||
{
|
||||
if (orh.GetPersonal(-1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DDlPersonal.DataSource = orh.DtResultados;
|
||||
}
|
||||
DDlPersonal.DataBind();
|
||||
}
|
||||
using (ClsNominas onom = new ClsNominas())
|
||||
{
|
||||
if (onom.GetConceptos(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DDLConcepto.DataSource = onom.DtResultados;
|
||||
}
|
||||
DDLConcepto.DataBind();
|
||||
}
|
||||
DDlPersonal.SelectedValueExist( RcvePersonal.ToString());
|
||||
DDlTipo.SelectedValueExist( RcveTipo.ToString());
|
||||
DDLSaldo.SelectedValueExist( RcveSaldo.ToString());
|
||||
DDLEstatus.SelectedValueExist( RcveEstatus.ToString());
|
||||
DDLConcepto.SelectedValueExist( RcveConcepto.ToString());
|
||||
}
|
||||
protected void cargardatos()
|
||||
{
|
||||
using (ClsNominas ObjGetM = new ClsNominas())
|
||||
{
|
||||
ObjGetM.GetMovtoPermanenteRep(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto);
|
||||
GVGetMovtoPermanenteRep.DataSource = ObjGetM.DtResultados;
|
||||
GVGetMovtoPermanenteRep.DataBind();
|
||||
|
||||
}
|
||||
upDatosGetM.Update();
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
RcvePersonal = Convert.ToInt32(DDlPersonal.SelectedValue);
|
||||
RcveTipo = Convert.ToInt32(DDlTipo.SelectedValue);
|
||||
RcveSaldo = Convert.ToInt32(DDLSaldo.SelectedValue);
|
||||
RcveEstatus = Convert.ToInt32(DDLEstatus.SelectedValue);
|
||||
RcveConcepto = Convert.ToInt32(DDLConcepto.SelectedValue);
|
||||
|
||||
cargardatos();
|
||||
}
|
||||
protected void GVGetMovtoPermanenteRep_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Row.RowType == DataControlRowType.Header)
|
||||
{
|
||||
e.Row.CssClass = "headerHide";
|
||||
}
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
string cssclass = "";
|
||||
// Obtener el valor de la columna "cvetipo"
|
||||
string cvetipoValue = DataBinder.Eval(e.Row.DataItem, "cvetipo").ToString();
|
||||
string cvepersonal = DataBinder.Eval(e.Row.DataItem, "cvepersonal").ToString();
|
||||
|
||||
// Agregar el atributo 'data-cvetipo' a la fila
|
||||
e.Row.Attributes.Add("data-cvetipo", cvetipoValue);
|
||||
e.Row.Attributes.Add("data-cvepersonal", cvepersonal);
|
||||
if (cvetipoValue == "0")
|
||||
{
|
||||
e.Row.Cells[1].Attributes.Add("colspan", "7");
|
||||
cssclass = string.Format("{0} cvetipo0", cssclass);
|
||||
}
|
||||
e.Row.CssClass = cssclass;
|
||||
}
|
||||
}
|
||||
|
||||
protected void lnkVerRegistros_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void LnkPagar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void LnkremoveMovtoPermanente_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
int CcveMovtoPermanente = gvRow.DataKey("CveMovtoPermanente").ToEntero();
|
||||
bool Continuar = false;
|
||||
using (ClsNominas ObjMovt = new ClsNominas())
|
||||
{
|
||||
Continuar = ObjMovt.RemoveMovtoPermanente(CcveMovtoPermanente);
|
||||
|
||||
}
|
||||
if (Continuar)
|
||||
{
|
||||
cargardatos();
|
||||
Alert("Se ha eliminadó el movimiento permanente");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user