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

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

            try
            {
                lastInsertId = b.Insert("AP_Category", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
示例#3
0
        public int Create(APCategoryVO vo)
        {
            int id;

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

            try
            {
                b.Update("AP_Category", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo));
                categoryID = vo.Id;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(categoryID);
        }