Esempio n. 1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     DatePickIngreso.Format       = DateTimePickerFormat.Custom;
     DatePickIngreso.CustomFormat = "dd-MM-yyyy";
     TxtNombre.Focus();
     TxtApellido.Focus();
 }
        private void Reset()
        {
            rtbMedicamentos.Clear();
            rtbAntecedentes.Clear();
            TxtNombre.Clear();
            TxtApellido.Clear();
            TxtDui.Clear();
            RtbDireccion.Clear();
            TxtNumero.Clear();
            txtDia.Clear();
            txtMes.Clear();
            txtAño.Clear();
            CboSexo.Items.Clear();
            CboSexo.Items.Add("F");
            CboSexo.Items.Add("M");

            CboEstadoCivil.Items.Clear();
            CboEstadoCivil.Items.Add("Soltero");
            CboEstadoCivil.Items.Add("Casado");
            CboEstadoCivil.Items.Add("Divorsiado");
            CboEstadoCivil.Items.Add("Viudo");

            CboTipoSangre.Items.Clear();
            CboTipoSangre.Items.Add("O -");
            CboTipoSangre.Items.Add("O +");
            CboTipoSangre.Items.Add("A -");
            CboTipoSangre.Items.Add("A +");
            CboTipoSangre.Items.Add("B -");
            CboTipoSangre.Items.Add("B +");
            CboTipoSangre.Items.Add("AB -");
            CboTipoSangre.Items.Add("AB +");
        }
        private void BtnModificar_Click(object sender, EventArgs e)
        {
            if (TxtCodigo.Text != "" && TxtNombre.Text != "" && TxtApellido.Text != "" && TxtClave.Text != "" && TxtDireccion.Text != "" && CmbEstado.Text != "")
            {
                ClsEEmpleados Eobj = new ClsEEmpleados();
                ClsNEmpleados Nobj = new ClsNEmpleados();
                Eobj.codemp = TxtCodigo.Text;
                Eobj.nomemp = TxtNombre.Text;
                Eobj.apeemp = TxtApellido.Text;
                Eobj.claemp = TxtClave.Text;
                Eobj.diremp = TxtDireccion.Text;
                Eobj.estado = CmbEstado.Text;
                Nobj.MtdActualizarEmpleados(Eobj);
                DgvEmpleados.DataSource = Nobj.MtdListarEmpleados();

                CmbEstado.Enabled = false;
                TxtCodigo.Enabled = true;
                TxtCodigo.Clear();
                TxtNombre.Clear();
                TxtApellido.Clear();
                TxtClave.Clear();
                TxtDireccion.Clear();
                CmbEstado.Text = "Activo";
            }
            else
            {
                MessageBox.Show("Por favor llene todos los campos", "Mensaje");
            }
        }
Esempio n. 4
0
 public void limpiar()
 {
     txtNombre.Clear();
     TxtApellido.Clear();
     TxtIdentificacion.Clear();
     txtCurso.Clear();
 }
Esempio n. 5
0
 void Clear()
 {
     TxtId.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();;
     TxtEdad.Clear();
     TxtPass.Clear();
 }
Esempio n. 6
0
 private void ClearData()
 {
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtDireccion.Clear();
     TxtTelefono.Clear();
     TxtTelfonoT.Clear();
 }
Esempio n. 7
0
 void clear()
 {
     TxtId.Clear();
     TxtNameUser.Clear();
     TxtApellido.Clear();
     TxtEdad.Clear();
     TxtPass.Clear();
 }
Esempio n. 8
0
 public void LimpiarCajitas()
 {
     TxtDni.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtDireccion.Clear();
     TxtEmail.Clear();
     TxtTelefono.Clear();
 }
Esempio n. 9
0
 /// <summary>
 /// limpia todos los datos del formulario despues de que fue registrado.
 /// </summary>
 private void ClearValue()
 {
     txtAddres.Clear();
     TxtApellido.Clear();
     txtCelu.Clear();
     txtCi.Clear();
     TxtContaseña.Clear();
     TxtNombre.Clear();
     TxtUsuario.Clear();
 }
