Beispiel #1
0
        public AccessLevelVO GetByID(int id)
        {
            AccessLevelVO vo = new AccessLevelVO();
            DataTable     dt = Select("ID=" + id + "");

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

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

            try
            {
                lastInsertId = b.Insert("AccessLevel", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
Beispiel #4
0
        public int Update(AccessLevelVO vo)
        {
            int AssetID = 0;

            try
            {
                b.Update("AccessLevel", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo));
                AssetID = vo.Id;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(AssetID);
        }