Beispiel #1
0
 public Form4(AdsModel ad)
 {
     InitializeComponent();
     textBox1.Text           = ad.title;
     comboBox1.SelectedIndex = ad.status - 1;
     textBox2.Text           = ad.price.ToString();
     comboBox2.SelectedIndex = ad.currency - 1;
     comboBox3.SelectedIndex = ad.type - 1;
     textBox3.Text           = ad.area.ToString();
     richTextBox1.Text       = ad.description;
     textBox4.Text           = ad.lang.ToString();
     textBox5.Text           = ad.lat.ToString();
     gMap(ad);
 }
Beispiel #2
0
        void gMap(AdsModel ad)
        {
            gmaps.MapProvider            = GMap.NET.MapProviders.GoogleMapProvider.Instance;
            GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
            gmaps.DragButton             = MouseButtons.Left;
            gmaps.ShowCenter             = false;
            GMapOverlay markers = new GMapOverlay("markers");

            gmaps.Position = new GMap.NET.PointLatLng(ad.lat, ad.lang);
            GMapMarker marker = new GMarkerGoogle(
                new PointLatLng(ad.lat, ad.lang),
                GMarkerGoogleType.orange_dot);

            markers.Markers.Add(marker);
            gmaps.Overlays.Add(markers);
        }
Beispiel #3
0
        private void detailsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AdsModel ad = new AdsModel(
                int.Parse(dgwAds.SelectedRows[0].Cells[0].Value.ToString()),
                dgwAds.SelectedRows[0].Cells[1].Value.ToString(),
                int.Parse(dgwAds.SelectedRows[0].Cells[2].Value.ToString()),
                int.Parse(dgwAds.SelectedRows[0].Cells[3].Value.ToString()),
                int.Parse(dgwAds.SelectedRows[0].Cells[4].Value.ToString()),
                dgwAds.SelectedRows[0].Cells[5].Value.ToString(),
                int.Parse(dgwAds.SelectedRows[0].Cells[6].Value.ToString()),
                int.Parse(dgwAds.SelectedRows[0].Cells[7].Value.ToString()),
                float.Parse(dgwAds.SelectedRows[0].Cells[8].Value.ToString()),
                float.Parse(dgwAds.SelectedRows[0].Cells[9].Value.ToString()));
            Form4 form4 = new Form4(ad);

            form4.Show();
        }
Beispiel #4
0
        private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AdsModel ad = new AdsModel(
                int.Parse(dgwAds.SelectedRows[0].Cells[0].Value.ToString()),
                dgwAds.SelectedRows[0].Cells[1].Value.ToString(),
                int.Parse(dgwAds.SelectedRows[0].Cells[2].Value.ToString()),
                int.Parse(dgwAds.SelectedRows[0].Cells[3].Value.ToString()),
                int.Parse(dgwAds.SelectedRows[0].Cells[4].Value.ToString()),
                dgwAds.SelectedRows[0].Cells[5].Value.ToString(),
                int.Parse(dgwAds.SelectedRows[0].Cells[6].Value.ToString()),
                int.Parse(dgwAds.SelectedRows[0].Cells[7].Value.ToString()),
                float.Parse(dgwAds.SelectedRows[0].Cells[8].Value.ToString()),
                float.Parse(dgwAds.SelectedRows[0].Cells[9].Value.ToString())
                );
            Form2 form2 = new RealtyInterface.Form2(true, ad);

            form2.Show();
        }
Beispiel #5
0
        private void gmap_OnMarkerClick(GMapMarker item, MouseEventArgs e)
        {
            AdsModel ad = new AdsModel();

            dgwDetails.DataSource = dal.getDataTable("Select * FROM Ads WHERE Id = @ID; ", int.Parse(item.Tag.ToString()));
            ad.id          = int.Parse(dgwDetails.Rows[0].Cells["Id"].Value.ToString());
            ad.title       = dgwDetails.Rows[0].Cells["Title"].Value.ToString();
            ad.lang        = float.Parse(dgwDetails.Rows[0].Cells["Long"].Value.ToString());
            ad.lat         = float.Parse(dgwDetails.Rows[0].Cells["Lat"].Value.ToString());
            ad.price       = int.Parse(dgwDetails.Rows[0].Cells["Price"].Value.ToString());
            ad.status      = int.Parse(dgwDetails.Rows[0].Cells["Status"].Value.ToString());
            ad.type        = int.Parse(dgwDetails.Rows[0].Cells["Type"].Value.ToString());
            ad.currency    = int.Parse(dgwDetails.Rows[0].Cells["Currency"].Value.ToString());
            ad.area        = int.Parse(dgwDetails.Rows[0].Cells["Area"].Value.ToString());
            ad.description = dgwDetails.Rows[0].Cells["Description"].Value.ToString();
            Form4 form4 = new Form4(ad);

            form4.Show();
        }
Beispiel #6
0
 public Form2(bool state, AdsModel ad)
 {
     InitializeComponent();
     statee = state;
     add    = ad;
     if (state)
     {
         btnAdd.Text             = "Update";
         textBox1.Text           = ad.title;
         comboBox1.SelectedIndex = ad.status - 1;
         textBox2.Text           = ad.price.ToString();
         comboBox2.SelectedIndex = ad.currency - 1;
         comboBox3.SelectedIndex = ad.type - 1;
         textBox3.Text           = ad.area.ToString();
         richTextBox1.Text       = ad.description;
         textBox4.Text           = ad.lang.ToString();
         textBox5.Text           = ad.lat.ToString();
         this.Text = "Update Screen";
     }
 }