public ViewGeneralGoalForm(GeneralGoal goal) { InitializeComponent(); this.GoalNameLabel.Text = goal.Title; this.DateBox.Text = goal.getDateString(); this.dscp_box.Text = goal.Description; this.userBox.Text = goal.DocUser.Firstname + " " + goal.DocUser.Lastname; this.progress_label.Text = goal.getProgress().ToString(); attachmentPanel1.populate(goal.attachments); attachmentPanel1.ViewMode = true; }
private void selectBtn_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { try { String contStr = convert(conBox.Text.Trim()); cont = Convert.ToInt32(contStr); String name = (string)dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value; goal = GeneralGoalStorage.getInstance().all().Find(x => x.Title.Equals(name)); this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception e1) { MessageBox.Show(new IncompleteFormException().Message); } } }