コード例 #1
0
        /// <summary>
        /// 删除员工
        /// </summary>
        /// <param name="employeeId">员工ID</param>
        /// <param name="tran">中间事务对象</param>
        public void Delete(string employeeId, ICTransaction tran)
        {
            HibernateTransaction hTran   = null;
            ISession             session = null;

            if (tran != null)
            {
                hTran   = (HibernateTransaction)tran;
                session = hTran.CurrentSession;
            }
            else
            {
                session = this.CurrentHibernateConfig.GetCurrentSession();
            }

            Employee employee = HibernateHelper.FindObjectById <Employee>(session, employeeId);

            HibernateHelper.DeleteObject <Employee>(session, employee);
        }
コード例 #2
0
        /// <summary>
        /// 删除职位
        /// </summary>
        /// <param name="positionId">职位ID</param>
        /// <param name="tran">中间事务对象</param>
        public void Delete(string positionId, ICTransaction tran)
        {
            HibernateTransaction hTran   = null;
            ISession             session = null;

            if (tran != null)
            {
                hTran   = (HibernateTransaction)tran;
                session = hTran.CurrentSession;
            }
            else
            {
                session = this.CurrentHibernateConfig.GetCurrentSession();
            }

            Position position = HibernateHelper.FindObjectById <Position>(session, positionId);

            HibernateHelper.DeleteObject <Position>(session, position);
        }
コード例 #3
0
ファイル: DepartmentDal.cs プロジェクト: pmsun-bruce/DBTool
        /// <summary>
        /// 删除部门
        /// </summary>
        /// <param name="departmentId">部门ID</param>
        /// <param name="tran">中间事务对象</param>
        public void Delete(string departmentId, ICTransaction tran)
        {
            HibernateTransaction hTran   = null;
            ISession             session = null;

            if (tran != null)
            {
                hTran   = (HibernateTransaction)tran;
                session = hTran.CurrentSession;
            }
            else
            {
                session = this.CurrentHibernateConfig.GetCurrentSession();
            }

            Department department = HibernateHelper.FindObjectById <Department>(session, departmentId);

            HibernateHelper.DeleteObject <Department>(session, department);
        }
コード例 #4
0
        /// <summary>
        /// 删除公司
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <param name="tran">中间事务对象</param>
        public void Delete(string companyId, ICTransaction tran)
        {
            HibernateTransaction hTran   = null;
            ISession             session = null;

            if (tran != null)
            {
                hTran   = (HibernateTransaction)tran;
                session = hTran.CurrentSession;
            }
            else
            {
                session = this.CurrentHibernateConfig.GetCurrentSession();
            }

            Company company = HibernateHelper.FindObjectById <Company>(session, companyId);

            HibernateHelper.DeleteObject <Company>(session, company);
        }