示例#1
0
 ///<Summary>
 ///RoleCollectionCount
 ///This method returns the collection count of BORole objects
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 RoleCollectionCount()
 {
     try
     {
         Int32 objCount = DAORole.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>
 ///DAORole
 ///</parameters>
 protected internal BORole(DAORole daoRole)
 {
     try
     {
         _id   = daoRole.Id;
         _name = daoRole.Name;
     }
     catch
     {
         throw;
     }
 }
示例#3
0
 ///<Summary>
 ///Constructor
 ///Constructor using primary key(s)
 ///</Summary>
 ///<returns>
 ///void
 ///</returns>
 ///<parameters>
 ///Int32 id
 ///</parameters>
 public BORole(Int32 id)
 {
     try
     {
         DAORole daoRole = DAORole.SelectOne(id);
         _id   = daoRole.Id;
         _name = daoRole.Name;
     }
     catch
     {
         throw;
     }
 }
示例#4
0
 ///<Summary>
 ///RoleCollectionFromSearchFieldsCount
 ///This method returns the collection count of BORole objects, filtered by a search object
 ///</Summary>
 ///<returns>
 ///Int32
 ///</returns>
 ///<parameters>
 ///
 ///</parameters>
 public static Int32 RoleCollectionFromSearchFieldsCount(BORole boRole)
 {
     try
     {
         DAORole daoRole = new DAORole();
         daoRole.Id   = boRole.Id;
         daoRole.Name = boRole.Name;
         Int32 objCount = DAORole.SelectAllBySearchFieldsCount(daoRole);
         return(objCount);
     }
     catch
     {
         throw;
     }
 }
示例#5
0
        ///<Summary>
        ///Delete
        ///This method deletes one Role record from the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void Delete()
        {
            DAORole daoRole = new DAORole();

            RegisterDataObject(daoRole);
            BeginTransaction("deleteBORole");
            try
            {
                daoRole.Id = _id;
                daoRole.Delete();
                CommitTransaction();
            }
            catch
            {
                RollbackTransaction("deleteBORole");
                throw;
            }
        }
示例#6
0
        ///<Summary>
        ///RoleCollection
        ///This method returns the collection of BORole objects
        ///</Summary>
        ///<returns>
        ///List[BORole]
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BORole> RoleCollection()
        {
            try
            {
                IList <BORole>  boRoleCollection  = new List <BORole>();
                IList <DAORole> daoRoleCollection = DAORole.SelectAll();

                foreach (DAORole daoRole in daoRoleCollection)
                {
                    boRoleCollection.Add(new BORole(daoRole));
                }

                return(boRoleCollection);
            }
            catch
            {
                throw;
            }
        }
示例#7
0
        ///<Summary>
        ///RoleCollectionFromSearchFields
        ///This method returns the collection of BORole objects, filtered by a search object
        ///</Summary>
        ///<returns>
        ///List<BORole>
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static IList <BORole> RoleCollectionFromSearchFields(BORole boRole)
        {
            try
            {
                IList <BORole> boRoleCollection = new List <BORole>();
                DAORole        daoRole          = new DAORole();
                daoRole.Id   = boRole.Id;
                daoRole.Name = boRole.Name;
                IList <DAORole> daoRoleCollection = DAORole.SelectAllBySearchFields(daoRole);

                foreach (DAORole resdaoRole in daoRoleCollection)
                {
                    boRoleCollection.Add(new BORole(resdaoRole));
                }

                return(boRoleCollection);
            }
            catch
            {
                throw;
            }
        }
示例#8
0
        ///<Summary>
        ///SaveNew
        ///This method persists a new Role record to the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public virtual void SaveNew()
        {
            DAORole daoRole = new DAORole();

            RegisterDataObject(daoRole);
            BeginTransaction("savenewBORole");
            try
            {
                daoRole.Name = _name;
                daoRole.Insert();
                CommitTransaction();

                _id      = daoRole.Id;
                _name    = daoRole.Name;
                _isDirty = false;
            }
            catch
            {
                RollbackTransaction("savenewBORole");
                throw;
            }
        }
示例#9
0
        ///<Summary>
        ///Update
        ///This method updates one Role record in the store
        ///</Summary>
        ///<returns>
        ///void
        ///</returns>
        ///<parameters>
        ///BORole
        ///</parameters>
        public virtual void Update()
        {
            DAORole daoRole = new DAORole();

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

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