public ActionResult AddPerson() { /*Get new Person template*/ IDataRepositoryModel DRM = new DataRepositoryModel(); return(View(DRM.Add())); }
// GET: TxnFlow public ActionResult Index() { /*Get list of Person*/ IDataRepositoryModel DRM = new DataRepositoryModel(); return(View(DRM.GetAllPeople())); }
public ActionResult AddPerson(PersonEntity P) { /*Add Person*/ IDataRepositoryModel DRM = new DataRepositoryModel(); var personManager = new PersonManager(); var savePersonRules = new SavePersonRules(); savePersonRules.AddRule(new CanSavePerson(P)); personManager.AddPerson(P, DRM, savePersonRules); return(View(DRM.Add())); }
public bool Validate() { IPerson _alreadyExistingPerson; IDataRepositoryModel DRM = new DataRepositoryModel(); _alreadyExistingPerson = DRM.FindByIdNumber(_person.id_number); if (_alreadyExistingPerson != null) { FailureMessage = "Person Already Exists"; return(false); } return(true); }