Nominas
This commit is contained in:
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -53,10 +54,124 @@ public partial class Nomina_CatConcepto : ClsPaginas
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
tree_Tables();
|
||||
InicializaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
#region Arboles conceptos
|
||||
DataTable dtrefrencias;
|
||||
StringBuilder strKeys;
|
||||
StringBuilder strKeys2;
|
||||
StringBuilder strKeys3;
|
||||
public void tree_Tables()
|
||||
{
|
||||
ClsNominas objnom = new ClsNominas();
|
||||
strKeys = new StringBuilder();
|
||||
strKeys2 = new StringBuilder();
|
||||
strKeys3 = new StringBuilder();
|
||||
StringBuilder tablaarbol = new StringBuilder();
|
||||
objnom.GetNom_Refencias();
|
||||
dtrefrencias = objnom.DtResultados;
|
||||
objnom.Dispose();
|
||||
strKeys.Append("{");
|
||||
int tipo = 1;
|
||||
#region tablas
|
||||
tablaarbol.AppendLine("<ul id=\"tree_1\">");
|
||||
foreach (DataRow row in dtrefrencias.FiltraParametros($"Nivel=0 AND Tipo ={tipo}").Rows)
|
||||
{
|
||||
AddchildtoEnd(ref tablaarbol, row, " ", " ", tipo);
|
||||
}
|
||||
tablaarbol.AppendLine("</ul>");
|
||||
LtlArbolTabla.Text = tablaarbol.ToString();
|
||||
#endregion
|
||||
|
||||
#region Formulas
|
||||
tablaarbol.Clear();
|
||||
tipo = 2;
|
||||
tablaarbol.AppendLine("<ul id=\"tree_2\">");
|
||||
foreach (DataRow row in dtrefrencias.FiltraParametros($"Nivel=0 AND Tipo ={tipo}").Rows)
|
||||
{
|
||||
AddchildtoEnd(ref tablaarbol, row, " ", " ", tipo);
|
||||
}
|
||||
tablaarbol.AppendLine("</ul>");
|
||||
LtlArbolFormulas.Text = tablaarbol.ToString();
|
||||
#endregion
|
||||
|
||||
#region Funciones
|
||||
tablaarbol.Clear();
|
||||
tipo = 3;
|
||||
tablaarbol.AppendLine("<ul id=\"tree_3\">");
|
||||
foreach (DataRow row in dtrefrencias.FiltraParametros($"Nivel=0 AND Tipo ={tipo}").Rows)
|
||||
{
|
||||
AddchildtoEnd(ref tablaarbol, row, " ", " ", tipo);
|
||||
}
|
||||
tablaarbol.AppendLine("</ul>");
|
||||
LtlArbolFunciones.Text = tablaarbol.ToString();
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
if (strKeys.Length > 2)
|
||||
{
|
||||
strKeys.Remove(1, 1);
|
||||
}
|
||||
strKeys.Append("}");
|
||||
LtlKeys.Text = string.Format(" MycurrentT ={0} ; strKeys2='{1}'; strKeys3='{2}'; ", strKeys.ToString(), strKeys2.ToString(), strKeys3.ToString());
|
||||
UpTablas.Update();
|
||||
//TxtMycurrentT.Text = strKeys.ToString();
|
||||
//TxtstrKeys2.Text = strKeys2.ToString();
|
||||
//TxtstrKeys3.Text = strKeys3.ToString();
|
||||
|
||||
}
|
||||
public void AddchildtoEnd(ref StringBuilder tablaarbol, DataRow item, string identacion, string identacion2, int tipo)
|
||||
{
|
||||
string identacion3 = string.Format("{0}{1}", identacion, identacion2);
|
||||
DataTable dt = dtrefrencias.FiltraParametros($"CveNomReferenciaPadre={item["CveNomReferencia"].ToString().ToEntero()} AND Nivel= {(item["Nivel"].ToString().ToEntero() + 1)} AND Tipo ={tipo}");
|
||||
string data_jstree = "";
|
||||
if (dt.Rows.Count == 0)
|
||||
{
|
||||
data_jstree = "data-jstree='{ \"icon\" : \"fa fa-file icon-state-info \" }'";
|
||||
}
|
||||
tablaarbol.AppendLine(string.Format("{0}<li {1}>", identacion, data_jstree));
|
||||
tablaarbol.AppendLine("");
|
||||
tablaarbol.Append(identacion3);
|
||||
if (item["EsUltimo"].ToString() == "1")
|
||||
{
|
||||
tablaarbol.Append("<a href=\"javascript:addtextFormula('").Append(item["Campo"]).Append("');\"> ");
|
||||
string campo = item["Campo"].ToString();
|
||||
if (tipo < 3)
|
||||
{
|
||||
strKeys2.Append(string.Format(" {0}", campo));
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] scampos = campo.Split('(');
|
||||
campo = "";
|
||||
if (scampos.Length > 0)
|
||||
{
|
||||
campo = scampos[0].Trim();
|
||||
}
|
||||
strKeys3.Append(string.Format(" {0}", campo));
|
||||
}
|
||||
strKeys.Append(string.Format(",'{0}':[]", campo));
|
||||
}
|
||||
tablaarbol.Append(item["Texto"]);
|
||||
if (item["EsUltimo"].ToString() == "1") { tablaarbol.Append("</a>"); }
|
||||
tablaarbol.AppendLine("");
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
tablaarbol.AppendLine(string.Format("{0}<ul>", identacion3));
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
AddchildtoEnd(ref tablaarbol, row, identacion3, identacion2, tipo);
|
||||
}
|
||||
tablaarbol.AppendLine(string.Format("{0}</ul>", identacion3));
|
||||
}
|
||||
tablaarbol.AppendLine(string.Format("{0}</li>", identacion));
|
||||
|
||||
}
|
||||
#endregion
|
||||
protected void InicializaDatos()
|
||||
{
|
||||
if (Request["CveConcepto"] != null && !Request["CveConcepto"].ToString().Equals("") && Request["CveConcepto"].ToEntero() > 0)
|
||||
@@ -260,7 +375,7 @@ public partial class Nomina_CatConcepto : ClsPaginas
|
||||
TxtCodigo.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Codigo");
|
||||
TxtConcepto.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Concepto");
|
||||
DdlTipo.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("Tipo"));
|
||||
TxtFormula.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Formula");
|
||||
TxtFormulaTotal.Text = ObjNomina.DtResultados.FiltroPrimeroValor("Formula");
|
||||
if (ObjNomina.DtResultados.FiltroPrimeroValor("EsRetencion").Equals("1")) ChkRetencion.Checked = true;
|
||||
if (ObjNomina.DtResultados.FiltroPrimeroValor("TipoCalculo").Equals("True")) ChkTipoCalculo.Checked = true;
|
||||
DdlConceptoPadre.SelectedValueExist(ObjNomina.DtResultados.FiltroPrimeroValor("CveConceptoPadre"));
|
||||
@@ -307,4 +422,26 @@ public partial class Nomina_CatConcepto : ClsPaginas
|
||||
Alert("Ocurrio un error al eliminar el concepto de nómina", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkActualizarFormula_Click(object sender, EventArgs e)
|
||||
{
|
||||
tree_Tables();
|
||||
string tipo = "Total";
|
||||
if (TabsFormulas.ActiveTab == tabFormulaTotal)
|
||||
{
|
||||
tipo = "Total";
|
||||
}
|
||||
if (TabsFormulas.ActiveTab == tabFormulaGravada)
|
||||
{
|
||||
tipo = "Gravada";
|
||||
}
|
||||
LtlTituloFormula.Text = $"Actualizar Formula {tipo}";
|
||||
RegistraScript("$('#ModalDivFormula').modal()");
|
||||
UpModalFormulas.Update();
|
||||
}
|
||||
|
||||
protected void BtnUpFormula_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user