public AssetCategoryVO GetByID(int id) { AssetCategoryVO vo = new AssetCategoryVO(); DataTable dt = Select("ID=" + id + ""); if (dt.Rows.Count > 0) { vo = b.ConvertObj(dt.Rows[0], new AssetCategoryVO()) as AssetCategoryVO; } return(vo); }
public int Create(AssetCategoryVO vo) { int id = 0; if (!dao.isExist(vo.Id.ToString())) { id = dao.Insert(vo); } else { id = dao.Update(vo); } return(id); }
public int Insert(AssetCategoryVO vo) { int lastInsertId = 0; try { lastInsertId = b.Insert("Asset_Category", b.ConvertColName(vo), b.ConvertValueList(vo)); } catch (SqlException ex) { throw ex; } return(lastInsertId); }
public int Update(AssetCategoryVO vo) { int townID = 0; try { b.Update("Asset_Category", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo)); townID = vo.Id; } catch (SqlException ex) { throw ex; } return(townID); }