Esempio n. 10
0
 public void LimpiarCajitas()
 {
     TxtCodigo.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtClave.Clear();
     CmbCargo.SelectedIndex  = -1;
     CmbEstado.SelectedIndex = -1;
     ruta = "";
 }
Esempio n. 11
0
 public void LimpiarCamposCliente()
 {
     TxtCedula.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtTelefono.Clear();
     TxtTelefono.Clear();
     TxtCelular.Clear();
     TxtEmail.Clear();
 }
 private void BtnNuevo_Click(object sender, EventArgs e)
 {
     CmbEstado.Enabled = false;
     TxtCodigo.Enabled = true;
     TxtCodigo.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtClave.Clear();
     TxtDireccion.Clear();
     CmbEstado.Text = "Activo";
 }
Esempio n. 13
0
        private void Limpiar()
        {
            TxtNombre.Clear();
            TxtApellido.Clear();
            TxtTelefono.Clear();

            TxtNombre.Focus();

            CbxTipoContactos.SelectedIndex = 0;

            id = 0;
        }
        private void ClearData()
        {
            TxtNombre.Clear();
            TxtApellido.Clear();
            TxtTelefono.Clear();
            _id = 0;

            CbxTipoContacto.SelectedIndex = 0;

            _filename = "";

            PbFotoPerfil.ImageLocation = "";
        }
Esempio n. 15
0
 private void BtnLimpia_Click(object sender, EventArgs e)
 {
     TxtApellido.Clear();
     TxtQueryID.Clear();
     MTxtCedula.Clear();
     TxtCodigo.Clear();
     TxtNombre.Clear();
     TxtUser.Clear();
     TxtQueryNombre.Clear();
     TxtTelefono.Clear();
     TxtUser.Clear();
     TxtConfirmar.Clear();
     TxtContrasena.Clear();
 }
Esempio n. 16
0
        private void BtGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                DataBaseControl DBcontrol = new DataBaseControl(DataBaseControl.cPath, "ProjectDataBase.mdf");
                int             id        = AlumnosCS.GenerarID();
                string[]        Element   = { "@id" };
                string[]        values    = { id.ToString() };
                string          tempID    = DBcontrol.BuscarElemento("Select [ID] from Alumnos where [ID] = @id", Element, values);
                while (tempID != "No encontrado")
                {
                    id     = AlumnosCS.GenerarID();
                    values = new string[] { id.ToString() };
                    tempID = DBcontrol.BuscarElemento("Select [ID] from Alumnos where [ID] = @id", Element, values);
                }
                MemoryStream ms = new System.IO.MemoryStream();
                PBImage.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                AlumnosCS estudiante = new AlumnosCS(TxtNombre.Text, TxtApellido.Text, CBEstado.SelectedItem.ToString(), id, TxtCarrera.Text, TxtIdentificadorNacial.Text, DateTime.Parse(MTBFecha.Text).ToShortDateString());
                string[]  Elements   = new string[] { "@id", "@nombre", "@apellido", "@fecha", "@identifacor", "@estado", "@carrera", "@image" };
                string[]  Values     = new string[]  { estudiante.ID.ToString(), estudiante.Nombre, estudiante.Apellido, estudiante.FechaNacimiento.ToString(), estudiante.IdentificadorPersonal, estudiante.Estado, estudiante.Carrera };

                if (DBcontrol.Insertar("Insert into Alumnos values(@id,@nombre,@apellido,@fecha,@identifacor,@estado,@carrera,@image,0.0)", Elements, Values, ms))
                {
                    Console.WriteLine(MessageBox.Show(string.Format("{0} fue agregado", estudiante.Nombre)));
                }
                else
                {
                    Console.WriteLine(MessageBox.Show(string.Format("{0} no agregado", estudiante.Nombre)));
                }
                TxtNombre.Clear();
                TxtApellido.Clear();
                CBEstado.SelectedItem = null;
                id = 0;
                TxtCarrera.Clear();
                TxtIdentificadorNacial.Clear();
                MTBFecha.Clear();
                Image foto = Image.FromFile("intec.png");
                PBImage.Image = foto;
                Verificar();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Esempio n. 17
0
 private void Clear()
 {
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtTelefono.Clear();
 }
Esempio n. 18
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     Mensajes.Msjs(this, "Error", "GuardaTODO");
     try
     {
         if (string.IsNullOrEmpty(txtcNombrePrestador.Text))
         {
             Mensajes.Msjs(this, "Error", "El nombre es obligatorio");
             txtcNombrePrestador.Focus();
         }
         else
         {
             if (string.IsNullOrEmpty(TxtApellido.Text))
             {
                 Mensajes.Msjs(this, "Error", "El apellido paterno es obligatorio");
                 TxtApellido.Focus();
             }
             else
             {
                 if (string.IsNullOrEmpty(txtApellidoMat.Text))
                 {
                     Mensajes.Msjs(this, "Error", "El apellido materno es obligatorio");
                     txtApellidoMat.Focus();
                 }
                 else
                 {
                     if (string.IsNullOrEmpty(txtDireccion.Text))
                     {
                         Mensajes.Msjs(this, "Error", "La dirección es obligatorio");
                         txtDireccion.Focus();
                     }
                     else
                     {
                         if (string.IsNullOrEmpty(txtTel.Text))
                         {
                             Mensajes.Msjs(this, "Error", "El telefono es obligatorio");
                             txtTel.Focus();
                         }
                         else
                         {
                             if (string.IsNullOrEmpty(txtMatricula.Text))
                             {
                                 Mensajes.Msjs(this, "Error", "La matricula  es obligatorio");
                                 txtMatricula.Focus();
                             }
                             else
                             {
                                 /*
                                  * int idDocumento = 0;
                                  *
                                  * ProveedorInfo oDocumento = new ProveedorInfo();
                                  * ProveedorBE oDocumentoBE = new ProveedorBE();
                                  *
                                  * oDocumento.cNombre = txtNombre.Text;
                                  * oDocumento.cApellidoPaterno = txtApPaterno.Text;
                                  * oDocumento.cApellidoMaterno = txtApMaterno.Text;
                                  * oDocumento.cDireccion = txtDireccion.Text;
                                  * oDocumento.cRFC = txtRfc.Text;
                                  * oDocumento.cCorreo = txtCorreo.Text;
                                  * oDocumento.cObservaciones = txtObservaciones.Text;
                                  * oDocumento.dtFechaAlta = DateTime.Now;
                                  * oDocumento.lActivo = true;
                                  * Mensajes.Msjs(this, "Mensaje", oDocumento.cNombre);
                                  * if (txtClaveProv.Text == "")
                                  * {
                                  *  idDocumento = oDocumentoBE.Insertar(oDocumento);
                                  *  txtClaveProv.Text = Convert.ToString(idDocumento);
                                  *  oDocumento.iIdProveedor = idDocumento;
                                  *  Mensajes.Msjs(this, "Mensaje", "Registro guardado exitosamente");
                                  * }
                                  * else
                                  * {
                                  *  oDocumento.iIdProveedor = Convert.ToInt32(txtClaveProv.Text);
                                  *  //Actualizacion
                                  *  oDocumentoBE.Actualizacion(oDocumento);
                                  *  Mensajes.Msjs(this, "Mensaje", "Registro se actualizo exitosamente");
                                  *
                                  * }
                                  *
                                  *
                                  * GridConsulta.DataSource = oDocumentoBE.bsqClaveProve(oDocumento);
                                  * GridConsulta.DataBind();
                                  *
                                  * btnCons.Enabled = true;
                                  * btnGuardar.Enabled = false;
                                  *
                                  *
                                  * txtClaveProv.Text = "";
                                  * txtNombre.Text = "";
                                  * txtApPaterno.Text = "";
                                  * txtApMaterno.Text = "";
                                  * txtDireccion.Text = "";
                                  * txtRfc.Text = "";
                                  * txtCorreo.Text = "";
                                  * txtObservaciones.Text = ""; */
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Mensajes.Msjs(this, "Error", "Ocurrió el siguiente detalle: " + ex.Message);
     }
 }
Esempio n. 19
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            //Mensajes.Msjs(this, "Error", "AfectaTODO");
            try
            {
                if (string.IsNullOrEmpty(txtcNombrePrestador.Text))
                {
                    Mensajes.Msjs(this, "Error", "El nombre es obligatorio");
                    txtcNombrePrestador.Focus();
                }
                else
                {
                    if (string.IsNullOrEmpty(TxtApellido.Text))
                    {
                        Mensajes.Msjs(this, "Error", "El apellido paterno es obligatorio");
                        TxtApellido.Focus();
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(txtApellidoMat.Text))
                        {
                            Mensajes.Msjs(this, "Error", "El apellido materno es obligatorio");
                            txtApellidoMat.Focus();
                        }
                        else
                        {
                            if (string.IsNullOrEmpty(txtDireccion.Text))
                            {
                                Mensajes.Msjs(this, "Error", "La dirección es obligatorio");
                                txtDireccion.Focus();
                            }
                            else
                            {
                                if (string.IsNullOrEmpty(txtTel.Text))
                                {
                                    Mensajes.Msjs(this, "Error", "El telefono es obligatorio");
                                    txtTel.Focus();
                                }
                                else
                                {
                                    if (string.IsNullOrEmpty(txtMatricula.Text))
                                    {
                                        Mensajes.Msjs(this, "Error", "La matricula  es obligatorio");
                                        txtMatricula.Focus();
                                    }
                                    else
                                    {
                                        if (string.IsNullOrEmpty(txtEmail.Text))
                                        {
                                            Mensajes.Msjs(this, "Error", "El correo es obligatorio");
                                            txtMatricula.Focus();
                                        }
                                        else
                                        {
                                            if (string.IsNullOrEmpty(txtPass.Text))
                                            {
                                                Mensajes.Msjs(this, "Error", "El password  es obligatorio");
                                                txtMatricula.Focus();
                                            }
                                            else
                                            {
                                                if (string.IsNullOrEmpty(txtConfpass.Text))
                                                {
                                                    Mensajes.Msjs(this, "Error", "Favor de confirmar el password");
                                                    txtMatricula.Focus();
                                                }
                                                else
                                                {
                                                    if (txtPass.Text != txtConfpass.Text)
                                                    {
                                                        Mensajes.Msjs(this, "Error", "No coicide la confirmacion del password");
                                                        txtConfpass.Focus();
                                                    }
                                                    else
                                                    {
                                                        int              idDocumento = 0;
                                                        Prestador        objPrest    = new Prestador();
                                                        PrestadorNegocio objPresBE   = new PrestadorNegocio();
                                                        objPrest.Nombre      = txtcNombrePrestador.Text;
                                                        objPrest.ApellidoPat = TxtApellido.Text;
                                                        objPrest.ApellidoMat = txtApellidoMat.Text;
                                                        objPrest.domicilio   = txtDireccion.Text;
                                                        objPrest.celular     = txtTel.Text;
                                                        objPrest.Matricula   = Convert.ToInt32(txtMatricula.Text);
                                                        objPrest.eMail       = txtEmail.Text;
                                                        objPrest.password    = txtConfpass.Text;
                                                        objPrest.idEstado    = Convert.ToInt32(DropListEstado.SelectedValue.ToString());
                                                        objPrest.idMunicipio = Convert.ToInt32(dropListMunicipio.SelectedValue.ToString());
                                                        //objPrest.idInstitucion = Convert.ToInt32(DropListInst.SelectedValue.ToString());
                                                        //objPrest.idCarrera = Convert.ToInt32(DropListCarrera.SelectedValue.ToString());

                                                        idDocumento = objPresBE.CrearPrestador(objPrest);
                                                        Mensajes.Msjs(this, "Mensaje", "Registro guardado exitosamente");
                                                        Response.Redirect(Page.ResolveUrl("~/Default.aspx"));
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Mensajes.Msjs(this, "Error", "Ocurrió el siguiente detalle: " + ex.Message);
            }
        }