diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 0d6d1f970..38c0c3b49 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -5059,6 +5059,92 @@ Public Class ClsInventarios #End Region +#Region "Almacen Clasificacion Secciones" + Public Function AddAlmacenClasificacionSecciones(CveAlmacen As Integer, CveClasificacion As Integer, CveClasificacionDetalle As Integer, CveMarca As Integer, + CveSeccionAlmacen As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenClasificacionesSeccionesAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la relación Almacén Clasificación Sección.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetAlmacenClasificacionSecciones(CveSeccionClasificacion As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenClasificacionesSeccionesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSeccionClasificacion", SqlDbType.Int).Value = CveSeccionClasificacion + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Almacén Clasificación Sección.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateAlmacenClasificacionSecciones(CveSeccionClasificacion As Integer, CveAlmacen As Integer, CveClasificacion As Integer, CveClasificacionDetalle As Integer, + CveMarca As Integer, CveSeccionAlmacen As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenClasificacionesSeccionesUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSeccionClasificacion", SqlDbType.Int).Value = CveSeccionClasificacion + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Almacén Clasificación Sección.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function RemoveAlmacenClasificacionSecciones(CveSeccionClasificacion As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_AlmacenClasificacionesSeccionesDelete") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveSeccionClasificacion", SqlDbType.Int).Value = CveSeccionClasificacion + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al eliminar el Almacén Clasificación Sección.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function +#End Region + #Region " IDisposable Support " ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 2c81af9be..7a737f3b9 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4477,6 +4477,7 @@ Public Class ClsPaginas PaginaDict.Add("/Inventarios/AjustesSeccionAlmacen.aspx".ToUpper(), 892) PaginaDict.Add("/Inventarios/RepTraspasoAlmacen.aspx".ToUpper(), 688) PaginaDict.Add("/Inventarios/EntregasPorRealizar.aspx".ToUpper(), 728) + PaginaDict.Add("/Inventarios/CatAlmacenClasificacionSecciones.aspx".ToUpper(), 764) #End Region #Region "MF" diff --git a/Inventarios/CatAlmacenClasificacionSecciones.aspx b/Inventarios/CatAlmacenClasificacionSecciones.aspx new file mode 100644 index 000000000..20e77d5e7 --- /dev/null +++ b/Inventarios/CatAlmacenClasificacionSecciones.aspx @@ -0,0 +1,91 @@ +<%@ Page Title="Inventarios - Catálogo almacén clasificación secciones" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatAlmacenClasificacionSecciones.aspx.cs" Inherits="Inventarios_CatAlmacenClasificacionSecciones" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Almacén Clasificacion Secciones + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Inventarios/CatAlmacenClasificacionSecciones.aspx.cs b/Inventarios/CatAlmacenClasificacionSecciones.aspx.cs new file mode 100644 index 000000000..8e44d3ef3 --- /dev/null +++ b/Inventarios/CatAlmacenClasificacionSecciones.aspx.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using Extensiones; + +public partial class Inventarios_CatAlmacenClasificacionSecciones : ClsPaginas +{ + private int CveSeccionClasificacion + { + get + { + return ViewState["CveSeccionClasificacion"].ToString().ToEntero(); + } + + set + { + ViewState["CveSeccionClasificacion"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + CargarDatos(); + CargarDropDowns(); + } + } + + private void CargarDatos() + { + ClsInventarios Objinv = new ClsInventarios(); + if (Objinv.GetAlmacenClasificacionSecciones(-1,UsuarioActual.CveEmpresa)) + { + GvDatos.DataSource = Objinv.DtResultados; + } + Objinv.Dispose(); + GvDatos.DataBind(); + } + private void CargarDropDowns() + { + DdlAlmacen.DataSource = get_GlobalDTAlmacen(UsuarioActual.CveEmpresa); + DdlAlmacen.DataBind(); + DdlAlmacen.Items.Insert(0, new ListItem("Seleccione", "-1")); + + DdlClasificacion.DataSource = get_GlobalDTClasificaciones(CveEmpresa:UsuarioActual.CveEmpresa); + DdlClasificacion.DataBind(); + DdlClasificacion.Items.Insert(0, new ListItem("Seleccione", "-1")); + + DdlTipo.DataSource = get_GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa); + DdlTipo.DataBind(); + DdlTipo.Items.Insert(0, new ListItem("Seleccione", "-1")); + + ClsProductosServicios ObjMarcas = new ClsProductosServicios(); + ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa); + DdlMarca.DataSource = ObjMarcas.DtResultados; + ObjMarcas.Dispose(); + DdlMarca.DataBind(); + DdlMarca.Items.Insert(0, new ListItem("Seleccione", "-1")); + + } + + protected void DdlAlmacen_Change(object sender, EventArgs e) + { + + int CveAlmacen = ((DropDownList)sender).SelectedValue.ToEntero(); + CargarSeccionAlmacen(CveAlmacen); + + } + private void CargarSeccionAlmacen(int CveAlmacen) + { + DdlSeccionAlmacen.DataSource = get_GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, CveAlmacen); + DdlSeccionAlmacen.DataBind(); + DdlSeccionAlmacen.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + + protected void BtnAgregarAlmacenClasificacionSeccion_Click(object sender, EventArgs e) + { + DdlAlmacen.SelectedValue = "-1"; + DdlClasificacion.SelectedValue = "-1"; + DdlTipo.SelectedValue = "-1"; + DdlMarca.SelectedValue = "-1"; + DdlSeccionAlmacen.Items.Clear(); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void BtnAgregarACS_Click(object sender, EventArgs e) + { + ClsInventarios ObjInv = new ClsInventarios(); + + if (BtnAgregarACS.Text == "Agregar") + { + if (ObjInv.AddAlmacenClasificacionSecciones(DdlAlmacen.SelectedValue.ToEntero(),DdlClasificacion.SelectedValue.ToEntero(),DdlTipo.SelectedValue.ToEntero(), + DdlMarca.SelectedValue.ToEntero(),DdlSeccionAlmacen.SelectedValue.ToEntero())) + { + Alert("Se agregó correctamente Almacén Clasificación Sección"); + } + }else + { + if (ObjInv.UpdateAlmacenClasificacionSecciones(CveSeccionClasificacion,DdlAlmacen.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero(), DdlTipo.SelectedValue.ToEntero(), + DdlMarca.SelectedValue.ToEntero(), DdlSeccionAlmacen.SelectedValue.ToEntero())) + { + Alert("Se actualizó correctamente Almacén Clasificación Sección"); + } + } + + CargarDatos(); + UpDatos.Update(); + + ObjInv.Dispose(); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + string CveAlmacen = GvRow.DataKey("CveAlmacen"); + string CveClasificacion = GvRow.DataKey("CveClasificacion"); + string CveClasificacionDetalle = GvRow.DataKey("CveClasificacionDetalle"); + string CveMarca = GvRow.DataKey("CveMarca"); + string CveSeccionAlmacen = GvRow.DataKey("CveSeccionAlmacen"); + BtnAgregarACS.Text = "Actualizar"; + + CveSeccionClasificacion = GvRow.DataKey("CveSeccionClasificacion").ToEntero(); + + DdlAlmacen.SelectedValue = CveAlmacen; + CargarSeccionAlmacen(CveAlmacen.ToEntero()); + DdlClasificacion.SelectedValue = CveClasificacion; + DdlTipo.SelectedValue = CveClasificacionDetalle; + DdlMarca.SelectedValue = CveMarca; + DdlSeccionAlmacen.SelectedValueExist(CveSeccionAlmacen); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")); + } + + protected void LnkEliminar_Click(object sender,EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + int CveSeccionClasificacion = GvRow.DataKey("CveSeccionClasificacion").ToEntero(); + ClsInventarios ObjInv = new ClsInventarios(); + if (ObjInv.RemoveAlmacenClasificacionSecciones(CveSeccionClasificacion)) + { + CargarDatos(); + UpDatos.Update(); + Alert("Se eliminó correctamente Almacén Clasificación Sección"); + } + ObjInv.Dispose(); + } +} \ No newline at end of file diff --git a/OC/PopUpBuscarReq.aspx b/OC/PopUpBuscarReq.aspx index 2bb888b1e..5e52d59d0 100644 --- a/OC/PopUpBuscarReq.aspx +++ b/OC/PopUpBuscarReq.aspx @@ -68,13 +68,13 @@ - Proyecto: + - + diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb index f4d2d40c4..92216f52f 100644 --- a/OC/PopUpBuscarReq.aspx.vb +++ b/OC/PopUpBuscarReq.aspx.vb @@ -70,18 +70,19 @@ Partial Class OC_PopUpBuscarReq txtFechaI.Text = Now.FirstDayOfMonth.AddMonths(-3).ToShortDateString CargaEstatus() - If UsuarioActual.Empresa.GralSoloProyecto Then - TdProyecto.Visible = False - TdProyecto2.Visible = False - LtSubProyecto.Text = "Proyecto:" - Else - 'DdlProyectos.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveProyecto", "Proyecto"}) 'GlobalDTProyectos(UsuarioActual.CveEmpresa, 1) - 'DdlProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), - ' GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) - DdlProyectos.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) - DdlProyectos.DataBind() - DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1")) - End If + CargarCentrosDeCosto(DdlProyectos, DdlSubProyectos, LblProyecto, LtSubProyecto) + 'If UsuarioActual.Empresa.GralSoloProyecto Then + ' TdProyecto.Visible = False + ' TdProyecto2.Visible = False + ' LtSubProyecto.Text = "Proyecto:" + 'Else + ' 'DdlProyectos.DataSource = DtEstatusUsuarios.FiltraParametros("", "", {"CveProyecto", "Proyecto"}) 'GlobalDTProyectos(UsuarioActual.CveEmpresa, 1) + ' 'DdlProyectos.DataSource = If(UsuarioActual.Empresa.Funcionalidad(102) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(110), + ' ' GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1), GlobalDTProyectos(UsuarioActual.CveEmpresa, -1)) + ' DdlProyectos.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1) + ' DdlProyectos.DataBind() + ' DdlProyectos.Items.Insert(0, New ListItem("Todos", "-1")) + 'End If DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedor.DataBind() @@ -161,10 +162,10 @@ Partial Class OC_PopUpBuscarReq Dim CveProyecto = -1 Dim CveSubProyecto = -1 - If UsuarioActual.Empresa.GralSoloProyecto Then + If LblProyecto.Visible Then + CveProyecto = DdlProyectos.SelectedValue.ToEntero CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero Else - CveProyecto = DdlProyectos.SelectedValue.ToEntero CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero End If