Example #1
0
        private void btn_eliminate_Click(object sender, EventArgs e)
        {
            Tanda_Laboral delVehi = new Tanda_Laboral();

            deleteData();
            Refresh();
            MessageBox.Show("Borrado efectivo");
        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Tanda_Laboral tipo = new Tanda_Laboral();

            updateData(tipo, index);
            button1.Visible = false;
            button3.Visible = true;
            MessageBox.Show("Actualizado");
            Refresh();
        }
Example #3
0
        private void updateData(Tanda_Laboral vehicle, int index)
        {
            if (string.IsNullOrEmpty(txtDescription.Text))
            {
                MessageBox.Show("Completar Información");
                return;
            }
            else
            {
                int Item        = Int32.Parse(dataGridView1[0, index].Value.ToString());
                var updateTanda = (from a in bd.Tanda_Laboral
                                   select a).Where(m => m.Id_TandaLaboral.Equals(Item)).SingleOrDefault();

                updateTanda.Descripcion = txtDescription.Text;
                bd.SaveChanges();
                txtDescription.Clear();

                this.loadData();
            }
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            var workorder = new Tanda_Laboral();

            if (txtDescription.Text != "")
            {
                workorder.Descripcion = txtDescription.Text;
                bd.Tanda_Laboral.Add(workorder);
                bd.SaveChanges();
                loadData();
                txtDescription.Clear();
            }
            if (txtDescription.Text == workorder.Descripcion)
            {
                MessageBox.Show("Favor insertar otra descripción");
            }
            else
            {
                MessageBox.Show("Este campo es requerido");
            }
        }