public EditProjectPageControl(FormMain form, int?curUserProjectID) { InitializeComponent(); formMain = form; _curUserProjectID = curUserProjectID; if (formMain.UsersAccounts.GetCurrentUser() != null) { DataBaseAccess dataBase = new DataBaseAccess(); dataBase.StartConnection(); _curUserProject = dataBase.getProject((int)curUserProjectID); dataBase.CloseConnection(); if (curUserProjectID == null || _curUserProject == null) { MessageBox.Show("Error: Asset Not Found"); } else { txtTitle.Text = _curUserProject.GetProjectTitle(); cboProjectType.SelectedIndex = (int)_curUserProject.GetProjectType(); txtNotes.Text = _curUserProject.GetNotes(); picThumbnail.ImageLocation = _curUserProject.GetThumbNail(); _userProject.SetProjectTitle(_curUserProject.GetProjectTitle()); _userProject.SetProjectType(_curUserProject.GetProjectType()); _userProject.SetNotes(_curUserProject.GetNotes()); } } else { MessageBox.Show("Error: No user logged in"); } }
private void TextInput(object sender, EventArgs e) { if (((TextBox)sender) == txtTitle) { _userProject.SetProjectTitle(txtTitle.Text); } else if (((TextBox)sender) == txtNotes) { _userProject.SetNotes(txtNotes.Text); } txt_Leave(sender, e); }