Exemplo n.º 1
0
        private void dpcolaborador2()
        {
            try
            {
                //para limpiar las variables de session.

                //para limpiar lod dpts
                //this.txtDescripDedud.Text = "";
                //this.DptMes.SelectedIndex = 0;
                //this.Dptyear.SelectedIndex = 0;
                //this.Dpquincena.SelectedIndex = 0;
                //this.DptMoneda.SelectedIndex = 0;
                //
                this.emple = new Empleados();
                this.emple.Cedula_empleado = this.DptColaborador.SelectedValue;
                this.emple.Opc             = 4;
                this.empleHelper           = new Empleados_Helper(emple);
                this.datos = new DataTable();
                this.datos = this.empleHelper.validaEmpleado();
                if (datos.Rows.Count >= 0)
                {
                    DataRow fila = datos.Rows[0];
                    this.txt_Nombre.Text   = fila["nombre"].ToString();
                    this.txt_Apellido.Text = fila["apellido1"].ToString() + " " + fila["apellido2"].ToString();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        protected void btn_registra_Click(object sender, EventArgs e)
        {
            try
            {
                this.colabo                            = new Empleados();
                this.colabo.Opc                        = 1;
                this.colabo.Nombre_empelado            = this.txt_Nombre.Text;
                this.colabo.Cedula_empleado            = this.txt_identificacion.Text;
                this.colabo.Apellido1_empleado         = this.txt_Apellido1.Text;
                this.colabo.Apellido2_empleado         = this.txt_Apellido2.Text;
                this.colabo.Domicilio                  = this.txt_Domicilio.Text;
                this.colabo.Telefono_empleado          = this.txt_Numero_telefonico.Text;
                this.colabo.Correo_empleado            = this.txt_Correo_Electronico.Text;
                this.colabo.Cuenta_banco_empleado      = this.txt_Cuenta_IBAN.Text;
                this.colabo.Fecha_inicio_empleado      = fecha_ingreso.Value;
                this.colabo.Fecha_nacimientoi_empleado = fecha_nacimiento.Value;
                this.colabo.Estado_empleado            = "Activo";

                this.colaboHelper = new Empleados_Helper(colabo);
                this.colaboHelper.Agregar_Empleado();
                ScriptManager.RegisterStartupScript(this, typeof(Page), "mensajeDeconfirmacion", "mensajeDeconfirmacion('" + "" + "');", true);
                this.txt_Nombre.Text             = null;
                this.txt_identificacion.Text     = null;
                this.txt_Apellido1.Text          = null;
                this.txt_Domicilio.Text          = null;
                this.txt_Numero_telefonico.Text  = null;
                this.txt_Correo_Electronico.Text = null;
                this.txt_Cuenta_IBAN.Text        = null;
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "mensajeError", "mensajeError('" + "" + "');", true);
            }
        }
Exemplo n.º 3
0
 // cargar el dptcolaborador en el page load
 private void dpcolaborador()
 {
     try
     {
         this.emple = new Empleados();
         this.emple.Cedula_empleado = (string)Session["id_colaborador"];
         this.emple.Opc             = 4;
         this.empleHelper           = new Empleados_Helper(emple);
         this.datos = new DataTable();
         this.datos = this.empleHelper.validaEmpleado();
         if (datos.Rows.Count >= 0)
         {
             DataRow fila = datos.Rows[0];
             this.txt_Nombre.Text   = fila["nombre"].ToString();
             this.txt_Apellido.Text = fila["apellido1"].ToString() + " " + fila["apellido2"].ToString();
         }
     }
     catch (Exception)
     {
         // ScriptManager.RegisterStartupScript(this, typeof(Page), "mensajeError", "mensajeError('" + "" + "');", true);
     }
 }
Exemplo n.º 4
0
        protected void DptColaborador_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                this.emple = new Empleados();
                this.emple.Cedula_empleado = this.DptColaborador.SelectedValue;
                this.emple.Opc             = 4;

                this.empleHelper = new Empleados_Helper(emple);
                this.datos       = new DataTable();
                this.datos       = this.empleHelper.validaEmpleado();
                if (datos.Rows.Count >= 0)
                {
                    DataRow fila = datos.Rows[0];
                    this.txt_Nombre.Text   = fila["nombre"].ToString();
                    this.txt_Apellido.Text = fila["apellido1"].ToString() + " " + fila["apellido2"].ToString();
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "mensajeError", "mensajeError('" + "" + "');", true);
            }
        }