Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {

            String idEmpleadoJDE;
            empleado MyEmpleadoE;
            empleadosBO MyEmpleado = new empleadosBO();

            //list_empleados.DataSource = MyEmpleado.BuscaEmpleados();
            //list_empleados.DataValueField = "ABAN8";
            //list_empleados.DataTextField = "ABALPH";
            //list_empleados.DataBind();
            //modo = Request.QueryString["modo"];
            //int i = 1;


            //equipo ObjEquipo = new equipo();
            //equipoBO ObjEquipoBO = new equipoBO();
            cmbEmpleado.DataSource = MyEmpleado.BuscaEmpleados();
            cmbEmpleado.DataValueField = "ABAN8";
            cmbEmpleado.DataTextField = "ABALPH";
            cmbEmpleado.SelectedValue = "0";
            //cmbEmpleado.DataSource = ObjEquipoBO.BusquedaIdNombre();
            cmbEmpleado.DataBind();

            int tipoConsul=0;
            if (OboutRadioButton1.Checked == true)
                tipoConsul = 1;
            else
                if (OboutRadioButton2.Checked == true)
                    tipoConsul = 2;
                else
                    if (OboutRadioButton3.Checked == true)
                        tipoConsul = 3;

            if (!Page.IsPostBack)
            {
                dSolicitudesBO mydSolicitudesBO = new dSolicitudesBO();
                GVWEvalProv.DataSource = mydSolicitudesBO.BuscaSolicitudesBoletos(tipoConsul, cmbEmpleado.SelectedValue, txtNoViatico.Text);
                GVWEvalProv.DataBind();

            }

            //GVWEvalProv.DataSourceID = null;
            //GVWEvalProv.DataBind();


        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {



            String n_solicitud = Request.QueryString["n_solicitud"];
            String c_uniNeg = Request.QueryString["c_unidadNeg"];

            lbl_n_requisicion.Text = n_solicitud;
            solSolicitudesBO objsolSolicitudesBO = new solSolicitudesBO();
            solSolicitudes objsolSolicitudes = new solSolicitudes();
            objsolSolicitudes.N_solicitud = int.Parse(n_solicitud);
            objsolSolicitudes.C_tipo = "VIA";
            objsolSolicitudes.C_unidadNeg = c_uniNeg;

            objsolSolicitudes = objsolSolicitudesBO.Retrieve(objsolSolicitudes);

            list_empleados.Text = objsolSolicitudes.D_emp_solicita_JDE;
            txt_f_inicio_sol.Text = objsolSolicitudes.F_inicio_via;
            txt_f_fin_sol.Text = objsolSolicitudes.F_fin_via;
            txt_d_referencias_sugeridas.Text = objsolSolicitudes.D_lugar_via;
            txt_objeto.Text = objsolSolicitudes.D_solicitud;
            TxtNumeroUnidad.Text = objsolSolicitudes.C_num_unidad;
            List_vehiculos.SelectedValue = objsolSolicitudes.C_req_vehi;

            List_UniNeg.Text = objsolSolicitudes.D_unidadNeg;



            String idEmpleadoJDE = objsolSolicitudes.C_emp_solicita_JDE;
            empleadosBO MyEmpleado = new empleadosBO();
            empleado MyEmpleadoE = new empleado();
            MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE);
            MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE);
            lbl_d_gerencia.Text = MyEmpleadoE.Gerencia;
            lbl_d_autorizador.Text = MyEmpleadoE.Autorizador;
            lbl_id_empAutoriza.Text = MyEmpleadoE.IdAutorizador.ToString();
            lbl_idgerencia.Text = MyEmpleadoE.IdGerencia;

            //********** para buscar que compania tiene asignada **********

            NegocioCapitalHumano negocio = new NegocioCapitalHumano();
            List<Employee> listaEmpleados = negocio.ListaEmpleados(idEmpleadoJDE, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
            string nombrecompania = "";
            if (listaEmpleados == null)
            {
                nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado ";
            }
            else
            {
                nombrecompania = listaEmpleados[0].CompañiaJde.ToString();
                if (nombrecompania == "")
                {
                    nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado";
                }
            }
            TextNombreEmpresa.Text = nombrecompania;
            // solSolicitudes objsolSolicitudes = new solSolicitudes();
            objsolSolicitudes.C_compania = TextNombreEmpresa.Text;

            unidadNegBO MyCompaniaDO = new unidadNegBO();
            solSolicitudes MySol = new solSolicitudes();
            MySol = MyCompaniaDO.BuscaCompania(objsolSolicitudes);
            TextRFC.Text = MySol.C_companiaRFC;
            TextDireccion.Text = MySol.C_companiaDir;
            TextIdEmpresa.Text = MySol.C_idcompania;


            //empleadosBO MyEmpleado = new empleadosBO();




            //Request.QueryString
            //Request.QueryString("n_contrato")

            //String Cadena = Request.QueryString["n_requisicion"];
            ////String Cadena = lbl_n_requisicion.Text;
            //if (Cadena == null || Cadena == "")
            //{
            //    Cadena = "0";
            //}
            //lbl_n_requisicion.Text = Cadena;


            //empleadosBO MyEmpleado = new empleadosBO();

            //if (IsCallback)
            //{ 

            //}

            if (!this.IsPostBack)
            {
                //String strEmpleado = list_empleados.SelectedValue.ToString();
            //usuarioOracleDO MyUsuarioDO = new usuarioOracleDO();
           
            //list_empleados.DataSource = MyEmpleado.BuscaEmpleados();
            //list_empleados.DataValueField = "ABAN8";
            //list_empleados.DataTextField = "ABALPH";
            //list_empleados.DataBind();

            //unidadNegBO MyUnidadNegDO = new unidadNegBO();
            //List_UniNeg.DataSource = MyUnidadNegDO.BuscaUnidadNeg();
            //List_UniNeg.DataValueField = "MCMCU";
            //List_UniNeg.DataTextField = "MCDC";
            //List_UniNeg.DataBind();


                
               
                ////int i = 0;
                ////i++;

                //// MyUsuarioDO.testConexion("Hola mundo");

                //DataSet conjunto = new DataSet();
                //dSolicitudesBO mydSolicitudesBO = new dSolicitudesBO();
                ////conjunto = (DataSet)mydSolicitudesBO.BuscaSolicitudes();

                ////adapter.Fill(set,"NombreTabla");
                //GView_Detalle.DataSourceID = null;
                //GView_Detalle.DataSource = mydSolicitudesBO.BuscaSolicitudes();
                //String[] valores = { "n_contrato", "n_requisicion", "n_partida" };
                //GView_Detalle.DataKeyNames = valores;
                ////GView_Detalle.DataMember = "NombreTabla";

                //GView_Detalle.DataBind();

                ////DataKeyNames="n_contrato,n_requisicion,n_partida" 
                ////DataSourceID="Data_Drequisicion"
                ////GView_Detalle.Refresh();

            }
            else
            {

                //if (lbl_n_requisicion.Text == "0" )
                //{

                //    String idEmpleadoJDE = list_empleados.SelectedValue.ToString();
                //    //empleadosBO MyEmpleado = new empleadosBO();
                //    empleado MyEmpleadoE = new empleado();
                //    MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE);
                //    MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE);
                //    lbl_d_gerencia.Text = MyEmpleadoE.Gerencia;
                //    lbl_d_autorizador.Text = MyEmpleadoE.Autorizador;
                //    lbl_id_empAutoriza.Text = MyEmpleadoE.IdAutorizador.ToString();
                //    lbl_idgerencia.Text = MyEmpleadoE.IdGerencia;
                
                //}
                
               





                //DataSet conjunto = new DataSet();
                //dSolicitudesBO mydSolicitudesBO = new dSolicitudesBO();
                ////conjunto = (DataSet)mydSolicitudesBO.BuscaSolicitudes();
                ////adapter.Fill(set,"NombreTabla");
                //GView_Detalle.DataSourceID = null;

                //GView_Detalle.DataSource = mydSolicitudesBO.BuscaSolicitudes(int.Parse(lbl_n_requisicion.Text));
                ////String[] valores = { "n_contrato", "n_requisicion", "n_partida" };
                ////GView_Detalle.DataKeyNames = valores;
                ////GView_Detalle.DataMember = "NombreTabla";

                //GView_Detalle.DataBind();

                ////DataKeyNames="n_contrato,n_requisicion,n_partida" 
                ////DataSourceID="Data_Drequisicion"
                ////GView_Detalle.Refresh();



            }
             




        }
