private void btn_drawhide_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty((from w in Global.Db.tbl_Point_Hides where w.fBatchName == txt_fBatchName.Text select w.fBatchName).FirstOrDefault() + "")) { MessageBox.Show("Tọa độ đã tồn tại vui lòng điền tên tọa độ khác!"); return; } if (string.IsNullOrEmpty(txt_fBatchName.Text)) { MessageBox.Show("Hãy nhập tên batch !"); return; } frm_DrawHide fd = new frm_DrawHide(); fd.fbatchname = txt_fBatchName.Text; fd.ShowDialog(); var a = (from w in Global.Db.GetBatch_ToaDo() select w.fBatchName).ToList(); a.Insert(0, ""); comboBox1.DataSource = a; comboBox1.DisplayMember = "fBatchName"; if (!string.IsNullOrEmpty((from w in Global.Db.tbl_Point_Hides where w.fBatchName == txt_fBatchName.Text select w.fBatchName).FirstOrDefault() + "")) { comboBox1.SelectedText = txt_fBatchName.Text; } }
private void btn_ShowPoint_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(comboBox1.Text)) { MessageBox.Show("Bạn chưa chọn tọa độ !"); return; } frm_DrawHide fd = new frm_DrawHide(); string fbatchPoint = comboBox1.Text; fd.fbatchname = fbatchPoint; fd.ShowDialog(); var a = (from w in Global.Db.GetBatch_ToaDo() select w.fBatchName).ToList(); a.Insert(0, ""); comboBox1.DataSource = a; comboBox1.DisplayMember = "fBatchName"; if (!string.IsNullOrEmpty((from w in Global.Db.tbl_Point_Hides where w.fBatchName == txt_fBatchName.Text select w.fBatchName).FirstOrDefault() + "")) { comboBox1.SelectedText = txt_fBatchName.Text; } }