Пример #1
0
    private void LlenarEstados()
    {
        try
        {
            BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
            DataTable dtResultado      = new DataTable();

            foreach (DataListItem FilaFactor in DataListRecursos.Items)
            {
                int id = (int)DataListRecursos.DataKeys[FilaFactor.ItemIndex];
                dtResultado = obj.LIST_ASIGNACION_DETALLE_POR_ID(id);

                RadioButtonList RadioEstados = ((RadioButtonList)FilaFactor.FindControl("RadioEstados"));
                RadioEstados.SelectedValue = dtResultado.Rows[0]["FLG_ATENDIDO"].ToString();

                RadioEstados.DataSource     = GetEstado();
                RadioEstados.DataTextField  = GetEstado().Columns["ValueMember"].ToString();
                RadioEstados.DataValueField = GetEstado().Columns["DisplayMember"].ToString();
                RadioEstados.DataBind();
            }
        }
        catch (Exception ex)
        {
            UC_MessageBox.Show(Page, Page.GetType(), "Ocurrio un error :" + ex.Message);
            return;
        }
    }
    protected void btnEnviar_Click(object sender, ImageClickEventArgs e)
    {
        string cleanMessage = string.Empty;
        //BE_ASIGNACION_RECURSOS obj = new BE_ASIGNACION_RECURSOS();
        BL_ASIGNACION_RECURSOS Xobj = new BL_ASIGNACION_RECURSOS();

        //obj =f_CapturarDatos(2);
        Session["Requerimiento"] = Request.QueryString["ID_DETALLE_REQUERIMIENTO_PERSONAL"].ToString();
        DataTable dtResultado = new DataTable();

        dtResultado = Xobj.Enviar_care_Correo(Convert.ToInt32(Session["Requerimiento"].ToString()));

        if (dtResultado.Rows.Count > 0)
        {
            string ticket = dtResultado.Rows[0]["ticket"].ToString();

            if (Convert.ToInt32(dtResultado.Rows[0]["REGISTRO"].ToString()) > 0)
            {
                cleanMessage = "Se ha generado el requerimiento con el Nro de atención " + ticket;
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
                AsignacionCabecera();
            }

            else
            {
                cleanMessage = "Se ha presentado un incoveniente, error de asignación";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            }
        }
    }
    protected void LlenarDatos()
    {
        string cleanMessage        = string.Empty;
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();
        DataTable dtEncargados     = new DataTable();

        dtResultado = obj.Datos_requerimiento_Ticket(Session["NRO_TICKET"].ToString());
        if (dtResultado.Rows.Count > 0)
        {
            PanelEstados.Visible = true;

            int CodAsignacion = Convert.ToInt32(dtResultado.Rows[0]["IDE_ASIGNACION"].ToString());

            dtEncargados = obj.Datos_requerimiento_encargados(CodAsignacion, "");

            if (dtEncargados.Rows.Count > 0)
            {
                DataListRecursos.DataSource = dtEncargados;
                DataListRecursos.DataBind();
                LlenarEstados();
            }
        }
        else
        {
            PanelEstados.Visible = false;
        }
    }
    protected void registrar()
    {
        string cleanMessage         = string.Empty;
        BE_ASIGNACION_RECURSOS obj  = new BE_ASIGNACION_RECURSOS();
        BL_ASIGNACION_RECURSOS Xobj = new BL_ASIGNACION_RECURSOS();
        int       rpta;
        DataTable dtResultado = new DataTable();

        rpta = Convert.ToInt32(lblIdAsignacion.Text);



        //SELECCIONAR EQUIPO

        string equipo = rdoEquipo.SelectedValue;


        //seleccionar sofware
        string s = string.Empty;

        for (int i = 0; i < CheckSoftware.Items.Count; i++)
        {
            if (CheckSoftware.Items[i].Selected)
            {
                s += CheckSoftware.Items[i].Value + ",";
            }
        }

        // seleccionar Otros
        string Otros = string.Empty;

        for (int i = 0; i < CheckOtros.Items.Count; i++)
        {
            if (CheckOtros.Items[i].Selected)
            {
                Otros += CheckOtros.Items[i].Value + ",";
            }
        }

        dtResultado = Xobj.Insertar_AsignacionDetalle(rpta, equipo + "," + s + Otros, "", Session["IDE_USUARIO"].ToString());

        if (dtResultado.Rows.Count > 0)
        {
            //ENVIAR AL CARE
            string x = lblRequerimientoPersonal.Text;
            Xobj.Enviar_care_Correo(Convert.ToInt32(lblRequerimientoPersonal.Text));


            AsignacionCabecera();
        }
        else
        {
            cleanMessage = "Existe problemas con las asignación de recursos";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
    protected void btnCancelar_Click(object sender, ImageClickEventArgs e)
    {
        BL_ASIGNACION_RECURSOS Xobj = new BL_ASIGNACION_RECURSOS();

        //obj =f_CapturarDatos(2);
        Session["Requerimiento"] = Request.QueryString["ID_DETALLE_REQUERIMIENTO_PERSONAL"].ToString();
        DataTable dtResultado = new DataTable();

        dtResultado = Xobj.Enviar_Anulacion_Correo(Convert.ToInt32(Session["Requerimiento"].ToString()));
        AsignacionCabecera();
    }
    protected void LlenarDatos()
    {
        string cleanMessage        = string.Empty;
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();
        DataTable dtEncargados     = new DataTable();

        dtResultado = obj.Datos_requerimiento_Ticket(txtNroTicket.Text);
        if (dtResultado.Rows.Count > 0)
        {
            PanelTicket.Visible  = true;
            lblcandidato.Text    = dtResultado.Rows[0]["CANDIDATO"].ToString();
            lblProyecto.Text     = dtResultado.Rows[0]["PROYECTO"].ToString();
            lblEmpresa.Text      = dtResultado.Rows[0]["EMPRESA"].ToString();
            lblCentro.Text       = dtResultado.Rows[0]["CENTROCOSTO"].ToString();
            lblCargo.Text        = dtResultado.Rows[0]["CARGO"].ToString();
            lblFechaIngreso.Text = dtResultado.Rows[0]["FECHA_INGRESO"].ToString();
            lblDni.Text          = dtResultado.Rows[0]["DNI"].ToString();
            lblUbicacion.Text    = dtResultado.Rows[0]["UBICACION"].ToString();
            txtObserva.Text      = dtResultado.Rows[0]["OBSERVA"].ToString();
            int CodAsignacion = Convert.ToInt32(dtResultado.Rows[0]["IDE_ASIGNACION"].ToString());
            lblIdAsignacion.Text          = CodAsignacion.ToString();
            lblRequerimientoPersonal.Text = dtResultado.Rows[0]["ID_DETALLE_REQUERIMIENTO_PERSONAL"].ToString();
            Session["Requerimiento"]      = lblRequerimientoPersonal.Text;
            int FLG_ESTADO = Convert.ToInt32(dtResultado.Rows[0]["REQ_ESTADO"].ToString());
            if (FLG_ESTADO == 4)
            {
                lblMensaje.Visible = true;
                lblMensaje.Text    = "Requerimiento Anulado";
                btnGuardar.Visible = false;
            }
            {
                lblMensaje.Text    = "";
                btnGuardar.Visible = true;
            }

            Ubicacion();
            equipo();
            Software();
            Otros();

            AsignacionCabecera();
            AsignacionDetalle();
            ListarSoftware();
            ListarOtros();
        }
        else
        {
            PanelTicket.Visible = false;
            cleanMessage        = "No existe el número de atención ingresado";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
    protected void AsignacionDetalle()
    {
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtEquipos        = new DataTable();
        DataTable dtSoftware       = new DataTable();

        dtEquipos = obj.Listar_recursosAsignados(Convert.ToInt32(Session["Requerimiento"].ToString()), "COMPUTO", "ASIGNACION_DETALLE");
        if (dtEquipos.Rows.Count > 0)
        {
            rdoEquipo.SelectedValue = dtEquipos.Rows[0]["IDE_RECURSO"].ToString();
            equipo();
        }
    }
    protected void btnRegistrar_Click(object sender, ImageClickEventArgs e)
    {
        string cleanMessage         = string.Empty;
        BE_ASIGNACION_RECURSOS obj  = new BE_ASIGNACION_RECURSOS();
        BL_ASIGNACION_RECURSOS Xobj = new BL_ASIGNACION_RECURSOS();

        obj = f_CapturarDatos(1);
        int       rpta;
        DataTable dtResultado = new DataTable();

        rpta = new BL_ASIGNACION_RECURSOS().Mant_Insert_Asignacion(obj);
        lblIdAsignacion.Text = Convert.ToString(rpta);
        if (rpta > 0)
        {
            //SELECCIONAR EQUIPO

            string equipo = rdoEquipo.SelectedValue;


            //seleccionar sofware
            string s = string.Empty;

            for (int i = 0; i < CheckSoftware.Items.Count; i++)

            {
                if (CheckSoftware.Items[i].Selected)
                {
                    s += CheckSoftware.Items[i].Value + ",";
                }
            }

            // seleccionar Otros
            string Otros = string.Empty;
            for (int i = 0; i < CheckOtros.Items.Count; i++)
            {
                if (CheckOtros.Items[i].Selected)
                {
                    Otros += CheckOtros.Items[i].Value + ",";
                }
            }

            dtResultado = Xobj.Insertar_AsignacionDetalle(rpta, equipo + "," + s + Otros, "", Session["IDE_USUARIO"].ToString());

            cleanMessage = "Registro Satisfactorio";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);



            AsignacionCabecera();
        }
    }
Пример #9
0
    protected void LlenarDatos()
    {
        string cleanMessage        = string.Empty;
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();
        DataTable dtEncargados     = new DataTable();

        dtResultado = obj.Datos_requerimiento_Ticket(txtNroTicket.Text);
        if (dtResultado.Rows.Count > 0)
        {
            PanelTicket.Visible  = true;
            lblcandidato.Text    = dtResultado.Rows[0]["CANDIDATO"].ToString();
            lblProyecto.Text     = dtResultado.Rows[0]["PROYECTO"].ToString();
            lblEmpresa.Text      = dtResultado.Rows[0]["EMPRESA"].ToString();
            lblCentro.Text       = dtResultado.Rows[0]["CENTROCOSTO"].ToString();
            lblCargo.Text        = dtResultado.Rows[0]["CARGO"].ToString();
            lblFechaIngreso.Text = dtResultado.Rows[0]["FECHA_INGRESO"].ToString();
            lblDni.Text          = dtResultado.Rows[0]["DNI"].ToString();
            lblUbicacion.Text    = dtResultado.Rows[0]["UBICACION"].ToString();
            txtObserva.Text      = dtResultado.Rows[0]["OBSERVA"].ToString();
            int CodAsignacion = Convert.ToInt32(dtResultado.Rows[0]["IDE_ASIGNACION"].ToString());
            int FLG_ESTADO    = Convert.ToInt32(dtResultado.Rows[0]["REQ_ESTADO"].ToString());
            if (FLG_ESTADO == 4)
            {
                lblMensaje.Visible = true;
                lblMensaje.Text    = "Requerimiento Anulado";
                btnGuardar.Visible = false;
            }
            {
                lblMensaje.Text    = "";
                btnGuardar.Visible = true;
            }

            dtEncargados = obj.Datos_requerimiento_encargados(CodAsignacion, Session["Usuario"].ToString());

            if (dtEncargados.Rows.Count > 0)
            {
                DataListRecursos.DataSource = dtEncargados;
                DataListRecursos.DataBind();
                LlenarEstados();
            }
        }
        else
        {
            PanelTicket.Visible = false;
            cleanMessage        = "No existe el Numero de Atención ingresado";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
    }
    protected void AsignacionCabecera()
    {
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();
        string    cleanMessage     = string.Empty;

        dtResultado = obj.Listar_CabeceraAsignacion(Convert.ToInt32(Session["Requerimiento"].ToString()));
        if (dtResultado.Rows.Count > 0)
        {
            RdoUbicacion.SelectedValue = dtResultado.Rows[0]["IDE_UBICACION"].ToString();
            Ubicacion();
            int estado = Convert.ToInt32(string.IsNullOrEmpty(dtResultado.Rows[0]["FLG_ESTADO"].ToString()) ? "1" : dtResultado.Rows[0]["FLG_ESTADO"].ToString());
            lblMensaje.Text = dtResultado.Rows[0]["ESTADO"].ToString();
        }
    }
    protected void btnGuardar_Click(object sender, ImageClickEventArgs e)
    {
        string cleanMessage        = string.Empty;
        string cleanMessageCare    = string.Empty;
        string cleanMessageCGO     = string.Empty;
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();

        dtResultado = obj.Datos_Controlrequerimiento_id(Convert.ToInt32(lblRequerimientoPersonal.Text));
        if (dtResultado.Rows.Count > 0)
        {
            int ESTADO_EQUIPO, ESTADO_RECURSOS;

            ESTADO_EQUIPO   = Convert.ToInt32(string.IsNullOrEmpty(dtResultado.Rows[0]["ESTADO_EQUIPO"].ToString()) ? "0" : dtResultado.Rows[0]["ESTADO_EQUIPO"].ToString());
            ESTADO_RECURSOS = Convert.ToInt32(string.IsNullOrEmpty(dtResultado.Rows[0]["ESTADO_RECURSOS"].ToString()) ? "0" : dtResultado.Rows[0]["ESTADO_RECURSOS"].ToString());

            cleanMessageCare = "No se puede renombrar Equipos de Computo (En proceso de atencion - Care), ";
            cleanMessageCGO  = "Algunos recursos se encuentran en proceso de atención (No se pueden Realizar Cambios)";
            if (ESTADO_EQUIPO == 0) //ELIMINAR RECURSOS DEL CARE
            {
                cleanMessageCare = "Equipo de Computo Actualizado ";
                obj.Eliminar_Requerimiento_care(Convert.ToInt32(lblRequerimientoPersonal.Text));
            }

            if (ESTADO_RECURSOS == 0)//ELIMINAR RECURSOS CGO
            {
                obj.Eliminar_Requerimiento_cgo(Convert.ToInt32(lblRequerimientoPersonal.Text));
                cleanMessageCGO = "Recursos actualizados";
            }

            registrar();


            cleanMessage = cleanMessageCare + cleanMessageCGO;
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);

            Ubicacion();
            equipo();
            Software();
            Otros();

            AsignacionCabecera();
            AsignacionDetalle();
            ListarSoftware();
            ListarOtros();
        }
    }
Пример #12
0
    protected void btnGuardar_Click(object sender, ImageClickEventArgs e)
    {
        string cleanMessage        = string.Empty;
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();

        foreach (DataListItem FilaFactor in DataListRecursos.Items)
        {
            int             id           = (int)DataListRecursos.DataKeys[FilaFactor.ItemIndex];
            RadioButtonList RadioEstados = ((RadioButtonList)FilaFactor.FindControl("RadioEstados"));
            obj.UPD_ASIGNACION_ESTADO(id, Session["Usuario"].ToString(), Convert.ToInt32(RadioEstados.SelectedValue));
        }
        cleanMessage = "Actualizacion Satifactoria";
        ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);

        LlenarDatos();
    }
    protected void DatosPersonal()
    {
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();

        dtResultado = obj.Listar_datosRequerimiento(Convert.ToInt32(Session["Requerimiento"].ToString()));
        if (dtResultado.Rows.Count > 0)
        {
            txtRequerimiento.Text = dtResultado.Rows[0]["NUMERO_REQUISICION"].ToString();
            txtFecha.Text         = dtResultado.Rows[0]["FECHA_APROBACION"].ToString();
            txtCentro.Text        = dtResultado.Rows[0]["CENTROCOSTO"].ToString();
            txtProyecto.Text      = dtResultado.Rows[0]["PROYECTO"].ToString();

            txtPersonal.Text  = dtResultado.Rows[0]["CANDIDATO_FINALISTA"].ToString();
            txtOcupacion.Text = dtResultado.Rows[0]["CARGO"].ToString();
            txtIngreso.Text   = dtResultado.Rows[0]["FEC_INGRESO"].ToString();
            txtDNI.Text       = dtResultado.Rows[0]["DNI"].ToString();
        }
    }
    protected void Seleccionar(object sender, ImageClickEventArgs e)
    {
        ModalRegistro.Show();
        ImageButton            btnDatos    = ((ImageButton)sender);
        DataTable              dtResultado = new DataTable();
        BL_ASIGNACION_RECURSOS obj         = new BL_ASIGNACION_RECURSOS();

        dtResultado = obj.Datos_requerimiento_Ticket(btnDatos.CommandArgument);
        if (dtResultado.Rows.Count > 0)
        {
            lblcandidato.Text    = dtResultado.Rows[0]["CANDIDATO"].ToString();
            lblProyecto.Text     = dtResultado.Rows[0]["PROYECTO"].ToString();
            lblEmpresa.Text      = dtResultado.Rows[0]["EMPRESA"].ToString();
            lblCentro.Text       = dtResultado.Rows[0]["CENTROCOSTO"].ToString();
            lblCargo.Text        = dtResultado.Rows[0]["CARGO"].ToString();
            lblFechaIngreso.Text = dtResultado.Rows[0]["FECHA_INGRESO"].ToString();
            lblDni.Text          = dtResultado.Rows[0]["DNI"].ToString();
            lblUbicacion.Text    = dtResultado.Rows[0]["UBICACION"].ToString();
            txtObserva.Text      = dtResultado.Rows[0]["OBSERVA"].ToString();
        }
    }
    protected void LlenarDatos()
    {
        String    estado           = string.Empty;
        DataTable dtRecursos       = new DataTable();
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();

        if (CheckEstados.SelectedIndex != -1)
        {
            foreach (ListItem li in CheckEstados.Items)
            {
                if (li.Selected)
                {
                    estado += li.Value + ",";
                }
            }
        }

        if (estado == string.Empty)
        {
            string cleanMessage = "Seleccionar algun estado";
            ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
        }
        else
        {
            dtRecursos = obj.Datos_requerimiento_encargadosTotal(Session["Usuario"].ToString(), estado);

            if (dtRecursos.Rows.Count > 0)
            {
                PanelDatos.Visible          = true;
                DataListRecursos.DataSource = dtRecursos;
                DataListRecursos.DataBind();
                LlenarEstados();
            }
            else
            {
                PanelDatos.Visible = false;
            }
        }
    }
    protected void AsignacionCabecera()
    {
        BL_ASIGNACION_RECURSOS obj = new BL_ASIGNACION_RECURSOS();
        DataTable dtResultado      = new DataTable();
        string    cleanMessage     = string.Empty;

        Session["Requerimiento"] = Request.QueryString["ID_DETALLE_REQUERIMIENTO_PERSONAL"].ToString();
        dtResultado = obj.Listar_CabeceraAsignacion(Convert.ToInt32(Session["Requerimiento"].ToString()));
        if (dtResultado.Rows.Count > 0)
        {
            RdoUbicacion.SelectedValue = dtResultado.Rows[0]["IDE_UBICACION"].ToString();
            Ubicacion();
            txtObervacion.Text   = dtResultado.Rows[0]["DES_OBSERVACIONES"].ToString();
            lblIdAsignacion.Text = dtResultado.Rows[0]["IDE_ASIGNACION"].ToString();
            int estado = Convert.ToInt32(string.IsNullOrEmpty(dtResultado.Rows[0]["FLG_ESTADO"].ToString()) ? "1" : dtResultado.Rows[0]["FLG_ESTADO"].ToString());
            Session["NRO_TICKET"] = dtResultado.Rows[0]["NRO_TICKET"].ToString();
            lblTicket.Text        = "Ticket de Atención : " + dtResultado.Rows[0]["NRO_TICKET"].ToString();
            lblMensaje.Text       = dtResultado.Rows[0]["ESTADO"].ToString();
            //txtObervacion.Text  = dtResultado.Rows[0]["OBSERVA"].ToString();
            LlenarDatos();

            if (estado == 1)
            {
                btnEnviar.Visible    = true;
                btnCancelar.Visible  = false;
                btnRegistrar.Visible = true;
            }
            else if (estado == 2)
            {
                btnEnviar.Visible    = true;
                btnRegistrar.Visible = false;
                btnCancelar.Visible  = true;
            }
            else if (estado == 3)
            {
                btnEnviar.Visible    = false;
                btnCancelar.Visible  = true;
                btnRegistrar.Visible = false;
            }
            else if (estado == 4)
            {
                btnEnviar.Visible    = false;
                btnCancelar.Visible  = false;
                btnRegistrar.Visible = false;
            }
        }
        else
        {
            //if (txtIngreso.Text == string.Empty)
            //{
            //    btnEnviar.Visible = false;
            //    btnCancelar.Visible = false;
            //    btnRegistrar.Visible = false;
            //    cleanMessage = "Falta indicar la Fecha de ingreso";
            //    ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true);
            //}
            //else
            //{
            btnRegistrar.Visible = true;
            //}
        }
    }