예제 #1
0
        public FormaSalida()
        {
            InitializeComponent();
            salida = new RegSalida();

            strConexion = "server=" + cxml.Text("ACUANET/BD/SBD_ip", "127.0.0.1")
               + ";uid=" + cxml.Text("ACUANET/BD/SBD_usuario", "root")
               + ";pwd=" + cxml.Text("ACUANET/BD/SBD_passwd", "")
               + ";database=" + cxml.Text("ACUANET/BD/SBD_bdn", "ntritondb");

            modo = new ModOleada(strConexion);
            this.cb_categoriaO.DataSource = modo.obtenDTC();

            this.cb_categoriaO.DisplayMember = "nombre";
            this.cb_categoriaO.ValueMember = "nombre";
            this.dgb_Oleada.DataSource = modo.obtenSalida().Tables[0].DefaultView;
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List<string> lista_cat = new List<string>();

            foreach (Object selecteditem in listBox1.SelectedItems)
            {
                DataRowView dr = (DataRowView)selecteditem;
                lista_cat.Add(dr["nombre"].ToString());
            }

            ModOleada modol = new ModOleada(strConexion);

               if
               ( modol.crearOleada(this.textBox1.Text, lista_cat))

            {
                MessageBox.Show("Se creo correctamente la Oleada", "Notificacioon", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("No se creo la Oleada", "Notificacioon", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }