private void button1_Click(object sender, EventArgs e) { string phone = textBox1.Text; if (phone == "") { MessageBox.Show("Số Điện thoại trống"); } else { int temp = 0; CuocBIZ cuoc = new CuocBIZ(); var listsim = new SimDAO().GetListPhone(); foreach (var item in listsim) { if (phone == item.idSim) { temp += 1; } } if (temp == 0) { cuoc.AddSim(phone); MessageBox.Show("Lưu Sim thành công"); } else { MessageBox.Show("Số điện thoại đã tồn tại"); } } }
private void btn_cuocthang_Click(object sender, EventArgs e)// chưa xong { CuocBIZ c = new CuocBIZ(); BillDAO a = new BillDAO(); List <HoaDonCuoc> count = db.HoaDonCuocs.Select(b => b).ToList(); var q = a.ListTableBill(); if (q.Count == 0) { c.AddData(); } else { bill.DeletePayBill(); bill.DeleteBillInf(); bill.DeleteBill(); c.AddData(); } }