Exemplo n.º 3
0
        protected void List_c_cta_contable_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow gvr;
            DropDownList CmbCOncepto = (DropDownList)sender;
            String StrCuenta = CmbCOncepto.SelectedValue;
            String StrEmpleadoViat;

            StrEmpleadoViat = list_empleados.SelectedValue;
            //StrEmpleadoViat = lbl_c_empleado.Text;

            System.DateTime Dt1;
            System.DateTime Dt2;
            int dias;


            int bandera = 1;

            if ((etiquetaNoSolicitud.Text == "") || (etiquetaNoSolicitud.Text.Trim() == "0"))
            {
                MensajeError("Grabe el encabezado de la Solicitud, Verifique!");
                bandera = 0;
            }

            idviatico.Text = etiquetaNoSolicitud.Text;
            idviatico2.Text = etiquetaNoSolicitud.Text;

            if (StrCuenta == "HTL")  //para cuando selecciona Gastos de Hotel
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myScript", "PrepararComponentes();", true);
            }

            if (StrCuenta == "GPA")  //para cuando selecciona PASAJES AEREOS
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myScript", "PrepararComponentes2();", true);
            }

            if (bandera == 1)
            {
                if (String.IsNullOrEmpty(txt_f_inicio_sol.Text) == false && String.IsNullOrEmpty(txt_f_fin_sol.Text) == false)
                {
                    Dt1 = DateTime.ParseExact(txt_f_inicio_sol.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                    Dt2 = DateTime.ParseExact(txt_f_fin_sol.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                    //dias =  DateDiff(DateInterval.Day, Dt1, Dt2) + 1
                    dias = (int)(Dt2 - Dt1).TotalDays + 1;


                    if (GView_Detalle.Rows.Count == 0)
                    {
                        TextBox txt_q_requeridoNO;
                        TextBox txt_d_materialNO;
                        //Dim emptyRow As  = GView_Detalle.Controls(0).Controls(0)
                        GridViewRow emptyRow = (GridViewRow)GView_Detalle.Controls[0].Controls[0];
                        txt_q_requeridoNO = (TextBox)(emptyRow.FindControl("txt_q_requeridoNO"));
                        txt_d_materialNO = (TextBox)(emptyRow.FindControl("txt_d_materialNO"));

                        Double monto1Tmp;
                        Double Monto;

                        //--------------------------------------------------------------------------------
                        empleadosBO MyEmpleado = new empleadosBO();
                        String idEmpleadoJDE = list_empleados.SelectedValue.ToString();
                        //empleadosBO MyEmpleado = new empleadosBO();
                        empleado MyEmpleadoE = new empleado();
                        MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE);
                        MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE);

                        solSolicitudesBO MydSolicitudesBO = new solSolicitudesBO();
                        solSolicitudes MydSolicitudes = new solSolicitudes();
                        MydSolicitudes.N_solicitud = int.Parse(etiquetaNoSolicitud.Text);
                        MydSolicitudes.C_tipo = "VIA";
                        MydSolicitudes.C_unidadNeg = List_UniNeg.SelectedValue;
                        MydSolicitudes = MydSolicitudesBO.Retrieve(MydSolicitudes);

                        //MydSolicitudes.C_emp_solicita_JDE
                        empleado empBusGer = new empleado();
                        empleadosBO empBusGerBO = new empleadosBO();
                        empBusGer.IdlibretaDir = int.Parse(MydSolicitudes.C_emp_solicita_JDE);
                        empBusGer = empBusGerBO.Retrievex_idlibretaDir(empBusGer);

                        //--------------------------------------------------------------------------------

                        grupoBO mygrupoBO = new grupoBO();
                        monto1Tmp = mygrupoBO.BuscaGruposPolitica(empBusGer.IdGerencia, StrCuenta);

                        if (monto1Tmp > 0.0)
                        {
                            //B = CDbl(Val(Campo5)) '// Val do hard work
                            Monto = monto1Tmp * dias;
                            txt_q_requeridoNO.Text = Monto.ToString();
                            txt_q_requeridoNO.ReadOnly = true;
                            txt_q_requeridoNO.Enabled = false;
                            txt_q_requeridoNO.BackColor = System.Drawing.Color.LightGray;

                            if (StrCuenta == "HTL" || StrCuenta == "GPA")  //para cuando selecciona Gastos de Hotel y Pasajes aeros
                            {
                                if (txt_q_requeridoNO.Text == "")
                                {
                                    txt_q_requeridoNO.Text = "0";
                                    txt_d_materialNO.Text = "-";
                                }
                            }
                        }
                        else
                        {
                            txt_q_requeridoNO.ReadOnly = false;
                            txt_q_requeridoNO.Enabled = true;
                            txt_q_requeridoNO.BackColor = System.Drawing.Color.White;
                            txt_q_requeridoNO.Text = "";

                            if (StrCuenta == "HTL" || StrCuenta == "GPA")  //para cuando selecciona Gastos de Hotel y Pasajes aeros
                            {
                                if (txt_q_requeridoNO.Text == "")
                                {
                                    txt_q_requeridoNO.Text = "0";
                                    txt_d_materialNO.Text = "-";
                                }
                            }
                        }

                    }
                    else
                    {

                        TextBox txt_q_requeridoNO;
                        TextBox txt_d_materialNO;
                        GridViewRow emptyRow = (GridViewRow)GView_Detalle.FooterRow;
                        txt_q_requeridoNO = (TextBox)(emptyRow.FindControl("txt_q_requerido"));
                        txt_d_materialNO = (TextBox)(emptyRow.FindControl("txt_d_materialNO"));

                        Double monto1Tmp;
                        Double Monto;

                        grupoBO mygrupoBO = new grupoBO();
                        monto1Tmp = mygrupoBO.BuscaGruposPolitica(lbl_idgerencia.Text, StrCuenta);

                        if (monto1Tmp > 0.0)
                        {
                            //B = CDbl(Val(Campo5)) '// Val do hard work
                            Monto = monto1Tmp * dias;
                            txt_q_requeridoNO.Text = Monto.ToString();
                            txt_q_requeridoNO.ReadOnly = true;
                            txt_q_requeridoNO.Enabled = false;
                            txt_q_requeridoNO.BackColor = System.Drawing.Color.LightGray;

                            if (StrCuenta == "HTL" || StrCuenta == "GPA")  //para cuando selecciona Gastos de Hotel y Pasajes aeros
                            {
                                if (txt_q_requeridoNO.Text == "")
                                {
                                    txt_q_requeridoNO.Text = "0";
                                    txt_d_materialNO.Text = "-";
                                }
                            }
                        }
                        else
                        {
                            //TextBox txt_d_materialNO2;
                            //txt_d_materialNO2 = (TextBox)(emptyRow.FindControl("txt_d_materialNO"));

                            txt_q_requeridoNO.ReadOnly = false;
                            txt_q_requeridoNO.Enabled = true;
                            txt_q_requeridoNO.BackColor = System.Drawing.Color.White;
                            txt_q_requeridoNO.Text = "";
                            if (StrCuenta == "HTL" || StrCuenta == "GPA")  //para cuando selecciona Gastos de Hotel y Pasajes aeros
                            {
                                if (txt_q_requeridoNO.Text == "")
                                {
                                    txt_q_requeridoNO.Text = "0";
                                    //  txt_d_materialNO.Text = "-";
                                }
                            }
                        }

                    }
                }
            }
        }
