示例#1
0
        protected void LlenarGridConAsignacion(DataTable ActivosAsignados)
        {
            DataTable Activos = new DataTable();
            DataRow   dtRow;

            Activos = ObtenerEstructuraTabla();

            foreach (DataRow dtRegistro in ActivosAsignados.Rows)
            {
                dtRow                           = Activos.NewRow();
                dtRow["ActivoId"]               = dtRegistro["ActivoId"].ToString();
                dtRow["DescripcionPadre"]       = dtRegistro["DescripcionPadre"].ToString();
                dtRow["Descripcion"]            = dtRegistro["Descripcion"].ToString();
                dtRow["NumeroSerie"]            = dtRegistro["NumeroSerie"].ToString();
                dtRow["Modelo"]                 = dtRegistro["Modelo"].ToString();
                dtRow["Color"]                  = dtRegistro["Color"].ToString();
                dtRow["CodigoBarrasParticular"] = dtRegistro["CodigoBarrasParticular"].ToString();
                dtRow["NombreEstatus"]          = "Sin localizar";
                dtRow["EstatusID"]              = (Int16)ConstantePrograma.EstatusLevantamiento.SinLocalizar;
                Activos.Rows.Add(dtRow);
            }
            Activos.AcceptChanges();

            TablaLevantamiento.DataSource = Activos;
            TablaLevantamiento.DataBind();
        }
示例#2
0
        protected void Inicio()
        {
            if (!Page.IsPostBack)
            {
                //Validamos permisos
                Activos.ProcesoNegocio.Base BaseProcesoNegocio = new Activos.ProcesoNegocio.Base();
                BaseProcesoNegocio.ValidarPermiso((Int16)ConstantePrograma.Paginas.LevantamientoInventario);

                TablaLevantamiento.DataSource = null;
                TablaLevantamiento.DataBind();
                SeleccionarTextoError();
            }
        }
        protected void Inicio()
        {
            if (!Page.IsPostBack)
            {
                TablaLevantamiento.DataSource = null;
                TablaLevantamiento.DataBind();

                int LevantamientoID = 0;
                LevantamientoID = int.Parse(Request.QueryString["LevantamientoID"]);

                SeleccionarLevantamiento(LevantamientoID);
                MostrarTitulo();
            }
        }
示例#4
0
        protected void LimpiarFormulario()
        {
            NumeroEmpleado.Enabled        = true;
            NumeroEmpleado.Text           = "";
            EmpleadoIdHidden.Value        = "0";
            NombreEmpleado.Text           = "";
            CodigoBarraParticular.Text    = "";
            CodigoBarraParticular.Enabled = false;
            EtiquetaMensaje.Text          = "";
            EtiquetaMensajeExito.Text     = "";
            BotonImprimir.Enabled         = false;
            LevantamientoIdHidden.Value   = "0";

            TablaLevantamiento.DataSource = null;
            TablaLevantamiento.DataBind();
        }
        protected void LlenarFormulario(ResultadoEntidad Resultado)
        {
            Int16  EmpleadoId  = 0;
            string FechaActual = string.Empty;

            FechaActual     = DateTime.Today.Year.ToString() + "/" + DateTime.Today.Month.ToString("0#") + "/" + DateTime.Today.Day.ToString("0#") + "/" + DateTime.Today.Hour.ToString("0#") + "/" + DateTime.Today.Minute.ToString("0#");
            FechaLabel.Text = FormatoFecha.AsignarFormato(FechaActual, ConstantePrograma.UniversalFormatoFecha);

            //Se carga el grid con los activos
            TablaLevantamiento.DataSource = Resultado.ResultadoDatos.Tables[0];
            TablaLevantamiento.DataBind();

            //Se obtiene el ID del Empleado y se consulta
            EmpleadoId = Int16.Parse(Resultado.ResultadoDatos.Tables[0].Rows[0]["EmpleadoId"].ToString());

            SeleccionarEmpleado(EmpleadoId);
            SeleccionarJefe(EmpleadoId);
        }
