Пример #1
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            PanelMain.Hide();
            WebMaps.Hide();
            PanelSearch.Show();
            PnlBg.Hide();
            BtnCari.Hide();
            DTPicker.Hide();
            TxtCari.Focus();
            PnlTxt.Show();
            DGView.Show();
            BtnBTempat.Image = global::Retakan.Properties.Resources.tempat_on;
            BtnBWaktu.Image  = global::Retakan.Properties.Resources.waktu_off;
            BtnTerkini.Image = global::Retakan.Properties.Resources.terkini_off;
            BtnMaps.Image    = global::Retakan.Properties.Resources.peta_off;
            BtnSearch.Image  = global::Retakan.Properties.Resources.cari_on;

            //insert
            koneksiObj.Open();
            SqlDataAdapter adapter = new SqlDataAdapter();
            string         sql     = null;

            sql = "insert into DataGempa (gempa,tempat,waktu,tsunami) values('" + C.mag + "','" + C.place + "','" + C.time.ToString("MM/dd/yyy hh:mm:ss") + "','" + C.tsunami + "')";
            try
            {
                adapter.InsertCommand = new SqlCommand(sql, koneksiObj);
                adapter.InsertCommand.ExecuteNonQuery();

                koneksiObj.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("ex" + ex);
            }
        }
Пример #2
0
 private void BtnBTempat_Click(object sender, EventArgs e)
 {
     PnlBg.Hide();
     BtnCari.Hide();
     DTPicker.Hide();
     DGView.Show();
     PnlTxt.Show();
     TxtCari.Focus();
     BtnBTempat.Image = global::Retakan.Properties.Resources.tempat_on;
     BtnBWaktu.Image  = global::Retakan.Properties.Resources.waktu_off;
 }