コード例 #1
0
        public void Buscar()
        {
            AgendaBO   oAgendaBO      = new AgendaBO();
            CtrlAgenda oContactosCtrl = new CtrlAgenda();

            if (txtNombre.Text.Trim().Length != 0)
            {
                oAgendaBO.Nombre = txtNombre.Text.Trim();
            }
            if (txtApellidos.Text.Trim().Length != 0)
            {
                oAgendaBO.Apellidos = txtApellidos.Text.Trim();
            }
            if (txtEdad.Text.Trim().Length != 0)
            {
                oAgendaBO.Edad = txtEdad.Text.Trim();
            }
            if (txtTelefono.Text.Trim().Length != 0)
            {
                oAgendaBO.Telefono = txtTelefono.Text.Trim();
            }
            if (txtCorreo.Text.Trim().Length != 0)
            {
                oAgendaBO.CorreoElectronico = txtCorreo.Text.Trim();
            }

            dsReporte = oContactosCtrl.BusquedaContactos(oAgendaBO);
            dtgContactos.AutoGenerateColumns = false;
            dtgContactos.DataSource          = dsReporte.Tables[0];
        }
コード例 #2
0
        public void agregar()
        {
            string     fecha     = dtFechaActividad.Value.Day + "/" + dtFechaActividad.Value.Month + "/" + dtFechaActividad.Value.Year;
            AgendaBO   oAgendaBO = new AgendaBO();
            CtrlAgenda oServicio = new CtrlAgenda();

            oAgendaBO.IdContacto      = Convert.ToInt32(txtid.Text.Trim());
            oAgendaBO.NombreActividad = txtNombreA.Text.Trim();
            oAgendaBO.Descripcion     = txtDescripcion.Text.Trim();
            oAgendaBO.Lugar           = txtLugar.Text.Trim();
            oAgendaBO.FechanActividad = fecha;
            oServicio.creaA(oAgendaBO);
            MessageBox.Show("El Libro se guardo correctamete");
        }
コード例 #3
0
        public void BuscarAgenda(AgendaBO oAgendaBO)
        {
            //     AgendaBO AgendaBO = new AgendaBO();

            CtrlAgenda oCtrlAgenda = new CtrlAgenda();
            DataTable  dt          = oCtrlAgenda.BusquedaContactos(oAgendaBO).Tables[0];

            if (dt.Rows.Count != 0)
            {
                Destinatario    = dt.Rows[0]["CorreoElectronico"].ToString();
                txtMensaje.Text = dt.Rows[0]["CorreoElectronico"].ToString();
            }
            else
            {
                this.Close();
            }
        }
コード例 #4
0
        public void eliminar()
        {
            AgendaBO   oAgendaBO = new AgendaBO();
            CtrlAgenda Servicio  = new CtrlAgenda();

            oAgendaBO.IDActivida = Convert.ToInt32(txtIDactividad.Text.Trim());
            int i = Servicio.eliminaActividad(oAgendaBO);

            if (i == 1)
            {
                MessageBox.Show("Los datos se eliminaron correctamente");
            }
            else
            {
                MessageBox.Show("Los datos no se eliminaron, intenta de nuevo");
            }
        }
コード例 #5
0
        public void agregar()
        {
            string mensaje = "";

            if (txtNombre.Text.Trim().Length == 0)
            {
                mensaje = mensaje + "Introduce el Nombre \n";
            }
            if (txtApellidos.Text.Trim().Length == 0)
            {
                mensaje = mensaje + "Introduce el Apellidos \n";
            }
            if (txtCorreo.Text.Trim().Length == 0)
            {
                mensaje = mensaje + "Introduce el Correo Eléctronico \n";
            }
            if (txtTelefono.Text.Trim().Length == 0)
            {
                mensaje = mensaje + "Introduce la Teléfono \n";
            }
            if (txtEdad.Text.Trim().Length == 0)
            {
                mensaje = mensaje + "Introduce la del Contacto Edad \n";
            }


            if (mensaje.Trim().Length == 0)
            {
                string     fecha     = dtpFechaNacimiento.Value.Day + "/" + dtpFechaNacimiento.Value.Month + "/" + dtpFechaNacimiento.Value.Year;
                AgendaBO   oAgendaBO = new AgendaBO();
                CtrlAgenda oServicio = new CtrlAgenda();
                oAgendaBO.Nombre            = txtNombre.Text.Trim();
                oAgendaBO.Apellidos         = txtApellidos.Text.Trim();
                oAgendaBO.Edad              = txtEdad.Text.Trim();
                oAgendaBO.Telefono          = txtTelefono.Text.Trim();
                oAgendaBO.CorreoElectronico = txtCorreo.Text.Trim();
                oAgendaBO.FechaNacimiento1  = fecha;
                oServicio.creaContacto(oAgendaBO);
                MessageBox.Show("El Libro se guardo correctamete");
            }
            else
            {
                MessageBox.Show("Favor de ingresar los siguientes datos:\n" + mensaje);
            }
        }
コード例 #6
0
        public void BuscarAgenda(AgendaBO oAgendaBO)
        {
            //     AgendaBO AgendaBO = new AgendaBO();

            CtrlAgenda oCtrlAgenda = new CtrlAgenda();
            DataTable  dt          = oCtrlAgenda.BusquedaContactos(oAgendaBO).Tables[0];

            if (dt.Rows.Count != 0)
            {
                txtid.Text = dt.Rows[0]["IDagenda"].ToString();
            }
            else
            {
                this.Close();
            }
            oAgendaBO.IdContacto = Convert.ToInt32(txtid.Text.Trim());

            DataTable dtActividad = oCtrlAgenda.BusquedaAcctividad(oAgendaBO).Tables[0];

            dataGridView1.DataSource = dtActividad;
        }
コード例 #7
0
        public void BuscarAgenda(AgendaBO oAgendaBO)
        {
            //     AgendaBO AgendaBO = new AgendaBO();

            CtrlAgenda oCtrlAgenda = new CtrlAgenda();
            DataTable  dt          = oCtrlAgenda.BusquedaContactos(oAgendaBO).Tables[0];

            if (dt.Rows.Count != 0)
            {
                txtid.Text               = dt.Rows[0]["IDagenda"].ToString();
                txtNombre.Text           = dt.Rows[0]["Nombre"].ToString();
                txtApellidos.Text        = dt.Rows[0]["Apellidos"].ToString();
                txtEdad.Text             = dt.Rows[0]["Edad"].ToString();
                txtTelefono.Text         = dt.Rows[0]["Telefono"].ToString();
                txtCorreo.Text           = dt.Rows[0]["CorreoElectronico"].ToString();
                dtpFechaNacimiento.Value = Convert.ToDateTime(dt.Rows[0]["FechaNacimiento"].ToString());
            }
            else
            {
                this.Close();
            }
        }