private void setDeliveryBoy() { if (check == 0) { StreamReader reader = new StreamReader(@"DeliveryBoy.csv"); while (!reader.EndOfStream) { string line = reader.ReadLine(); if (!String.IsNullOrWhiteSpace(line)) { string[] values = line.Split(','); boy.Enque(new DeliveryBoy(int.Parse(values[0]), values[1].ToString(), values[2].ToString())); } } check = -1; } else if (boy.UnderFlow()) { DBoy.Text = "No DeliveryBoy Present at The Moment"; return; } DeliveryBoy temp = boy.Deque(); DBoy.Text = temp.getName(); receiver = temp.getEmail(); }
private void button1_Click(object sender, EventArgs e) { insertBoy = insertBoy.GetData(int.Parse(id.Text)); if (insertBoy == null) { MessageBox.Show("Incorrect Id"); } else { BoyName.Text = insertBoy.getName(); Email.Text = insertBoy.getEmail(); } }