public bool Insert(PersonPGMERegisteration personpgmeregisteration)
        {
            int autonumber = 0;
            PersonPGMERegisterationDAC personpgmeregisterationComponent = new PersonPGMERegisterationDAC();
            bool endedSuccessfuly = personpgmeregisterationComponent.InsertNewPersonPGMERegisteration(ref autonumber, personpgmeregisteration.PersonId, personpgmeregisteration.PersonProgramId, personpgmeregisteration.PersonRegisterationStatusId, personpgmeregisteration.RegisterationNumber, personpgmeregisteration.UniRegisterationNumber);

            if (endedSuccessfuly)
            {
                personpgmeregisteration.PersonRegisterationId = autonumber;
            }
            return(endedSuccessfuly);
        }
        public List <PersonPGMERegisteration> GetAll()
        {
            PersonPGMERegisterationDAC _personPGMERegisterationComponent = new PersonPGMERegisterationDAC();
            IDataReader reader = _personPGMERegisterationComponent.GetAllPersonPGMERegisteration().CreateDataReader();
            List <PersonPGMERegisteration> _personPGMERegisterationList = new List <PersonPGMERegisteration>();

            while (reader.Read())
            {
                if (_personPGMERegisterationList == null)
                {
                    _personPGMERegisterationList = new List <PersonPGMERegisteration>();
                }
                PersonPGMERegisteration _personPGMERegisteration = new PersonPGMERegisteration();
                if (reader["PersonRegisterationId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonRegisterationId = Convert.ToInt32(reader["PersonRegisterationId"]);
                }
                if (reader["PersonId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonId = Convert.ToInt32(reader["PersonId"]);
                }
                if (reader["PersonProgramId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonProgramId = Convert.ToInt32(reader["PersonProgramId"]);
                }
                if (reader["PersonRegisterationStatusId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonRegisterationStatusId = Convert.ToInt32(reader["PersonRegisterationStatusId"]);
                }
                if (reader["RegisterationNumber"] != DBNull.Value)
                {
                    _personPGMERegisteration.RegisterationNumber = Convert.ToString(reader["RegisterationNumber"]);
                }
                if (reader["UniRegisterationNumber"] != DBNull.Value)
                {
                    _personPGMERegisteration.UniRegisterationNumber = Convert.ToString(reader["UniRegisterationNumber"]);
                }
                _personPGMERegisteration.NewRecord = false;
                _personPGMERegisterationList.Add(_personPGMERegisteration);
            }
            reader.Close();
            return(_personPGMERegisterationList);
        }
        public PersonPGMERegisteration GetByID(int _personRegisterationId)
        {
            PersonPGMERegisterationDAC _personPGMERegisterationComponent = new PersonPGMERegisterationDAC();
            IDataReader             reader = _personPGMERegisterationComponent.GetByIDPersonPGMERegisteration(_personRegisterationId);
            PersonPGMERegisteration _personPGMERegisteration = null;

            while (reader.Read())
            {
                _personPGMERegisteration = new PersonPGMERegisteration();
                if (reader["PersonRegisterationId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonRegisterationId = Convert.ToInt32(reader["PersonRegisterationId"]);
                }
                if (reader["PersonId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonId = Convert.ToInt32(reader["PersonId"]);
                }
                if (reader["PersonProgramId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonProgramId = Convert.ToInt32(reader["PersonProgramId"]);
                }
                if (reader["PersonRegisterationStatusId"] != DBNull.Value)
                {
                    _personPGMERegisteration.PersonRegisterationStatusId = Convert.ToInt32(reader["PersonRegisterationStatusId"]);
                }
                if (reader["RegisterationNumber"] != DBNull.Value)
                {
                    _personPGMERegisteration.RegisterationNumber = Convert.ToString(reader["RegisterationNumber"]);
                }
                if (reader["UniRegisterationNumber"] != DBNull.Value)
                {
                    _personPGMERegisteration.UniRegisterationNumber = Convert.ToString(reader["UniRegisterationNumber"]);
                }
                _personPGMERegisteration.NewRecord = false;
            }
            reader.Close();
            return(_personPGMERegisteration);
        }
        public bool Update(PersonPGMERegisteration personpgmeregisteration, int old_personRegisterationId)
        {
            PersonPGMERegisterationDAC personpgmeregisterationComponent = new PersonPGMERegisterationDAC();

            return(personpgmeregisterationComponent.UpdatePersonPGMERegisteration(personpgmeregisteration.PersonId, personpgmeregisteration.PersonProgramId, personpgmeregisteration.PersonRegisterationStatusId, personpgmeregisteration.RegisterationNumber, personpgmeregisteration.UniRegisterationNumber, old_personRegisterationId));
        }