Ejemplo n.º 1
0
        /// <summary>
        /// 实现数据库插入货物数据
        /// </summary>
        /// <param name="hw"></param>
        /// <returns></returns>
        private bool addHW(HW hw)
        {
            string sql = "insert into OSM_HW(OFFERSHEET_CODE,PRODUCT_ID,HW_NUMBER,HW_PRICE,HW_TOTALPRICE,COMMENT) ";

            sql += "values('" + hw.getOFFERSHEET_CODE() + "'," + hw.getPRODUCT_ID() + ",";
            sql += hw.getHW_NUMBER().ToString() + "," + hw.getHW_PRICE().ToString();
            sql += "," + hw.getHW_TOTALPRICE().ToString() + ",'" + hw.getCOMMENT() + "')";

            AccessDB adb           = new AccessDB();
            bool     isExecuteSucc = adb.SQLExecute(sql);

            if (isExecuteSucc)
            {
                MessageBox.Show("添加成功!", "消息");
            }
            else
            {
                MessageBox.Show("添加失败!", "消息");
            }
            return(isExecuteSucc);
        }