コード例 #1
0
 ///<Summary>
 ///DesignationCollectionCount
 ///This method returns the collection count of BODesignation objects
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 DesignationCollectionCount()
 {
     try
     {
         Int32 objCount = DAODesignation.SelectAllCount();
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
コード例 #2
0
 ///<Summary>
 ///Constructor
 ///This constructor initializes the business object from its respective data object
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///DAODesignation
 ///</parameters>
 protected internal BODesignation(DAODesignation daoDesignation)
 {
     try
     {
         _id   = daoDesignation.Id;
         _name = daoDesignation.Name;
     }
     catch
     {
         throw;
     }
 }
コード例 #3
0
 ///<Summary>
 ///Constructor
 ///Constructor using primary key(s)
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///Int32 id
 ///</parameters>
 public BODesignation(Int32 id)
 {
     try
     {
         DAODesignation daoDesignation = DAODesignation.SelectOne(id);
         _id   = daoDesignation.Id;
         _name = daoDesignation.Name;
     }
     catch
     {
         throw;
     }
 }
コード例 #4
0
 ///<Summary>
 ///DesignationCollectionFromSearchFieldsCount
 ///This method returns the collection count of BODesignation objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 DesignationCollectionFromSearchFieldsCount(BODesignation boDesignation)
 {
     try
     {
         DAODesignation daoDesignation = new DAODesignation();
         daoDesignation.Id   = boDesignation.Id;
         daoDesignation.Name = boDesignation.Name;
         Int32 objCount = DAODesignation.SelectAllBySearchFieldsCount(daoDesignation);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
コード例 #5
0
        ///<Summary>
        ///Delete
        ///This method deletes one Designation record from the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void Delete()
        {
            DAODesignation daoDesignation = new DAODesignation();

            RegisterDataObject(daoDesignation);
            BeginTransaction("deleteBODesignation");
            try
            {
                daoDesignation.Id = _id;
                daoDesignation.Delete();
                CommitTransaction();
            }
            catch
            {
                RollbackTransaction("deleteBODesignation");
                throw;
            }
        }
コード例 #6
0
        ///<Summary>
        ///DesignationCollection
        ///This method returns the collection of BODesignation objects
        ///</Summary>
        ///<returns>
        ///List[BODesignation]
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BODesignation> DesignationCollection()
        {
            try
            {
                IList <BODesignation>  boDesignationCollection  = new List <BODesignation>();
                IList <DAODesignation> daoDesignationCollection = DAODesignation.SelectAll();

                foreach (DAODesignation daoDesignation in daoDesignationCollection)
                {
                    boDesignationCollection.Add(new BODesignation(daoDesignation));
                }

                return(boDesignationCollection);
            }
            catch
            {
                throw;
            }
        }
コード例 #7
0
        ///<Summary>
        ///DesignationCollectionFromSearchFields
        ///This method returns the collection of BODesignation objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BODesignation>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BODesignation> DesignationCollectionFromSearchFields(BODesignation boDesignation)
        {
            try
            {
                IList <BODesignation> boDesignationCollection = new List <BODesignation>();
                DAODesignation        daoDesignation          = new DAODesignation();
                daoDesignation.Id   = boDesignation.Id;
                daoDesignation.Name = boDesignation.Name;
                IList <DAODesignation> daoDesignationCollection = DAODesignation.SelectAllBySearchFields(daoDesignation);

                foreach (DAODesignation resdaoDesignation in daoDesignationCollection)
                {
                    boDesignationCollection.Add(new BODesignation(resdaoDesignation));
                }

                return(boDesignationCollection);
            }
            catch
            {
                throw;
            }
        }
コード例 #8
0
        ///<Summary>
        ///SaveNew
        ///This method persists a new Designation record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            DAODesignation daoDesignation = new DAODesignation();

            RegisterDataObject(daoDesignation);
            BeginTransaction("savenewBODesignation");
            try
            {
                daoDesignation.Name = _name;
                daoDesignation.Insert();
                CommitTransaction();

                _id      = daoDesignation.Id;
                _name    = daoDesignation.Name;
                _isDirty = false;
            }
            catch
            {
                RollbackTransaction("savenewBODesignation");
                throw;
            }
        }
コード例 #9
0
        ///<Summary>
        ///Update
        ///This method updates one Designation record in the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BODesignation
        ///</parameters>
        public virtual void Update()
        {
            DAODesignation daoDesignation = new DAODesignation();

            RegisterDataObject(daoDesignation);
            BeginTransaction("updateBODesignation");
            try
            {
                daoDesignation.Id   = _id;
                daoDesignation.Name = _name;
                daoDesignation.Update();
                CommitTransaction();

                _id      = daoDesignation.Id;
                _name    = daoDesignation.Name;
                _isDirty = false;
            }
            catch
            {
                RollbackTransaction("updateBODesignation");
                throw;
            }
        }