public static ProductClothesCirculationSKURecordDao getInstance() { if (dao == null) { dao = new ProductClothesCirculationSKURecordDao(); } return(dao); }
public int Insert(ProductClothesCirculationRecord info) { try { string commandText = string.Format("insert into ProductCirculationRecord(productID, totalNum, price, circulationID) values('{0}', '{1}', '{2}', '{3}')", info.ProductID, info.TotalNum, info.Price, info.CirculationID); DbHelperAccess.executeNonQuery(commandText); int recordID = DbHelperAccess.executeMax("ID", "ProductCirculationRecord"); List <ProductClothesCirculationSKURecord> skuRecords = info.SkuRecords; ProductClothesCirculationSKURecordDao dao = new ProductClothesCirculationSKURecordDao(); foreach (ProductClothesCirculationSKURecord record in skuRecords) { record.RecordID = recordID; dao.Insert(record); } return(recordID); } catch (Exception ex) { throw ex; } }