示例#6
0
        protected void BuscarActivoEnTabla()
        {
            DataTable Activos = new DataTable();
            DataRow   dtRow;
            bool      SeEncontroActivo = false;

            EtiquetaMensaje.Text = "";

            if (CodigoBarraParticular.Text.Trim() != "")
            {
                Activos = ObtenerEstructuraTabla();

                //Se barre el grid y se pasan los activos al datatable
                foreach (GridViewRow Renglon in TablaLevantamiento.Rows)
                {
                    dtRow                           = Activos.NewRow();
                    dtRow["ActivoId"]               = TablaLevantamiento.DataKeys[Renglon.RowIndex]["ActivoId"].ToString();
                    dtRow["DescripcionPadre"]       = TablaLevantamiento.DataKeys[Renglon.RowIndex]["DescripcionPadre"].ToString();
                    dtRow["Descripcion"]            = TablaLevantamiento.DataKeys[Renglon.RowIndex]["Descripcion"].ToString();
                    dtRow["NumeroSerie"]            = TablaLevantamiento.DataKeys[Renglon.RowIndex]["NumeroSerie"].ToString();
                    dtRow["Modelo"]                 = TablaLevantamiento.DataKeys[Renglon.RowIndex]["Modelo"].ToString();
                    dtRow["Color"]                  = TablaLevantamiento.DataKeys[Renglon.RowIndex]["Color"].ToString();
                    dtRow["CodigoBarrasParticular"] = TablaLevantamiento.DataKeys[Renglon.RowIndex]["CodigoBarrasParticular"].ToString();

                    //Si el código de barras es igual, se marca como Localizado
                    if (Renglon.Cells[5].Text == CodigoBarraParticular.Text.Trim())
                    {
                        if (Int16.Parse(TablaLevantamiento.DataKeys[Renglon.RowIndex]["EstatusID"].ToString()) == (Int16)ConstantePrograma.EstatusLevantamiento.SinLocalizar)
                        {
                            dtRow["NombreEstatus"] = "Localizado";
                            dtRow["EstatusID"]     = (Int16)ConstantePrograma.EstatusLevantamiento.Localizado;
                        }
                        else
                        {
                            dtRow["NombreEstatus"] = TablaLevantamiento.DataKeys[Renglon.RowIndex]["NombreEstatus"].ToString();
                            dtRow["EstatusID"]     = TablaLevantamiento.DataKeys[Renglon.RowIndex]["EstatusID"].ToString();
                        }

                        SeEncontroActivo = true;
                    }
                    else
                    {
                        dtRow["NombreEstatus"] = TablaLevantamiento.DataKeys[Renglon.RowIndex]["NombreEstatus"].ToString();
                        dtRow["EstatusID"]     = TablaLevantamiento.DataKeys[Renglon.RowIndex]["EstatusID"].ToString();
                    }

                    Activos.Rows.Add(dtRow);
                }
                Activos.AcceptChanges();

                if (SeEncontroActivo == false)
                {
                    Activos = AgregarActivo(Activos);
                }

                TablaLevantamiento.DataSource = Activos;
                TablaLevantamiento.DataBind();

                CodigoBarraParticular.Text = "";
                CodigoBarraParticular.Focus();
            }
        }
示例#7
0
        protected void BuscarEmpleado(EmpleadoEntidad EmpleadoEntidadObjeto)
        {
            ResultadoEntidad Resultado             = new ResultadoEntidad();
            EmpleadoProceso  EmpleadoProcesoObjeto = new EmpleadoProceso();

            EtiquetaMensajeExito.Text         = "";
            BotonImprimir.Enabled             = false;
            LevantamientoCorrectoHidden.Value = "SI";
            EmpIdHidden.Value = "0";

            Resultado = EmpleadoProcesoObjeto.SeleccionarEmpleado(EmpleadoEntidadObjeto);

            if (Resultado.ErrorId == 0)
            {
                if (Resultado.ResultadoDatos.Tables[0].Rows.Count == 1)
                {
                    if (Int16.Parse(Resultado.ResultadoDatos.Tables[0].Rows[0]["EstatusId"].ToString()) != (Int16)ConstantePrograma.EstatusEmpleados.Activo)
                    {
                        NumeroEmpleado.Enabled        = true;
                        CodigoBarraParticular.Enabled = false;
                        EmpleadoIdHidden.Value        = "0";
                        NombreEmpleado.Text           = "";
                        EtiquetaMensaje.Text          = TextoError.EmpleadoInactivo;
                        TablaLevantamiento.DataSource = null;
                        TablaLevantamiento.DataBind();
                        NumeroEmpleado.Focus();
                    }
                    else
                    {
                        NumeroEmpleado.Enabled        = false;
                        CodigoBarraParticular.Enabled = true;
                        NombreEmpleado.Text           = Resultado.ResultadoDatos.Tables[0].Rows[0]["NombreEmpleadoCompleto"].ToString();
                        EmpleadoIdHidden.Value        = Resultado.ResultadoDatos.Tables[0].Rows[0]["EmpleadoId"].ToString();
                        NumeroEmpleado.Text           = Resultado.ResultadoDatos.Tables[0].Rows[0]["NumeroEmpleado"].ToString();
                        SeleccionarAsignacion(Int16.Parse(Resultado.ResultadoDatos.Tables[0].Rows[0]["EmpleadoId"].ToString()));
                        EtiquetaMensaje.Text = "";
                        CodigoBarraParticular.Focus();
                    }
                }
                else
                {
                    NumeroEmpleado.Enabled        = true;
                    CodigoBarraParticular.Enabled = false;
                    EmpleadoIdHidden.Value        = "0";
                    NombreEmpleado.Text           = "";
                    EtiquetaMensaje.Text          = TextoError.EmpleadoNoEncontrado;
                    TablaLevantamiento.DataSource = null;
                    TablaLevantamiento.DataBind();
                    NumeroEmpleado.Focus();
                }
            }
            else
            {
                NumeroEmpleado.Enabled        = true;
                CodigoBarraParticular.Enabled = false;
                EmpleadoIdHidden.Value        = "0";
                NombreEmpleado.Text           = "";
                TablaLevantamiento.DataSource = null;
                TablaLevantamiento.DataBind();
                EtiquetaMensaje.Text = TextoError.ErrorGenerico;
            }
        }