private void FillProjectData() { if (project == null) { project = new project(); project.id = Guid.NewGuid(); } txtID.Text = project.id.ToString(); txtName.Text = project.name; txtHourlyRate.Text = project.hourlyrate.ToString(); IEnumerable <client> clientList = entities.clients.ToList(); cmbClient.DataSource = clientList; cmbClient.DisplayMember = "clientname"; cmbClient.SelectedItem = project.client; if (entities.projects.Find(project.id) == null) { entities.projects.Add(project); } }
public frmProject() { InitializeComponent(); project = new project(); FillProjectData(); }