Esempio n. 1
0
        ///<Summary>
        ///AddVisitation
        ///This method persists a BOVisitation object to the database collection
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BOVisitation
        ///</parameters>
        public virtual void AddVisitation(BOVisitation boVisitation)
        {
            DAOVisitation daoVisitation = new DAOVisitation();

            RegisterDataObject(daoVisitation);
            BeginTransaction("addVisitation");
            try
            {
                daoVisitation.Id       = boVisitation.Id;
                daoVisitation.Name     = boVisitation.Name;
                daoVisitation.Arrived  = boVisitation.Arrived;
                daoVisitation.Purpose  = boVisitation.Purpose;
                daoVisitation.Departed = boVisitation.Departed;
                daoVisitation.Staffid  = _id.Value;
                daoVisitation.Insert();
                CommitTransaction();

                /*pick up any primary keys, computed values etc*/
                boVisitation = new BOVisitation(daoVisitation);
                if (_boVisitationCollection != null)
                {
                    _boVisitationCollection.Add(boVisitation);
                }
            }
            catch
            {
                RollbackTransaction("addVisitation");
                throw;
            }
        }
Esempio n. 2
0
        ///<Summary>
        ///VisitationCollectionFromSearchFields
        ///This method returns the collection of BOVisitation objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BOVisitation>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BOVisitation> VisitationCollectionFromSearchFields(BOVisitation boVisitation)
        {
            try
            {
                IList <BOVisitation> boVisitationCollection = new List <BOVisitation>();
                DAOVisitation        daoVisitation          = new DAOVisitation();
                daoVisitation.Id       = boVisitation.Id;
                daoVisitation.Name     = boVisitation.Name;
                daoVisitation.Arrived  = boVisitation.Arrived;
                daoVisitation.Staffid  = boVisitation.Staffid;
                daoVisitation.Purpose  = boVisitation.Purpose;
                daoVisitation.Departed = boVisitation.Departed;
                IList <DAOVisitation> daoVisitationCollection = DAOVisitation.SelectAllBySearchFields(daoVisitation);

                foreach (DAOVisitation resdaoVisitation in daoVisitationCollection)
                {
                    boVisitationCollection.Add(new BOVisitation(resdaoVisitation));
                }

                return(boVisitationCollection);
            }
            catch
            {
                throw;
            }
        }
Esempio n. 3
0
 ///<Summary>
 ///VisitationCollectionFromSearchFieldsCount
 ///This method returns the collection count of BOVisitation objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 VisitationCollectionFromSearchFieldsCount(BOVisitation boVisitation)
 {
     try
     {
         DAOVisitation daoVisitation = new DAOVisitation();
         daoVisitation.Id       = boVisitation.Id;
         daoVisitation.Name     = boVisitation.Name;
         daoVisitation.Arrived  = boVisitation.Arrived;
         daoVisitation.Staffid  = boVisitation.Staffid;
         daoVisitation.Purpose  = boVisitation.Purpose;
         daoVisitation.Departed = boVisitation.Departed;
         Int32 objCount = DAOVisitation.SelectAllBySearchFieldsCount(daoVisitation);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }