private void btnConfirm_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("คุณต้องการที่จะสร้างพื้นที่ควบคุมสูงที่ตำแหน่งเหล่านี้ใช่หรือไม่", "อาณาเขต", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { //create a real polygon which is not a preview polygon PolygonManager.CreatePolygon(points); //Create an object to collect data of polygon var polygonData = new ObjectsManager.PolygonDataCollection(txtName.Text, points, polygon); string id = PolygonCollectionManager.GenerateId(); //Add to dict of polygon PolygonCollectionManager.Add(id, polygonData); //reset index value index = 1; //reset attributes Reset(); instanceMain.isRaClicked = false; instanceMain.SetPolygonFuncClick(false); instanceMain._pointsPoly.Clear(); } }
private void btnConfirm_Click(object sender, EventArgs e) { if (!this.CheckNull()) { MessageBox.Show("กรุณากรอกข้อมูลให้ครบถ้วน", "อาณาเขต", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { DialogResult dialogResult = MessageBox.Show("ยืนยันที่จะสร้างอาณาเขตนี้หรือไม่", "อาณาเขต", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { polygonManager.CreatePolygon(points); } polygonManager.isPreview = false; //polygonManager.CreateRealPoints(points); AddDataToCollection(txtName.Text, new List <PointLatLng>(main._pointsPoly), cmbStatusEx.SelectedItem.ToString(), "None", polygonManager.polygon); Reset(); main.SetPolygonFuncClick(false); this.isEdit = false; polygonManager.ClearIndex(); main._pointsPoly.Clear(); main.isRdClicked = false; } }