This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-12-23 17:24:01 -07:00
parent 38bda69982
commit a1b91ee1d5
2 changed files with 83 additions and 9 deletions

View File

@@ -155,19 +155,19 @@
<asp:GridView ID="GvConceptos" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-hover Widthall GvConceptos"
Style="text-align: center;" GridLines="None" OnRowDataBound="GvConceptos_RowDataBound"
DataKeyNames="Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD">
DataKeyNames="ConceptoP,CveConceptoP,ImporteP,EstatusP,ConceptoD,CveConceptoD,ImporteD,EstatusD">
<Columns>
<asp:TemplateField HeaderText="Concepto">
<ItemTemplate>
<asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("Concepto") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkConcepto" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("Concepto") %>'></asp:LinkButton>
<asp:Label ID="LtlConcepto" runat="server" Text='<%# Eval("ConceptoP") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkConcepto" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("ConceptoP") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="37%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Importe">
<ItemTemplate>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("Importe", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("Importe", "${0:N}") %>'></asp:LinkButton>
<asp:Label ID="LtlImporte" runat="server" Text='<%# Eval("ImporteP", "${0:N}") %>' Style="word-break: break-all;"></asp:Label>
<asp:LinkButton ID="LnkImporte" OnClick="LnkConcepto_Click" runat="server" Text='<%# Eval("ImporteP", "${0:N}") %>'></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" Width="13%" />
</asp:TemplateField>

View File

@@ -8,6 +8,32 @@ using System.Web.UI.WebControls;
partial class Nomina_Finiquito : ClsPaginas
{
private class NConcepto
{
//Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD
public string NoConceptoP { get; set; }
public string ConceptoP { get; set; }
public string LabelValorP { get; set; }
public int CveConceptoP { get; set; }
public double ImporteP { get; set; }
public double ValorP { get; set; }
public int EstatusP { get; set; }
public bool isEditedP { get; set; }
public string NoConceptoD { get; set; }
public string ConceptoD { get; set; }
public string LabelValorD { get; set; }
public int CveConceptoD { get; set; }
public double ImporteD { get; set; }
public double ValorD { get; set; }
public int EstatusD { get; set; }
public bool isEditedD { get; set; }
}
private class ConceptosPersonal
{
public ConceptosPersonal()
@@ -270,9 +296,57 @@ partial class Nomina_Finiquito : ClsPaginas
TxtPrimaPagada.Text = $"{finrow["PrimaPagada"]}";
TxtPrimaPorPagar.Text = $"{finrow["PrimaVacacionalPorPagar"]}";
}
if (ObjNom.DTSetResultados.Tables.Count > 5)
{
DataTable dtconceptos = ObjNom.DTSetResultados.Tables[1];
DataTable dtconpersonal = ObjNom.DTSetResultados.Tables[5];
int maxFila = dtconpersonal.MAX("Fila", "Tipo<3").ToEntero();
List<NConcepto> lfin = new List<NConcepto>();
if (maxFila > 0)
{
DataRow conPerrow;
DataRow conrow;
NConcepto sr;
for (int i = 1; i <= maxFila; i++)
{
sr = new NConcepto();
conPerrow = dtconpersonal.FiltroPrimero(string.Format("Tipo=1 AND Fila ={0}", i));
if (conPerrow != null)
{
sr.CveConceptoP = conPerrow["CveConcepto"].ToString().ToEntero();
conrow = dtconceptos.FiltroPrimero(string.Format("CveConcepto ={0}", sr.CveConceptoP));
sr.ConceptoP = conrow["Concepto"].ToString();
sr.ValorP = conPerrow["Valor"].ToString().ToDouble();
sr.ImporteP = conPerrow["Importe"].ToString().ToDouble();
sr.NoConceptoP = conrow["Codigo"].ToString();
}
conPerrow = dtconpersonal.FiltroPrimero(string.Format("Tipo=2 AND Fila ={0}", i));
if (conPerrow != null)
{
sr.CveConceptoD = conPerrow["CveConcepto"].ToString().ToEntero();
conrow = dtconceptos.FiltroPrimero(string.Format("CveConcepto ={0}", sr.CveConceptoD));
sr.ConceptoD = conrow["Concepto"].ToString();
sr.ValorD= conPerrow["Valor"].ToString().ToDouble();
sr.ImporteD = conPerrow["Importe"].ToString().ToDouble();
sr.NoConceptoD = conrow["Codigo"].ToString();
}
lfin.Add(sr);
}
}
GvConceptos.DataSource = lfin;
GvConceptos.DataBind();
}
}
GvConceptos.DataSource = ConceptsPersonas;
GvConceptos.DataBind();
//GvConceptos.DataSource = ConceptsPersonas;
//GvConceptos.DataBind();
}
else
retorno = false;
@@ -362,11 +436,11 @@ partial class Nomina_Finiquito : ClsPaginas
{
// Datakeys
// Concepto,CveConcepto,Importe,Estatus,ConceptoD,CveConceptoD,ImporteD,EstatusD
int CveConcepto = e.Row.DataKey("CveConcepto").ToEntero();
int CveConcepto = e.Row.DataKey("CveConceptoP").ToEntero();
int CveConceptoD = e.Row.DataKey("CveConceptoD").ToEntero();
// Dim Importe As Decimal = e.Row.DataKey("Importe").ToDecimal()
// Dim ImporteD As Decimal = e.Row.DataKey("ImporteD").ToDecimal()
int Estatus = e.Row.DataKey("Estatus").ToEntero();
int Estatus = e.Row.DataKey("EstatusP").ToEntero();
int EstatusD = e.Row.DataKey("EstatusD").ToEntero();
// Controles