Beispiel #1
0
        private void btnChiTiet_Click(object sender, EventArgs e)
        {
            DataRow row = gridView1.GetFocusedDataRow();
            frmChiTietCoSoTonGiao frm = new frmChiTietCoSoTonGiao();

            frm.txtIDCoSo.Text = row["IDCoSo"].ToString();
            frm.Show();
        }
        private void map_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            string x = map.CenterPoint.GetX().ToString();
            string y = map.CenterPoint.GetY().ToString();

            //chi lấy 3 số sau . để so sánh tọa đọ lấy được với tọa độ trong csdl
            string[] x1 = x.Split(',');
            x1[1] = x1[1].Substring(0, 3);
            x     = x1[0] + "." + x1[1];
            //textBox2.Text = x;
            string[] y1 = y.Split(',');
            y1[1] = y1[1].Substring(0, 3);
            y     = y1[0] + "." + y1[1];
            //textBox3.Text = y;
            //x:kinh do ,y:vi do:sau khi lay duoc thi tim ID Xa ->IDCoS0
            DataTable ds = wf.HienThiDSCoSo(",a.GioiThieu", " where a.ViDo like N'%" + y + "%' and a.KinhDo like N'%" + x + "%'");

            if (int.Parse(ds.Rows.Count.ToString()) == 1)
            {
                frmChiTietCoSoTonGiao frm = new frmChiTietCoSoTonGiao();
                frm.txtIDCoSo.Text = ds.Rows[0]["IDCoSo"].ToString();
                frm.Show();
            }
        }