Exemplo n.º 4
0
        protected void Seleted_ListEmpleados(object sender, EventArgs e)
        {
            empleadosBO MyEmpleado = new empleadosBO();

            String idEmpleadoJDE = list_empleados.SelectedValue.ToString();
            //empleadosBO MyEmpleado = new empleadosBO();
            empleado MyEmpleadoE = new empleado();
            MyEmpleadoE.IdlibretaDir = int.Parse(idEmpleadoJDE);
            MyEmpleadoE = MyEmpleado.Retrievex_idlibretaDir(MyEmpleadoE);
            lbl_d_gerencia.Text = MyEmpleadoE.Gerencia;
            lbl_d_autorizador.Text = MyEmpleadoE.Autorizador;
            lbl_id_empAutoriza.Text = MyEmpleadoE.IdAutorizador.ToString();
            lbl_idgerencia.Text = MyEmpleadoE.IdGerencia;

            //********** para buscar que compania tiene asignada **********

            NegocioCapitalHumano negocio = new NegocioCapitalHumano();
            List<Employee> listaEmpleados = negocio.ListaEmpleados(idEmpleadoJDE, "%", "%", "%", "%", "%", "%", "%", "%", "%", "%", Convert.ToDateTime("01/Jan/1950"), Convert.ToDateTime("01/Jan/9999"));
            string nombrecompania = "";
            if (listaEmpleados == null)
            {
                nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado ";
            }
            else
            {
                nombrecompania = listaEmpleados[0].CompañiaJde.ToString();
                if (nombrecompania == "")
                {
                    nombrecompania = "No tiene asignada Compania / o este es Ex-Empleado";
                }
            }
            TextNombreEmpresa.Text = nombrecompania;

            solSolicitudes objsolSolicitudes = new solSolicitudes();
            objsolSolicitudes.C_compania = TextNombreEmpresa.Text;

            unidadNegBO MyCompaniaDO = new unidadNegBO();
            solSolicitudes MySol = new solSolicitudes();
            MySol = MyCompaniaDO.BuscaCompania(objsolSolicitudes);
            TextRFC.Text = MySol.C_companiaRFC;
            TextDireccion.Text = MySol.C_companiaDir;
            TextIdEmpresa.Text = MySol.C_idcompania;

            //solSolicitudesBO MySolicitud = new solSolicitudesBO();
            //solSolicitudes MySol = new solSolicitudes();
            //MySol = MySolicitud.CompaniaDatos(objsolSolicitudes);
            //TextRFC.Text = MySol.C_companiaRFC;
            //TextDireccion.Text = MySol.C_companiaDir;
        }