Ejemplo n.º 1
0
 public Form_genericAddRemove(Connector conn, string titulo, string sqlStringAdd, string sqlStringRemove, UltraComboEditor comboBox, UltraComboEditor idParticipants, Form_main formMain, Form_modifyEvent formModify, bool b)
 {
     InitializeComponent();
     this.Text            = titulo;
     this.conn            = conn;
     this.sqlStringAdd    = sqlStringAdd;
     this.sqlStringRemove = sqlStringRemove;
     this.comboBox        = comboBox;
     this.idParticipants  = idParticipants;
     this.formMain        = formMain;
     this.formModify      = formModify;
     this.b           = b;
     formMain.Enabled = false;
 }
Ejemplo n.º 2
0
        /*************************************************************************************************************************************************************/

        private void btnModificar_Click(object sender, EventArgs e)
        {
            ArrayList evento = getSelectedItem(this.dataGridView_Eventos);

            if (SelectedItems)
            {
                string idEvento = null;
                this.formMain.Enabled = false;
                if (evento.Count > 0)
                {
                    sqlString = "select id from [SACMEDB].[dbo].[event] where name = '" + evento[0] + "' and [SACMEDB].[dbo].[event].[description] = '" + evento[1] + "'";
                    try
                    {
                        DR = SqlManager.getQuery(sqlString, conn);
                        if (DR != null)
                        {
                            while (DR.Read())
                            {
                                idEvento = DR["id"].ToString();
                            }
                        }
                        DR.Close();
                    }
                    catch (DbException ex)
                    {
                        MessageBox.Show("No se pudo Obtener el Id del Evento:\n " + ex);
                    }
                    formMain.Enabled = false;
                    Form_modifyEvent modify = new Form_modifyEvent(idEvento, formMain, this, DR, conn);
                    modify.Show();
                }
                else
                {
                    MessageBox.Show("No se encontró el evento a buscar:\n ");
                }
            }
        }