Exemplo n.º 1
0
        protected void Registrar_PERSONA()
        {
            DB_Persona Reg = new DB_Persona();
            Persona    per = new Persona();

            per.Id_Persona       = TxtCedula.Text;
            per.ci               = TxtCedula.Text;
            per.ext              = DDLExt.SelectedItem.Text;
            per.Nombres          = TxtNombre.Text;
            per.Primer_ap        = TxtPaterno.Text;
            per.Segundo_ap       = TxtMaterno.Text;
            per.Fecha_nacimiento = Convert.ToDateTime("01/01/1990");
            per.Sexo             = true;
            per.Telef_fijo       = TxtFijo.Text;
            per.Telef_cel        = TxtMovil.Text;
            per.Fecha_registro   = DateTime.Now;
            per.Estado           = "Activo";
            //if (estado == 0)
            //{
            Reg.DB_Registrar_PERSONA(per);
            //}
            //else
            //{
            //  NOrg.UpdateOrganizacion(org);

            //}
        }
Exemplo n.º 2
0
        private void Buscar_PERSONA(string ci)
        {
            Persona    p  = new Persona();
            DB_Persona np = new DB_Persona();

            p = np.DB_Buscar_PERSONA(ci);
            string idus = "";
            string aux  = "";

            if (p.ci == ci)
            {
                TxtCedula.Text = p.ci;
                //DDLExt.Items.Insert(0, new ListItem(p.ext, p.ext, true)); //lrojas:03102016
                DDLExt.SelectedValue = p.ext;
                //DDLExt.DataBind();
                TxtNombre.Text    = p.Nombres;
                TxtApPat.Text     = p.Primer_ap;
                TxtApMat.Text     = p.Segundo_ap;
                TxtFechNac.Text   = p.Fecha_nacimiento.ToShortDateString();
                TxtFonoFijo.Text  = p.Telef_fijo;
                TxtFonoMovil.Text = p.Telef_cel;
                if (p.Sexo == true)
                {
                    //aux = "MUJER";
                    aux = "1";
                }
                else
                {
                    //aux = "VARON";
                    aux = "0";
                }
                //DDLSexo.Items.Insert(0, new ListItem(aux, p.Sexo.ToString(), true)); //lrojas:03102016
                DDLSexo.SelectedValue = aux;
                //DDLSexo.DataBind();
                if (TxtApMat.Text != "")
                {
                    idus = TxtApPat.Text[0].ToString() + TxtApMat.Text[0].ToString() + TxtNombre.Text[0].ToString() + "-" + TxtCedula.Text;
                }
                else
                {
                    idus = TxtApPat.Text[0].ToString() + TxtNombre.Text[0].ToString() + "-" + TxtCedula.Text;
                }
                Id_Usuario_Aux = idus;
                Buscar_USUARIO(idus);
            }
            else
            {
                //limparCampos_PERSONA();
                this.LimpiarControles();
            }
        }
Exemplo n.º 3
0
        protected void Registrar_PERSONA()
        {
            DB_Persona Reg = new DB_Persona();
            Persona    per = new Persona();

            per.Id_Persona = TxtCedula.Text;
            per.ci         = TxtCedula.Text;
            per.ext        = DDLExt.SelectedItem.Text;
            per.Nombres    = TxtNombre.Text;
            per.Primer_ap  = TxtApPat.Text;
            per.Segundo_ap = TxtApMat.Text;
            if (TxtFechNac.Text == string.Empty)
            {
                per.Fecha_nacimiento = Convert.ToDateTime("01/01/1990");
            }
            else
            {
                per.Fecha_nacimiento = Convert.ToDateTime(TxtFechNac.Text.ToString());
            }

            if (DDLSexo.SelectedValue == "1")
            {
                per.Sexo = true;//MUJER
            }
            else
            {
                per.Sexo = false;//VARON
            }
            //per.Sexo = true;
            if (TxtFonoFijo.Text == string.Empty)
            {
                per.Telef_fijo = string.Empty;
            }
            else
            {
                per.Telef_fijo = TxtFonoFijo.Text;
            }
            if (TxtFonoMovil.Text == string.Empty)
            {
                per.Telef_cel = string.Empty;
            }
            else
            {
                per.Telef_cel = TxtFonoMovil.Text;
            }
            per.Fecha_registro = DateTime.Now;
            per.Estado         = "Activo";
            Reg.DB_Registrar_PERSONA(per);
        }
 protected void Modificar_PERSONA()
 {
     DB_Persona Reg = new DB_Persona();
     Persona per = new Persona();
     per.Id_Persona = TxtCedula.Text;
     per.ci = TxtCedula.Text;
     per.ext = DDLExt.SelectedItem.Text;
     per.Nombres = TxtNombre.Text;
     per.Primer_ap = TxtPaterno.Text;
     per.Segundo_ap = TxtMaterno.Text;
     per.Fecha_nacimiento = Convert.ToDateTime("01/01/1990");
     per.Sexo = true;
     per.Telef_fijo = TxtFijo.Text;
     per.Telef_cel = TxtMovil.Text;
     per.Fecha_registro = DateTime.Now;
     per.Estado = "ACTIVO";
     Reg.DB_Modificar_PERSONA(per);
 }
 private void Buscar_PERSONA(string ci)
 {
     Persona p = new Persona();
     DB_Persona np = new DB_Persona();
     p = np.DB_Buscar_PERSONA(ci);
     if (p.ci == ci)
     {
         TxtCedula.Text = p.ci;
         DDLExt.Items.Insert(0, new ListItem(p.ext, p.ext, true));
         DDLExt.DataBind();
         TxtNombre.Text = p.Nombres;
         TxtPaterno.Text = p.Primer_ap;
         TxtMaterno.Text = p.Segundo_ap;
         TxtFijo.Text = p.Telef_fijo;
         TxtMovil.Text = p.Telef_cel;
     }
     else
     {
         limparCampos_PERSONA();
     }
 }
        private void Buscar_PERSONA(string ci)
        {
            Persona    p  = new Persona();
            DB_Persona np = new DB_Persona();

            p = np.DB_Buscar_PERSONA(ci);
            if (p.ci == ci)
            {
                TextBoxCI.Text           = p.ci;
                TextBoxNOM.Text          = p.Nombres;
                TextBoxPAT.Text          = p.Primer_ap;
                TextBoxMAT.Text          = p.Segundo_ap;
                TextF1TextBoxFE_NAC.Text = (p.Fecha_nacimiento).ToString();
                TextBoxTEL_FIJO.Text     = p.Telef_fijo;
                TextBoxTEL_MOVIL.Text    = p.Telef_cel;
            }
            else
            {
                limparCampos_PERSONA();
            }
        }
Exemplo n.º 7
0
        protected void DDLSup_SelectedIndexChanged(object sender, EventArgs e)
        {
            DB_Usuario r  = new DB_Usuario();
            DataTable  dt = new DataTable();

            dt = r.DB_Seleccionar_ESTRUCTURA_ORG(Convert.ToInt32(DDLSup.SelectedValue));
            if (dt.Rows.Count == 0)//lrojas: 28/10/2016 validacion inmediato sup
            {
                throw new Exception("No cuenta con Inmediato Superior, Seleccione su Dependencia");
            }
            TxtCiResp.Text = dt.Rows[0][3].ToString();
            //**luis.rojas
            if (TxtCiResp.Text != string.Empty)
            {
                DB_Persona np    = new DB_Persona();
                Persona    presp = new Persona();
                presp            = np.DB_Buscar_PERSONA(TxtCiResp.Text);
                lblNom_Resp.Text = presp.Nombres + " " + presp.Primer_ap + " " + presp.Segundo_ap;
            }
            //**
        }
Exemplo n.º 8
0
 protected void Modificar_PERSONA()
 {
     try
     {
         DB_Persona Reg = new DB_Persona();
         Persona    per = new Persona();
         per.Id_Persona = TxtCedula.Text;
         per.ci         = TxtCedula.Text;
         per.ext        = DDLExt.SelectedItem.Text;
         per.Nombres    = TxtNombre.Text;
         per.Primer_ap  = TxtApPat.Text;
         per.Segundo_ap = TxtApMat.Text;
         //**luis.rojas
         per.Fecha_nacimiento = Convert.ToDateTime(TxtFechNac.Text);
         if (DDLSexo.SelectedValue == "1")
         {
             per.Sexo = true;//MUJER
         }
         else
         {
             per.Sexo = false;//VARON
         }
         per.Telef_fijo = TxtFonoFijo.Text.Trim();
         per.Telef_cel  = TxtFonoMovil.Text.Trim();
         //**
         per.Fecha_registro = DateTime.Now;
         per.Estado         = "Activo";
         Reg.DB_Modificar_PERSONA(per);
     }
     catch (Exception ex)
     {
         //string script = @"<script type='text/javascript'>alert('{0}');</script>";
         //script = string.Format(script, ex.Message);
         //ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false);
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 9
0
        protected void Registrar_PERSONA(Persona p)
        {
            DB_Persona pe = new DB_Persona();

            pe.DB_Registrar_PERSONA(p);
        }