public DepartmentVO GetByID(int id)
        {
            DepartmentVO vo = new DepartmentVO();
            DataTable    dt = Select("ID=" + id + "");

            if (dt.Rows.Count > 0)
            {
                vo = b.ConvertObj(dt.Rows[0], new DepartmentVO()) as DepartmentVO;
            }
            return(vo);
        }
        public DepartmentVO GetIDByName(string deptName)
        {
            DepartmentVO vo = new DepartmentVO();

            DataTable dt = Select("DeptName='" + deptName + "'");

            if (dt.Rows.Count > 0)
            {
                vo = b.ConvertObj(dt.Rows[0], new DepartmentVO()) as DepartmentVO;
            }
            return(vo);
        }
        public int Create(DepartmentVO vo)
        {
            int id;

            if (!dao.isExist(vo.Id.ToString()))
            {
                id = dao.Insert(vo);
            }
            else
            {
                id = dao.Update(vo);
            }
            return(id);
        }
        public int Insert(DepartmentVO vo)
        {
            int lastInsertId = 0;

            try
            {
                lastInsertId = b.Insert("Department", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (SqlException sql)
            {
                throw sql;
            }
            return(lastInsertId);
        }
        public int Update(DepartmentVO vo)
        {
            int ID = 0;

            try
            {
                b.Update("Department", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo));
                ID = vo.Id;
            }
            catch (SqlException sql)
            {
                throw sql;
            }
            return(ID);
        }