コード例 #1
0
        public ActionResult AddPerson()
        {
            /*Get new Person template*/
            IDataRepositoryModel DRM = new DataRepositoryModel();

            return(View(DRM.Add()));
        }
コード例 #2
0
        // GET: TxnFlow
        public ActionResult Index()
        {
            /*Get list of Person*/
            IDataRepositoryModel DRM = new DataRepositoryModel();

            return(View(DRM.GetAllPeople()));
        }
コード例 #3
0
        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()));
        }
コード例 #4
0
        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);
        }