public override bool Accept() { try { fTask.Priority = (GDMResearchPriority)fView.Priority.SelectedIndex; fTask.StartDate.Assign(GDMDate.CreateByFormattedStr(fView.StartDate.Text, true)); fTask.StopDate.Assign(GDMDate.CreateByFormattedStr(fView.StopDate.Text, true)); GDMGoalType gt = (GDMGoalType)fView.GoalType.SelectedIndex; switch (gt) { case GDMGoalType.gtIndividual: case GDMGoalType.gtFamily: case GDMGoalType.gtSource: fTask.Goal = GEDCOMUtils.EncloseXRef(fTempRec.XRef); break; case GDMGoalType.gtOther: fTask.Goal = fView.Goal.Text; break; } fLocalUndoman.Commit(); fBase.NotifyRecord(fTask, RecordAction.raEdit); return(true); } catch (Exception ex) { Logger.LogWrite("TaskEditDlgController.Accept(): " + ex.Message); return(false); } }
public void SelectGoal() { GDMGoalType gt = (GDMGoalType)fView.GoalType.SelectedIndex; switch (gt) { case GDMGoalType.gtIndividual: fTempRec = fBase.Context.SelectPerson(null, TargetMode.tmNone, GDMSex.svUnknown); fView.Goal.Text = GKUtils.GetGoalStr(gt, fTempRec); break; case GDMGoalType.gtFamily: fTempRec = fBase.Context.SelectRecord(GDMRecordType.rtFamily, new object[0]); fView.Goal.Text = GKUtils.GetGoalStr(gt, fTempRec); break; case GDMGoalType.gtSource: fTempRec = fBase.Context.SelectRecord(GDMRecordType.rtSource, new object[0]); fView.Goal.Text = GKUtils.GetGoalStr(gt, fTempRec); break; case GDMGoalType.gtOther: break; } }
public TaskEditDlgController(ITaskEditDlg view) : base(view) { fTempRec = null; for (GDMResearchPriority rp = GDMResearchPriority.rpNone; rp <= GDMResearchPriority.rpTop; rp++) { fView.Priority.Add(LangMan.LS(GKData.PriorityNames[(int)rp])); } for (GDMGoalType gt = GDMGoalType.gtIndividual; gt <= GDMGoalType.gtOther; gt++) { fView.GoalType.Add(LangMan.LS(GKData.GoalNames[(int)gt])); } }
public void Test_EnterDataAndApply() { Assert.AreEqual(fTaskRecord, fDialog.Task); SelectCombo("txtPriority", fDialog, 1); for (GDMGoalType gt = GDMGoalType.gtIndividual; gt <= GDMGoalType.gtOther; gt++) { SelectCombo("cmbGoalType", fDialog, (int)gt); } ClickButton("btnAccept", fDialog); Assert.AreEqual(GDMResearchPriority.rpLow, fTaskRecord.Priority); Assert.AreEqual("", fTaskRecord.StartDate.StringValue); Assert.AreEqual("", fTaskRecord.StopDate.StringValue); }
public void ChangeGoalType() { GDMGoalType gt = (GDMGoalType)fView.GoalType.SelectedIndex; switch (gt) { case GDMGoalType.gtIndividual: case GDMGoalType.gtFamily: case GDMGoalType.gtSource: fView.GoalSelect.Enabled = true; fView.Goal.ReadOnly = true; break; case GDMGoalType.gtOther: fView.GoalSelect.Enabled = false; fView.Goal.ReadOnly = false; break; } }
public TaskGoalRet(GDMGoalType goalType, string goalXRef, GDMRecord goalRec) { GoalType = goalType; GoalXRef = goalXRef; GoalRec = goalRec; }