Пример #1
0
        private void btnInserir_Click(object sender, EventArgs e)
        {
            LatLong objLatLong = new LatLong();

            if (radAlterar.Checked)
            {
                if (txtDevice.Text != "" && txtDevice.Text != "" && txtLongitude.Text != "")
                {
                    objLatLong.Updade(txtDevice.Text, txtLatitude.Text, txtLongitude.Text);
                    MessageBox.Show("Updated data");
                }
                else
                {
                    MessageBox.Show("There are fields not filled");
                }
            }
            else if (radInserir.Checked)
            {
                if (txtDevice.Text != "" && txtDevice.Text != "" && txtLongitude.Text != "")
                {
                    objLatLong.Inserir(txtDevice.Text, txtLatitude.Text, txtLongitude.Text);
                    MessageBox.Show("Updated data");
                }
                else
                {
                    MessageBox.Show("There are fields not filled");
                }
            }
            else
            {
                if (txtDevice.Text != "" && txtDevice.Text != "" && txtLongitude.Text != "" && txtEmail.Text != "")
                {
                    objLatLong.Solicitar(txtDevice.Text, txtLatitude.Text, txtLongitude.Text, txtEmail.Text);
                    MessageBox.Show("Updated data");
                }
                else
                {
                    MessageBox.Show("There are fields not filled");
                }
            }
        }