コード例 #1
0
        public void EliminarAlumno(Guid guid)
        {
            //ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client("Http");
            ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client();

            bool result = svc.Delete(guid);

            if (result == true)
            {
                //GetAllByProtocol("Http");
                GetAllByProtocol();
            }
        }
コード例 #2
0
        //public void GetAllByProtocol(string protocol)
        public void GetAllByProtocol()
        {
            dgv_grid.DataSource = null;
            dgv_grid.Rows.Clear();
            dgv_grid.Columns.Clear();
            dgv_grid.Refresh();

            //ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client(protocol);
            ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client();

            // Rellenar Grid
            List <Alumno> listaAlumnos = svc.GetAll();

            dgv_grid.DataSource = listaAlumnos;

            AñadirButtons(dgv_grid);
        }
コード例 #3
0
        public void click_añadir(object sender, EventArgs e)
        {
            //ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client("Http");
            ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client();

            Alumno alumnoNuevo = new Alumno {
                Guid = Guid.NewGuid(), Nombre = tb_nombre.Text, Apellidos = tb_apellido.Text, Dni = tb_dni.Text
            };

            Alumno alumnoRegistrado = svc.Post(alumnoNuevo);

            if (alumnoRegistrado != null && OnAdd != null)
            {
                OnAdd(this, e);
            }

            Close();
        }
コード例 #4
0
        private void click_editar(object sender, EventArgs e)
        {
            //ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client("Http");
            ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client();

            Alumno alumnoNuevo = new Alumno {
                Guid = Guid.Parse(tb_guid.Text), Nombre = tb_nombre.Text, Apellidos = tb_apellido.Text, Dni = tb_dni.Text
            };

            Alumno alumnoModificado = svc.Put(Guid.Parse(tb_guid.Text), alumnoNuevo);

            if (alumnoModificado != null && OnEdit != null)
            {
                OnEdit(this, e);
            }

            Close();
        }
コード例 #5
0
        private void click_Buscar(object sender, EventArgs e)
        {
            dgv_grid.DataSource = null;
            dgv_grid.Rows.Clear();
            dgv_grid.Columns.Clear();
            dgv_grid.Refresh();

            //ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client("Http");
            ReferenciaWeb.Service1Client svc = new ReferenciaWeb.Service1Client();

            Alumno alumnoEntontrado = svc.GetByGuid(Guid.Parse(tb_guid.Text));

            string[] row = new string[] {
                alumnoEntontrado.Apellidos,
                alumnoEntontrado.Dni,
                alumnoEntontrado.Guid.ToString(),
                alumnoEntontrado.Nombre
            };

            dgv_grid.DataSource = row;
            AñadirButtons(dgv_grid);
        }