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

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

            try
            {
                lastInsertId = b.Insert("AP_StockIn", b.ConvertColName(vo), b.ConvertValueList(vo));
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            return(lastInsertId);
        }
        public int Create(APStockInVO vo)
        {
            int id;

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

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