Exemplo n.º 1
0
 private void buttonModify_Click(object sender, EventArgs e)
 {
     try
     {
         if (idAgente != -1)
         {
             if (existEmptyFields() != true)
             {
                 connection.UpdateSet(tableName, idAgente.ToString(), generateStringValue("UPDATE"));
                 dataGridViewAgent.DataSource = connection.Refresh(tableName, "*");
                 cleanForm();
             }
             else
             {
                 MessageBox.Show("Es obligatorio llenar todos los campos");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("El RFC, E-mail y Telefono deben ser unicos \ny no se pueden repetir");
     }
 }
Exemplo n.º 2
0
 private void buttonModify_Click(object sender, EventArgs e)
 {
     try
     {
         if (idClient != -1)
         {
             if (existEmptyFields() != true)
             {
                 connection.UpdateSet(tableName, idClient.ToString(), generateStringValue("UPDATE"));
                 dataGridViewClient.DataSource = connection.Refresh(tableName, "*");
                 cleanForm();
             }
             else
             {
                 MessageBox.Show("Es OBLIGATORIO llenar todos los campos");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("El Celular tiene que ser unico\ny no se puede repetir.");
     }
 }
 private void buttonModify_Click(object sender, EventArgs e)
 {
     try
     {
         if (id != string.Empty)
         {
             if (verify_Fields())
             {
                 string values = string.Format("Nombre='{0}', Telefono='{1}', Domicilio='{2}', RazonSocial='{3}', Email='{4}'",
                                               textBoxName.Text, textBoxPhone.Text, textBoxResidency.Text, textBoxBusinessName.Text, textBoxEmail.Text);
                 connection.UpdateSet(tableName, id, values);
                 dataGridViewSuppliers.DataSource = connection.Refresh(tableName, "*");
             }
         }
         else
         {
             error_Message("Primero selecciones un elemento");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("El E-mail, Telefono y Razon Social deben ser unicos \ny no se pueden repetir");
     }
 }