Esempio n. 1
0
        public CadastrarTurmaWindow()
        {
            InitializeComponent();
            NCurso c = new NCurso();

            box.ItemsSource = c.Listar();
        }
Esempio n. 2
0
        public CadastrarMatrizWindow()
        {
            InitializeComponent();
            NCurso nc = new NCurso();

            boxCurso.ItemsSource = nc.Listar();
            NDisciplina nd = new NDisciplina();

            boxDisciplina.ItemsSource = nd.Listar();
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult Opcion;
                Opcion = MessageBox.Show("Realmente Desea Eliminar los Registros", "Sistema de Ventas", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                if (Opcion == DialogResult.OK)
                {
                    string Codigo;
                    string Rpta = "";

                    foreach (DataGridViewRow row in dataGridView1.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells[0].Value))
                        {
                            Codigo = Convert.ToString(row.Cells[1].Value);
                            Rpta   = NCurso.Eliminar(Convert.ToInt32(Codigo));

                            if (Rpta.Equals("OK"))
                            {
                                this.mensajeok("Se Eliminó Correctamente el registro");
                            }
                            else
                            {
                                this.mensajeerror(Rpta);
                            }
                        }
                    }
                    this.buscarnombre();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Esempio n. 4
0
        private void buscarnombre()
        {
            this.dataGridView1.DataSource = NCurso.buscarnombre(this.txtbuscar.Text);

            label10.Text = "Total de Registros: " + Convert.ToString(dataGridView1.Rows.Count);
        }
Esempio n. 5
0
 private void Mostrar()
 {
     this.dataGridView1.DataSource = NCurso.Mostrar();
     this.OcultarColumnas();
     label10.Text = "Total de Registros: " + Convert.ToString(dataGridView1.Rows.Count);
 }
Esempio n. 6
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                string rpta = "";
                if (this.txtnombre.Text == string.Empty)
                {
                    mensajeerror("Falta ingresar algunos datos, serán remarcados");

                    if (this.txtnombre.Text.Length == 0)
                    {
                        errorProvider1.SetError(this.txtnombre, "ingrese una Nombre");
                    }
                    else
                    {
                        errorProvider1.SetError(this.txtnombre, "");
                    }

                    if (this.textBox2.Text.Length == 0)
                    {
                        errorProvider1.SetError(this.textBox2, "ingrese una Nombre");
                    }
                    else
                    {
                        errorProvider1.SetError(this.textBox2, "");
                    }

                    if (this.comboBox1.Text.Length == 0)
                    {
                        errorProvider1.SetError(this.comboBox1, "ingrese una Nombre");
                    }
                    else
                    {
                        errorProvider1.SetError(this.comboBox1, "");
                    }
                }
                else
                {
                    if (this.isnuevo)
                    {
                        rpta = NCurso.Insertar(this.txtnombre.Text.Trim().ToUpper(), comboBox1.Text, textBox2.Text);
                    }
                    else
                    {
                        rpta = NCurso.Editar(Convert.ToInt32(this.txtiddamnificado.Text), this.txtnombre.Text.Trim().ToUpper(), comboBox1.Text, textBox2.Text);
                    }

                    if (rpta.Equals("OK"))
                    {
                        if (this.isnuevo)
                        {
                            this.mensajeok("Se Insertó de forma correcta el registro");
                        }
                        else
                        {
                            this.mensajeok("Se Actualizó de forma correcta el registro");
                        }
                    }
                    else
                    {
                        this.mensajeerror(rpta);
                    }

                    this.isnuevo  = false;
                    this.iseditar = false;
                    this.botones();
                    this.Limpiar();
                    this.buscarnombre();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }