Beispiel #1
0
        private void Pic_persona_Click(object sender, EventArgs e)
        {
            var filepath = string.Empty;

            try
            {
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    xFotoruta = openFileDialog1.FileName;
                    Pic_persona.Load(xFotoruta);
                }
            }
            catch
            {
                xFotoruta = Application.StartupPath + @"\user.png";
                Pic_persona.Load(Application.StartupPath + @"\user.png");
            }
        }
Beispiel #2
0
        public void Buscar_Personal_ParaEditar(string idpersonal)
        {
            try
            {
                RN_Personal obj  = new RN_Personal();
                DataTable   data = new DataTable();

                Cargar_rol();
                Cargar_Distrito();

                data = obj.RN_Buscar_Personal_xValor(idpersonal);
                if (data.Rows.Count == 0)
                {
                    return;
                }
                {
                    txt_Dni.Text               = Convert.ToString(data.Rows[0]["DNIPR"]);
                    txt_nombres.Text           = Convert.ToString(data.Rows[0]["Nombre_Completo"]);
                    txt_direccion.Text         = Convert.ToString(data.Rows[0]["Domicilio"]);
                    txt_correo.Text            = Convert.ToString(data.Rows[0]["Correo"]);
                    txt_NroCelular.Text        = Convert.ToString(data.Rows[0]["Celular"]);
                    dtp_fechaNaci.Value        = Convert.ToDateTime(data.Rows[0]["Fec_Naci"]);
                    cbo_sexo.Text              = Convert.ToString(data.Rows[0]["Sexo"]);
                    cbo_rol.SelectedValue      = data.Rows[0]["Id_rol"];
                    cbo_Distrito.SelectedValue = data.Rows[0]["Id_Distrito"];
                    txt_IdPersona.Text         = Convert.ToString(data.Rows[0]["Id_Pernl"]);
                    xFotoruta = Convert.ToString(data.Rows[0]["Foto"]);
                }

                xedit = true;
                btn_aceptar.Enabled = true;
                Pic_persona.Load(xFotoruta);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al buscar los datos: " + ex.Message, "Advertencia de Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }