Exemplo n.º 1
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtExpediente.Text.Trim()))
            {
                ErrorDatos.SetError(txtExpediente, "No ha elegido \nningun pacinte");
            }
            else
            {
                bool   ResultadoOK  = false;
                string mensajeError = "";
                objPaciente = new clFachadaPaciente();
                try
                {
                    objPaciente.EliminarPaciente(Convert.ToInt32(txtExpediente.Text), 1, ref ResultadoOK, ref mensajeError);
                }
                catch (Exception error)
                {
                    MessageBox.Show(error.Message.ToString());
                }

                if (ResultadoOK)
                {
                    MessageBox.Show("Paciente Elimnado con exito \n\n En cualquier momento puede restaurar el paciente ");
                    Efecto.LimpiarForm(this);
                }
                else
                {
                    MessageBox.Show("Paciente no Eliminado");
                }
            }
        }
 private void btnEditarPaciente_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtExpediente.Text.Trim()))
     {
         ErrorDatos.SetError(btnBuscarPaciente, "No ha elegido un paciente");
     }
     else
     {
         manipulable.manipular(ucRegistroP.Instance(manipulable), this.txtExpediente.Text);
         Efecto.LimpiarForm(this);
     }
 }
Exemplo n.º 3
0
        private void btnEditarPaciente_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtExpediente.Text.Trim()))
            {
                ErrorDatos.SetError(txtExpediente, "No ha elegido un paciente\na editar");
            }
            else
            {
                manipulable.manipular(ucRegistroP.Instance(manipulable), this.txtExpediente.Text);

                /*FP.btnAgregarPaciente_Click(sender, e);
                 * FP.ucRegistroP2.txtBuscarP.Text = this.txtExpediente.Text;
                 * FP.ucRegistroP2.btnBuscarP_Click(sender, e);*/
            }
        }
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (dgvResultadoBusquedaP.SelectedRows.Count == 1)
            {
                try
                {
                    //manipulable.manipular();

                    /*FP.btnAgregarPaciente_Click(sender, e);
                     * FP.ucRegistroP2.txtBuscarP.Text = dgvResultadoBusquedaP.SelectedRows[0].Cells["colNoExp"].Value.ToString();
                     * FP.ucRegistroP2.btnBuscarP_Click(sender, e);*/
                }
                catch (Exception error)
                {
                    MessageBox.Show(error.Message.ToString());
                }
            }
            else
            {
                ErrorDatos.SetError(btnEditar, "No ha elegido \nningun Pacinte");
            }
        }
Exemplo n.º 5
0
 private void txtNombre_TextChanged(object sender, EventArgs e)
 {
     ErrorDatos.SetError(txtNombre, "");
 }
Exemplo n.º 6
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txtNombre.Text.Equals(""))
            {
                ErrorDatos.SetError(txtNombre, "Ingrese Nombre");
                this.DialogResult = DialogResult.None;
                return;
            }
            else
            {
                ErrorDatos.SetError(txtNombre, "");
            }

            if (txtDireccion.Text.Equals(""))
            {
                ErrorDatos.SetError(txtDireccion, "Ingrese Dirección");
                this.DialogResult = DialogResult.None;
                return;
            }
            else
            {
                ErrorDatos.SetError(txtDireccion, "");
            }
            string   id            = txtid.Text;
            string   nombre        = txtNombre.Text;
            int      idTipoCine    = int.Parse(cboTipoCine.SelectedValue.ToString());
            string   direccion     = txtDireccion.Text;
            DateTime fechaApertura = txtFechaApertura.Value;

            if (accion.Equals("Nuevo"))
            {
                int nveces = (bd.CINE.Where(p => p.NOMBRE.Equals(txtNombre.Text))).Count();
                if (nveces > 0)
                {
                    MessageBox.Show("Ya existe el cine");
                    return;
                }
                CINE ocine = new CINE()
                {
                    NOMBRE        = nombre,
                    IDTIPOCINE    = idTipoCine,
                    DIRECCION     = direccion,
                    FECHAAPERTURA = fechaApertura,
                    BHABILITADO   = 1
                };
                bd.CINE.InsertOnSubmit(ocine);
                try
                {
                    bd.SubmitChanges();
                    MessageBox.Show("Se agrego correctamente!");
                }
                catch (Exception)
                {
                    MessageBox.Show("Ocurrio un error");
                }
            }
            else
            {
                var consulta = bd.CINE.Where(p => p.IDCINE.Equals(id));
                foreach (CINE ocine in consulta)
                {
                    ocine.NOMBRE        = nombre;
                    ocine.IDTIPOCINE    = idTipoCine;
                    ocine.DIRECCION     = direccion;
                    ocine.FECHAAPERTURA = fechaApertura;
                }
                try
                {
                    bd.SubmitChanges();
                    MessageBox.Show("Se edito correctamente");
                }
                catch (Exception)
                {
                    MessageBox.Show("Ocurrio un error");
                }
            }
        }
 private void txtBuscarP_TextChanged(object sender, EventArgs e)
 {
     ErrorDatos.SetError(btnBuscarPaciente, "");
 }