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

            if (dt.Rows.Count > 0)
            {
                vo = b.ConvertObj(dt.Rows[0], new OfficeAccessoriesVO()) as OfficeAccessoriesVO;
            }
            return(vo);
        }
コード例 #2
0
        public int Create(OfficeAccessoriesVO vo)
        {
            int id;

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

            try
            {
                lastInsertId = b.Insert("OfficeAccessories", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
        public int Update(OfficeAccessoriesVO vo)
        {
            int ID = 0;

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