My code:
Dble click
ViewClientProfile cliFrm = new ViewClientProfile(); cliFrm.ShowDialog();
/****************************************************************************************************** * Module: Client tab * Author: Turki Aljudai * Date: Nov 30, 2015 * Inputs: system * * Outputs: clients data * * Description: This source code should display clients data on the listbox and also functioning * all the buttons ( search , print list, add/delete, view profile, and refresh). ******************************************************************************************************/ List<string> list = new List<string>();
string filename = "C:\\Users\\Turki\\Documents\\Workspace\\INFO 1112\\JobMaster\\Data Files\\clients.csv";
string whole_file = System.IO.File.ReadAllText(filename);
// Split into lines. whole_file = whole_file.Replace('\n', '\r'); string[] lines = whole_file.Split(new char[] { '\r' }, StringSplitOptions.RemoveEmptyEntries);
// See how many rows and columns there are. arrStringClients = new string[lines.Length - 1]; for (int i = 1; i < lines.Length; i++) { arrStringClients[i - 1] = lines[i]; }
clientsListBox.Items.Clear();
for (int i = 0; i < arrStringClients.Length; i++) { Clients.Items.Add(Client.Extract(arrStringClients[i])); clientsListBox.Items.Add(Clients.Items[Clients.Items.Count - 1].Id + " | " + Clients.Items[Clients.Items.Count - 1].CompanyName); }