Ejemplo n.º 1
0
        private void Harita_MouseClick(object sender, MouseEventArgs e)
        {
            if (checkBox3.Checked == true)
            {
                mouseX = e.X;
                mouseY = e.Y;
                Graphics g;
                Pen      whitePen = new Pen(Color.Blue, 2);

                Rectangle rect = new Rectangle(mouseX, mouseY, 10, 10);
                g = Harita.CreateGraphics();
                g.DrawEllipse(whitePen, rect);

                Harita.CreateGraphics();

                DosyaYaz(mouseX, mouseY);
                g.DrawLine(Pens.DarkBlue, checkBox1.Location, checkBox2.Location);
            }
            //else MessageBox.Show("checbox'a  tıkla");



            Point point = this.PointToClient(Cursor.Position);

            if (point.X >= 100 && point.X <= 110 && point.Y >= 100 && point.Y <= 110)
            {
                MessageBox.Show(point.ToString() + "  market 1");
            }
            //p++;//dire saymak için
        }
Ejemplo n.º 2
0
        public ActionResult Iletisim(Harita p)
        {
            var eski = db.Harita.Find(p.HaritaID);

            eski.Frame = p.Frame;
            db.SaveChanges();
            TempData["harita"] = " ";
            return(RedirectToAction("Iletisim", "Admin"));
        }
Ejemplo n.º 3
0
        private void ListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listView.SelectedItems.Count <= 0)
            {
                return;
            }

            string enlem  = listView.SelectedItems[0].SubItems[1].Text;
            string boylam = listView.SelectedItems[0].SubItems[2].Text;

            Harita harita = new Harita();

            harita.Ac(enlem, boylam);
        }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            //CheckBox c = new CheckBox();
            Graphics g;
            Pen      whitePen = new Pen(Color.Blue, 2);

            Rectangle rect = new Rectangle(100, 100, 10, 10);

            g = Harita.CreateGraphics();
            //c.Location = new Point(100,100);
            //Harita.Controls.Add(c);

            g.DrawEllipse(whitePen, rect);


            Harita.CreateGraphics();
        }
Ejemplo n.º 5
0
        public ActionResult GaleriGuncelle(Harita p)
        {
            var eski = db.Harita.Find(p.HaritaID);

            if (Request.Files.Count >= 1 && p.Frame != null)
            {
                string dosyaAdi = Path.GetFileName(Request.Files[0].FileName);
                string uzanti   = Path.GetExtension(Request.Files[0].FileName);
                string yol      = "~/galeri/" + dosyaAdi + uzanti;
                Request.Files[0].SaveAs(Server.MapPath(yol));
                p.Frame = "/galeri/" + dosyaAdi + uzanti;

                eski.Frame         = p.Frame;
                TempData["galeri"] = " ";
            }


            db.SaveChanges();

            return(RedirectToAction("Galeri", "Admin"));
        }
Ejemplo n.º 6
0
        public void ShowMap()
        {
            var plant = new herbariumEntities().plant.Find(Convert.ToInt32(dtgDataView.CurrentRow.Cells[0].Value));

            if (plant != null && !string.IsNullOrEmpty(plant.coordinates))
            {
                foreach (var item in Login.tabbedApp.Tabs)
                {
                    if (item.Caption == "Harita " + plant.coordinates)
                    {
                        Login.tabbedApp.SelectedTab = item;
                        return;
                    }
                }
                var form = new Harita($"https://www.google.com/maps/search/{plant.coordinates}/");
                form.Text = "Harita " + plant.coordinates;
                Login.tabbedApp.Tabs.Add(new EasyTabs.TitleBarTab(Login.tabbedApp)
                {
                    Content = form
                });
                Login.tabbedApp.SelectedTabIndex = Login.tabbedApp.Tabs.Count - 1;
            }
        }
Ejemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataSet cityDS = new DataSet();

            cityDS.ReadXml("C:\\Users\\Kadir\\Documents\\Visual Studio 2017\\Project\\GezginAliciProblem.UI\\GezginAliciProblem\\MarketList.xml"); // filename ile alınan xml dosyası okunur.
            DataRowCollection cities   = cityDS.Tables[0].Rows;
            Rectangle         recteski = new Rectangle(160, 370, 10, 10);

            foreach (DataRow city in cities)
            {
                listBox1.Items.Add(city["X"]);
                listBox1.Items.Add(city["Y"]);
                mouseX = Convert.ToInt16(city["X"]);
                mouseY = Convert.ToInt16(city["Y"]);
                Graphics g;
                Pen      whitePen = new Pen(Color.Blue, 2);

                Rectangle rect = new Rectangle(mouseX, mouseY, 10, 10);
                g = Harita.CreateGraphics();
                g.DrawEllipse(whitePen, rect);


                Harita.CreateGraphics();

                g.DrawLine(Pens.DarkRed, rect.Location, recteski.Location);

                int    x1     = rect.X;
                int    y1     = rect.Y;
                int    x2     = recteski.X;
                int    y2     = recteski.Y;
                double s      = (x2 - x1);
                double s1     = (y2 - y1);
                double sonuc1 = Math.Sqrt(Math.Pow(s, 2) + Math.Pow(s1, 2));
                listBox2.Items.Add(sonuc1);
                recteski = rect;
            }
        }