コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public frmProject()
 {
     InitializeComponent();
     project = new project();
     FillProjectData();
 }