diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index e64998d23..70216cd06 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -1863,23 +1863,27 @@ Public Class ClsNominas Public Function GetInversionNomina(CveEmpresa As Integer, Optional FechaInicio As String = "", Optional FechaFin As String = "", Optional CveProyecto As Integer = -1, Optional CveSubProyecto As Integer = -1, - Optional Cve1 As Integer = -1, Optional Cve2 As Integer = -1, + Optional Agrupador As Integer = -1, Optional CveDepartamento As Integer = -1, Optional CveStr1 As String = "-1", Optional CveStr2 As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_InversionNominaGET") With SqlAdapter.SelectCommand.Parameters - .Add("FechaInicio", SqlDbType.Int).Value = FechaInicio - .Add("FechaFin", SqlDbType.Int).Value = FechaFin + .Add("FechaInicio", SqlDbType.VarChar).Value = FechaInicio + .Add("FechaFin", SqlDbType.VarChar).Value = FechaFin .Add("CveProyecto", SqlDbType.Int).Value = CveProyecto .Add("CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("Cve1", SqlDbType.Int).Value = Cve1 - .Add("Cve2", SqlDbType.Int).Value = Cve2 - .Add("CveStr1", SqlDbType.Int).Value = CveStr1 - .Add("CveStr2", SqlDbType.Int).Value = CveStr2 - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("Agrupador", SqlDbType.Int).Value = Agrupador + .Add("CveDepartamento", SqlDbType.Int).Value = CveDepartamento + .Add("CveStr1", SqlDbType.VarChar).Value = CveStr1 + .Add("CveStr2", SqlDbType.VarChar).Value = CveStr2 + .Add("CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try - SqlAdapter.Fill(Data) + DTSet = New DataSet() + SqlAdapter.Fill(DTSet) + If DTSet.Tables.Count > 0 Then + Data = DTSet.Tables(0) + End If Retorno = True Catch Ex1 As SqlException Me.OnError("Ocurrió un error al obtener el reporte de inversión de nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index fed58606b..563eb084e 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3331,6 +3331,7 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/CatConceptos2.aspx".ToUpper(), -1) PaginaDict.Add("/Nomina/Aguinaldo.aspx".ToUpper(), -1) + PaginaDict.Add("/Nomina/RepInversiondeNomina.aspx".ToUpper(), 906) PaginaDict.Add("/Nomina/FiniquitoB.aspx".ToUpper(), -1) ''CONFIGURACIONES GENERALES PaginaDict.Add("/Sistemas/SistemaSIG.aspx".ToUpper(), 9999) diff --git a/Empresas/Grales/Lista de Raya.docx b/Empresas/Grales/Lista de Raya.docx new file mode 100644 index 000000000..5ae3419c2 Binary files /dev/null and b/Empresas/Grales/Lista de Raya.docx differ diff --git a/Empresas/Grales/RepInversionNomina.rdlc b/Empresas/Grales/RepInversionNomina.rdlc new file mode 100644 index 000000000..f5939d725 --- /dev/null +++ b/Empresas/Grales/RepInversionNomina.rdlc @@ -0,0 +1,773 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 1f7ab5df-1d00-4763-8479-9ab750b1589a + + + + + + DsInventarios + /* Local Query */ + + + + Tipo + System.Int + + + CveProyecto + System.Int + + + Proyecto + System.String + + + CveSubProyecto + System.Int + + + SubProyecto + System.String + + + CveDepartamento + System.Int + + + Departamento + System.String + + + CvePuesto + System.Int + + + Puesto + System.String + + + Neto + System.Decimal + + + Obligaciones + System.Decimal + + + Total + System.Decimal + + + + DsInventarios + C:\inetpub\wwwVentas\App_Code\DsInventarios.xsd + DtMovimientos + + + + + + + + + + + + + + + 3.75041cm + + + 3.70674cm + + + 2.13564cm + + + 2.83831cm + + + 2.74165cm + + + 2.76458cm + + + + + 0.6cm + + + + + true + true + + + + + Sub Proyecto + + + + + + + Textbox7 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Departamento + + + + + + + Textbox9 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Puesto + + + + + + + Textbox11 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Neto + + + + + + + Textbox13 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Obligaciones + + + + + + + Textbox25 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Total + + + + + + + Textbox2 + + + + Black + + 1pt + + + Black + + 1pt + + White + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.43773cm + + + + + true + true + + + + + =Fields!SubProyecto.Value + + + + + + =IIF( Fields!Tipo.Value=1,"Gray",IIF( Fields!Tipo.Value=2, "Silver",IIF( Fields!Tipo.Value=3, "LightGrey","No Color"))) + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + true + + + + + + true + true + + + + + =Fields!Departamento.Value + + + + + + + Departamento + + + =IIF( Fields!Tipo.Value=1,"Gray",IIF( Fields!Tipo.Value=2, "Silver",IIF( Fields!Tipo.Value=3, "LightGrey","No Color"))) + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!Puesto.Value + + + + + + =IIF( Fields!Tipo.Value=1,"Gray",IIF( Fields!Tipo.Value=2, "Silver",IIF( Fields!Tipo.Value=3, "LightGrey","No Color"))) + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!Neto.Value + + + + + + + Neto + + + =IIF( Fields!Tipo.Value=1,"Gray",IIF( Fields!Tipo.Value=2, "Silver",IIF( Fields!Tipo.Value=3, "LightGrey","No Color"))) + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!Obligaciones.Value + + + + + + + Obligaciones + + + =IIF( Fields!Tipo.Value=1,"Gray",IIF( Fields!Tipo.Value=2, "Silver",IIF( Fields!Tipo.Value=3, "LightGrey","No Color"))) + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + true + true + + + + + =Fields!Total.Value + + + + + + + Total + + + =IIF( Fields!Tipo.Value=1,"Gray",IIF( Fields!Tipo.Value=2, "Silver",IIF( Fields!Tipo.Value=3, "LightGrey","No Color"))) + 2pt + 2pt + =IIf(RowNumber(Nothing)=1,"1pt","0pt") + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + + + + DsInventarios + 0.17639cm + 0.12931cm + 1.03773cm + 17.93733cm + + + + + + 1.21412cm + 0.2141cm + 0cm + 17.08525cm + 1 + + + + + + 0.72916in + + + + + + + + + =Parameters!Empresa.Value + + + + + + + Textbox1 + 2.46711cm + 1.54368cm + 12.83495cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!PageNumber + + + + / + + + + =Globals!TotalPages + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 1.42875cm + true + true + + + + + 27.94cm + 21.59cm + 1cm + 1cm + 1cm + 1cm + 0.13cm + + + + Reporte de inversión de nómina + + + + +
  • + Exportar +
  • +
  • + Exportar +
  • +
    + + + + + + +
    +
    +
    + + <%-- --%> +
    +
    + +
    + + + +
    + + +
    + + + +
    + + +
    + + +
    + +
    + + + + + +
    +
    + +
    + +
    + + + + + +
    +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + diff --git a/Nomina/RepInversiondeNomina.aspx.cs b/Nomina/RepInversiondeNomina.aspx.cs new file mode 100644 index 000000000..61569ef53 --- /dev/null +++ b/Nomina/RepInversiondeNomina.aspx.cs @@ -0,0 +1,458 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +using Microsoft.VisualBasic; +using System.Data; +using System.Data.SqlClient; +using System.Configuration; +using Microsoft.Reporting.WebForms; + +public partial class Nomina_RepInversiondeNomina : ClsPaginas +{ + #region Propiedades + private string RfechaInicio + { + get { return (ViewState["RfechaInicio"] == null) ? "" : Convert.ToString(ViewState["RfechaInicio"]); } + set { ViewState["RfechaInicio"] = value; } + } + private string RfechaFin + { + get { return (ViewState["RfechaFin"] == null) ? "" : Convert.ToString(ViewState["RfechaFin"]); } + set { ViewState["RfechaFin"] = value; } + } + private int RcveProyecto + { + get { return (ViewState["RcveProyecto"] == null) ? 0 : Convert.ToInt32(ViewState["RcveProyecto"]); } + set { ViewState["RcveProyecto"] = value; } + } + private int RcveSubProyecto + { + get { return (ViewState["RcveSubProyecto"] == null) ? 0 : Convert.ToInt32(ViewState["RcveSubProyecto"]); } + set { ViewState["RcveSubProyecto"] = value; } + } + private int Ragrupador + { + get { return (ViewState["Ragrupador"] == null) ? 0 : Convert.ToInt32(ViewState["Ragrupador"]); } + set { ViewState["Ragrupador"] = value; } + } + private int RCveDepartamento + { + get { return (ViewState["RCveDepartamento"] == null) ? 0 : Convert.ToInt32(ViewState["RCveDepartamento"]); } + set { ViewState["RCveDepartamento"] = value; } + } + private string RcveStr1 + { + get { return (ViewState["RcveStr1"] == null) ? "" : Convert.ToString(ViewState["RcveStr1"]); } + set { ViewState["RcveStr1"] = value; } + } + private string RcveStr2 + { + get { return (ViewState["RcveStr2"] == null) ? "" : Convert.ToString(ViewState["RcveStr2"]); } + set { ViewState["RcveStr2"] = value; } + } + + #endregion + + protected override void Page_PreInit(object sender, EventArgs e) + { + if (!User.Identity.IsAuthenticated || UsuarioActual == null) + { + bool AuthorizeRequest = false; + var statusCode = 200; + + AuthorizeRequest = false; + + Response.StatusCode = statusCode; + if (!AuthorizeRequest) + { + Usuario.CerrarSession(); + Response.End(); + } + } + else + { + if (!Page.IsPostBack) + { + + CveModulo = 906; + if (!UsuarioActual.TienePermisoPagina(CveModulo)) + Response.Redirect(System.Web.Security.FormsAuthentication.DefaultUrl); + } + if (UsuarioActual.CveEmpresa == 42) + this.MasterPageFile = "~/Masters/Site42.master"; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1); + DdlSubProyecto.DataBind(); + DdlSubProyecto.Items.Insert(0, new ListItem("Todos", "-1")); + DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros(string.Format("CveEmpresa ={0} AND Departamento <> 'Seleccione' ", UsuarioActual.CveEmpresa)); + DdlDepartamento.DataBind(); + DdlDepartamento.Items.Insert(0, new ListItem("Todos", "-1")); + + TxtFechaInicio.Text = Request["fechaInicio"] == null ? DateTime.Now.ToString("01/MM/yyyy") : Request["fechaInicio"].ToString().ToDateTime().ToString("dd/MM/yyyy"); + TxtFechaFin.Text = Request["fechaFin"] == null ? "" : Request["fechaFin"].ToString().ToDateTime().ToString("dd/MM/yyyy"); + + + + RfechaFin = TxtFechaFin.Text.Length > 9 ? TxtFechaFin.Text.ToDate().ToString("yyyyMMdd") : ""; + RfechaInicio = TxtFechaInicio.Text.Length > 9 ? TxtFechaInicio.Text.ToDate().ToString("yyyyMMdd") : ""; + + RcveProyecto = Request["cveProyecto"] == null ? 0 : Request["cveProyecto"].ToString().ToEntero(); + RcveSubProyecto = Request["cveSubProyecto"] == null ? -1 : Request["cveSubProyecto"].ToString().ToEntero(); + Ragrupador = Request["agrupador"] == null ? 0 : Request["agrupador"].ToString().ToEntero(); + RCveDepartamento = Request["CveDepartamento"] == null ? -1 : Request["CveDepartamento"].ToString().ToEntero(); + RcveStr1 = Request["cveStr1"] == null ? "0" : Request["cveStr1"].ToString(); + RcveStr2 = Request["cveStr2"] == null ? "0" : Request["cveStr2"].ToString(); + + //TxtFiltrocveProyecto.Text = RcveProyecto.ToString(); + DdlSubProyecto.SelectedValueExist(RcveSubProyecto.ToString()); + //TxtFiltroagrupador.Text = Ragrupador.ToString(); + CargaInversionNominaGET(); + } + + } + + protected void CargaInversionNominaGET() + { + using (ClsNominas ObjPA_N = new ClsNominas()) + { + ObjPA_N.GetInversionNomina(UsuarioActual.CveEmpresa, RfechaInicio, RfechaFin, RcveProyecto, RcveSubProyecto, Ragrupador, RCveDepartamento, RcveStr1, RcveStr2); + GVInversionNomina.DataSource = ObjPA_N.DtResultados; + if (ObjPA_N.DTSetResultados.Tables.Count > 1 && 0 == 1) + { + DataTable dtConceptos = ObjPA_N.DTSetResultados.Tables[1]; + int CurrentColumn = 4; + BoundField bf; + foreach (DataRow row in dtConceptos.Rows) + { + int CveConcepto = row["CveConcepto"].ToString().ToEntero(); + string Concepto = row["Concepto"].ToString(); + GVInversionNomina.Columns[CurrentColumn].ItemStyle.BackColor = System.Drawing.Color.Transparent; + GVInversionNomina.Columns[CurrentColumn].Visible = true; + bf = (BoundField)GVInversionNomina.Columns[CurrentColumn]; + bf.DataField = string.Format("C_{0}", CveConcepto); + bf.HeaderText = Concepto; + CurrentColumn++; + } + while (CurrentColumn < 34) + { + bf = (BoundField)GVInversionNomina.Columns[CurrentColumn]; + bf.DataField = ""; + GVInversionNomina.Columns[CurrentColumn].Visible = false; + + CurrentColumn++; + } + + } + ObjPA_N.Dispose(); + } + GVInversionNomina.DataBind(); + upDatosPA_N.Update(); + } + + protected void GVInversionNomina_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + string tipo = e.Row.DBCampo("Tipo").ToString(); + e.Row.CssClass = string.Format("Tipo{0}", tipo); + } + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + RfechaFin = TxtFechaFin.Text.Length > 9 ? TxtFechaFin.Text.ToDate().ToString("yyyyMMdd") : ""; + RfechaInicio = TxtFechaInicio.Text.Length > 9 ? TxtFechaInicio.Text.ToDate().ToString("yyyyMMdd") : ""; + RCveDepartamento = DdlDepartamento.SelectedValue.ToEntero(); + RcveSubProyecto = DdlSubProyecto.SelectedValue.ToEntero(); + CargaInversionNominaGET(); + } + + protected void LnkExportarEXcel_Click(object sender, EventArgs e) + { + DataTable DtMovimientos = new DataTable(); + List parametross = new List(); + parametross.Add(new ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)); + + using (ClsNominas ObjPA_N = new ClsNominas()) + { + ObjPA_N.GetInversionNomina(UsuarioActual.CveEmpresa, RfechaInicio, RfechaFin, RcveProyecto, RcveSubProyecto, Ragrupador, RCveDepartamento, RcveStr1, RcveStr2); + DtMovimientos = ObjPA_N.DtResultados; + } + + ImprimirPDF("Empresas/Grales/RepInversionNomina.rdlc", DtMovimientos, parametross, String.Format("Reporte de Inversión de Nómina {0}", ""), "Excel", "DsInventarios", null); + } + + protected void LnkExportarPDF_Click(object sender, EventArgs e) + { + + DataTable DtMovimientos = new DataTable(); + List parametross = new List(); + parametross.Add(new ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)); + + using (ClsNominas ObjPA_N = new ClsNominas()) + { + ObjPA_N.GetInversionNomina(UsuarioActual.CveEmpresa, RfechaInicio, RfechaFin, RcveProyecto, RcveSubProyecto, Ragrupador, RCveDepartamento, RcveStr1, RcveStr2); + DtMovimientos = ObjPA_N.DtResultados; + } + + ImprimirPDF("Empresas/Grales/RepInversionNomina.rdlc", DtMovimientos, parametross, String.Format("Reporte de Inversión de Nómina {0}", ""), "PDF", "DsInventarios", null); + } +} + + +//public class ClsNominasZ : IDisposable +//{ +// #region CLASE + +// // SQL ClsNominas_Nominas +// private SqlConnection SqlConexion; +// private SqlDataAdapter SqlAdapter; +// private SqlCommand SqlCommand; +// private SqlTransaction SqlTransacc; +// private DataTable Data; +// private bool disposedValue = false; // Para detectar llamadas redundantes +// protected DataSet DTSet; + +// public DataSet DTSetResultados +// { +// get +// { +// return DTSet; +// } +// } // REGISTRAR CONEXIONES ABIERTAS +// private int CveConexion = 0; + + +// public int CveNomina { get; set; } +// public int CveNominaTipo { get; set; } +// public string FolioFiscal { get; set; } +// public string Serie { get; set; } +// public int Folio { get; set; } +// public string RegistroPatronal { get; set; } +// public string SerieFolio { get; set; } +// public string NominaFolio { get; set; } +// public double DiasPagados { get; set; } +// public double SubTotal { get; set; } +// public double Descuento { get; set; } +// public double RetISR { get; set; } +// public double Total { get; set; } +// public string FormaPago { get; set; } +// public DateTime Fecha { get; set; } +// public string MotivoDescuento { get; set; } +// public string EnvioMail { get; set; } +// public string SeTimbro { get; set; } +// public int CvePeriodo { get; set; } +// // Public Property TipoPeriodo As String +// public int CvePersonal { get; set; } +// public string Codigo { get; set; } +// public string Nombre { get; set; } +// public string RFC { get; set; } +// public int CveMetodoPago { get; set; } +// public string MetodoPago { get; set; } +// public int CveEstatusCFDi { get; set; } +// public string EstatusCFDi { get; set; } +// public int CveUsuario { get; set; } +// public string Usuario { get; set; } +// public int CveEmpresa { get; set; } + +// public DataTable DtResultados +// { +// get +// { +// return Data; +// } +// } + + +// public int CveTipoPeriodo { get; set; } +// public string TipoPeriodo { get; set; } +// public int Ejercicio { get; set; } +// public int Mes { get; set; } +// public int Numero { get; set; } +// public DateTime FechaInicio { get; set; } +// public DateTime FechaFin { get; set; } +// public bool EsInicioMes { get; set; } +// public bool EsFinMes { get; set; } +// public bool EsInicioSS { get; set; } +// public bool EsFinSS { get; set; } +// public bool EsInicioAño { get; set; } +// public bool EsFinAño { get; set; } +// public bool FueCalculado { get; set; } +// public int Estatus { get; set; } +// public int NumPeriodo { get; set; } +// public DateTime FechaIng { get; set; } +// public DateTime FechaPago { get; set; } + +// public void IniciaTransacSQL() +// { +// SqlTransacc = SqlConexion.BeginTransaction(); +// } +// public void Commit() +// { +// SqlTransacc.Commit(); +// } +// public void RollBack() +// { +// SqlTransacc.Rollback(); +// } +// public ClsNominasZ() +// { +// SqlConexion = new SqlConnection(); +// SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString; +// SqlAdapter = new SqlDataAdapter("", SqlConexion); +// try +// { +// SqlConexion.Open(); +// } +// catch (Exception ex) +// { +// this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex); +// } +// ConexionAdd(); +// } +// public ClsNominasZ(SqlTransaction TransaccionCompartida = null) +// { +// if (TransaccionCompartida == null) +// { +// SqlConexion = new SqlConnection(); +// SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString; +// try +// { +// SqlConexion.Open(); +// } +// catch (Exception ex) +// { +// this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex); +// } +// } +// else +// { +// SqlConexion = TransaccionCompartida.Connection; +// SqlTransacc = TransaccionCompartida; +// } + +// SqlAdapter = new SqlDataAdapter("", SqlConexion); +// ConexionAdd(); +// } +// private void DataAdapter(string pStrSQL, CommandType TipoComando = CommandType.StoredProcedure) +// { +// { +// var withBlock = SqlAdapter.SelectCommand; +// withBlock.Parameters.Clear(); +// withBlock.CommandText = pStrSQL; +// withBlock.CommandType = TipoComando; +// } +// Data = new DataTable(); +// if (SqlTransacc != null) +// SqlAdapter.SelectCommand.Transaction = SqlTransacc; +// } + +// private void ConexionAdd() +// { +// if (ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1") +// { +// try +// { +// DataAdapter("PA_Sis_RegistrarConexion"); +// { +// var withBlock = SqlAdapter.SelectCommand.Parameters; +// withBlock.Add("@Clase", SqlDbType.VarChar).Value = this.GetType().Name; +// withBlock.Add("@Modulo", SqlDbType.VarChar).Value = string.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString(), HttpContext.Current.Request.QueryString.ToString()); +// withBlock.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output; +// } +// SqlAdapter.Fill(Data); +// CveConexion = SqlAdapter.SelectCommand.Parameters["@IDConexion"].Value.ToString().ToEntero(); +// } +// catch (Exception ex) +// { +// this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()); +// } +// } +// } + +// private void ConexionClose() +// { +// if (CveConexion > 0 && ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1") +// { +// DataAdapter(string.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text); + +// try +// { +// SqlAdapter.Fill(Data); +// } +// catch (Exception ex) +// { +// this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()); +// } +// CveConexion = 0; +// } +// } +// #endregion +// public bool GetInversionNomina(int CveEmpresa, string FechaInicio = "", string FechaFin = "", int CveProyecto = -1, int CveSubProyecto = -1, int Agrupador = -1, int CveDepartamento = -1, string CveStr1 = "-1", string CveStr2 = "-1") +// { +// bool Retorno = false; +// DataAdapter("PA_Nom_InversionNominaGET"); +// { +// var withBlock = SqlAdapter.SelectCommand.Parameters; +// withBlock.Add("FechaInicio", SqlDbType.VarChar).Value = FechaInicio; +// withBlock.Add("FechaFin", SqlDbType.VarChar).Value = FechaFin; +// withBlock.Add("CveProyecto", SqlDbType.Int).Value = CveProyecto; +// withBlock.Add("CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto; +// withBlock.Add("Agrupador", SqlDbType.Int).Value = Agrupador; +// withBlock.Add("CveDepartamento", SqlDbType.Int).Value = CveDepartamento; +// withBlock.Add("CveStr1", SqlDbType.VarChar).Value = CveStr1; +// withBlock.Add("CveStr2", SqlDbType.VarChar).Value = CveStr2; +// withBlock.Add("CveEmpresa", SqlDbType.Int).Value = CveEmpresa; +// } +// try +// { +// DTSet = new DataSet(); +// SqlAdapter.Fill(DTSet); +// Data = DTSet.Tables[0]; +// Retorno = true; +// } +// catch (SqlException Ex1) +// { +// this.OnError("Ocurrió un error al obtener el reporte de inversión de nomina.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()); +// } +// return Retorno; +// } + +// // IDisposable +// protected virtual void Dispose(bool disposing) +// { +// if (!disposedValue) +// { +// if (disposing) +// { +// SqlConexion.Close(); +// SqlConexion.Dispose(); +// if (Data != null) +// Data.Dispose(); +// if (SqlAdapter != null) +// SqlAdapter.Dispose(); +// if (SqlTransacc != null) +// SqlTransacc.Dispose(); +// } +// } +// disposedValue = true; +// } +// public void Dispose() +// { +// ConexionClose(); +// Dispose(true); +// GC.SuppressFinalize(this); +// } +//} diff --git a/RH/SolicitudViaticos.aspx.cs b/RH/SolicitudViaticos.aspx.cs index 3c3968c5e..26109a0d1 100644 --- a/RH/SolicitudViaticos.aspx.cs +++ b/RH/SolicitudViaticos.aspx.cs @@ -719,11 +719,11 @@ public partial class RH_SolicitudViaticos : ClsPaginas if (DesgargaArchivo) { - ImprimirPDF("Empresas/72/Formatos/SolicitudViaticos.rdlc", DTConceptosDetalles, @params, String.Format("Solicitud de Viáticos - {0} - {1}", TxtFolio.Text, DdlPersonal.SelectedItem), Formato); + ImprimirPDF(string.Format("Empresas/{0}/Formatos/SolicitudViaticos.rdlc",UsuarioActual.CveEmpresa), DTConceptosDetalles, @params, String.Format("Solicitud de Viáticos - {0} - {1}", TxtFolio.Text, DdlPersonal.SelectedItem), Formato); } else { - retorno = StreamPDF("Empresas/72/Formatos/SolicitudViaticos.rdlc", DTConceptosDetalles, @params, String.Format("Solicitud de Viáticos - {0} - {1}", TxtFolio.Text, DdlPersonal.SelectedItem), Formato); + retorno = StreamPDF(string.Format("Empresas/{0}/Formatos/SolicitudViaticos.rdlc", UsuarioActual.CveEmpresa), DTConceptosDetalles, @params, String.Format("Solicitud de Viáticos - {0} - {1}", TxtFolio.Text, DdlPersonal.SelectedItem), Formato); } } else