Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            String selecion = dataGridView1.CurrentCell.Value.ToString();

            int i;

            if (selecion == "")
            {
                MessageBox.Show("No se puede");
            }
            else
            {
                if (!int.TryParse(selecion, out i))
                {
                    MessageBox.Show("SOLO NUMERO ENTEROS");
                }
                else
                {
                    localhost.Service ser = new localhost.Service();

                    //LLAMAR METODO DEL SERVICE
                    ser.Borra_Registro(selecion);

                    MessageBox.Show("HECHO");

                    CRUD frm_principal = new CRUD();

                    actualizar_tabla();
                }
            }
        }
Beispiel #2
0
        public void actualizar_tabla()
        {
            localhost.Service ser = new localhost.Service();
            DataSet           dt  = new DataSet();

            dt = ser.Obtener_Todo();
            dataGridView1.DataSource = dt.Tables[0];
        }
Beispiel #3
0
        public CRUD()
        {
            InitializeComponent();

            localhost.Service ser = new localhost.Service();
            DataSet           dt  = new DataSet();

            dt = ser.Obtener_Todo();
            dataGridView1.DataSource = dt.Tables[0];
            dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick);
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            String v_tB1 = textBox1.Text.ToString();

            NumA = double.Parse(v_tB1);
            String v_tB2 = textBox2.Text.ToString();

            flag = v_tB2;
            String v_tB3 = textBox3.Text.ToString();

            NumB = double.Parse(v_tB3);
            localhost.Service web = new localhost.Service();

            /*
             * switch (flag)
             * {
             * case "+":
             *  NumC=web.addition(NumA, NumB);
             *  break;
             * case "-":
             *  NumC = web.subtract(NumA, NumB);
             *  break;
             *  case "*":
             *  NumC = web.multiplication(NumA, NumB);
             *  break;
             *  case "/":
             *  //NumC=NumA/NumB;
             *  NumC = web.division(NumA, NumB);
             *  break;
             *
             * }
             */
            if (flag.Equals("+"))
            {
                NumC = web.addition(NumA, NumB);
            }
            else if (flag.Equals("-"))
            {
                NumC = web.subtract(NumA, NumB);
            }
            else if (flag.Equals("*"))
            {
                NumC = web.multiplication(NumA, NumB);
            }
            else if (flag.Equals("/"))
            {
                NumC = web.division(NumA, NumB);
            }
            textBox4_TextChanged(sender, e);
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            int selecion_combo_plantel = comboBox_plantel.SelectedIndex;
            int selecion_combo_carrera = comboBox_carrera.SelectedIndex;

            int i;

            if (!int.TryParse(matricula.Text, out i))
            {
                MessageBox.Show("Error , Matricula Incorrecta");
                matricula.Focus();
            }
            else if (nombre.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                nombre.Focus();
            }
            else if (p_apellido.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                p_apellido.Focus();
            }
            else if (s_apellido.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                s_apellido.Focus();
            }
            else if (semestre.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                semestre.Focus();
            }
            else if (direccion.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                direccion.Focus();
            }
            else if (correo.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                correo.Focus();
            }
            else if (correo.Text == "@example.com")
            {
                MessageBox.Show("Por favor ingrese su correo");
                correo.Focus();
            }
            else if (telefono.Text == "")
            {
                MessageBox.Show("No debe haber campos vacios");
                telefono.Focus();
            }
            else if (selecion_combo_plantel == -1)
            {
                MessageBox.Show("Debe selecionar uno de la lista");
                comboBox_plantel.Focus();
            }
            else if (selecion_combo_carrera == -1)
            {
                MessageBox.Show("Debe selecionar uno de la lista");
                comboBox_carrera.Focus();
            }
            else
            {
                localhost.Service ser              = new localhost.Service();
                String            Fecha            = dateTimePicker1.Value.Year.ToString() + "-" + dateTimePicker1.Value.Month.ToString() + "-" + dateTimePicker1.Value.Day.ToString();
                String            selecion_plantel = comboBox_plantel.SelectedItem.ToString();
                String            selecion_carrera = comboBox_carrera.SelectedItem.ToString();

                //LLAMAR METODO DEL SERVICE
                ser.Actualizar(matricula.Text, nombre.Text, p_apellido.Text, s_apellido.Text, Fecha, selecion_plantel, selecion_carrera, semestre.Text, direccion.Text, correo.Text, telefono.Text);

                //PONER TEXTBOX VACIOS
                // matricula.Text = "";
                //nombre.Text = "";
                //p_apellido.Text = "";
                // s_apellido.Text = "";


                MessageBox.Show("HECHO");

                this.Close();
                CRUD frm_principal = new CRUD();
                frm_principal.Refresh();
            }
        }
Beispiel #6
0
 public actulizar()
 {
     InitializeComponent();
     localhost.Service ser = new localhost.Service();
     MessageBox.Show("Actulizar Datos Estudiante Ingrese Matricula");
 }
Beispiel #7
0
        private void button3_Click(object sender, EventArgs e)
        {
            localhost.Service ser = new localhost.Service();

            //LLAMAR METODO DEL SERVICE
        }