//public #region 添加价格比较数据 /// <summary> /// 添加价格比较数据 /// </summary> /// <param name="priceCompare"></param> /// <returns></returns> public bool AddPriceCompare(FlightPriceCompare priceCompare) { //创建命令对象 OracleCommand oracleCommand = DSCRM.DBA.GetOraCommand(); //构建sql插入语句 StringBuilder sbInsertSql = new StringBuilder(); sbInsertSql.Append(" insert into T_TP_PRICE_COMPARE( COMPAREID,OTHERPRICEID,LOWEST_PRICE_ID,AUTORESULT,HANDRESULT,MEMO) "); sbInsertSql.Append(" values (:COMPAREID,:OTHERPRICEID,:LOWEST_PRICE_ID,:AUTORESULT,:HANDRESULT,:MEMO) "); oracleCommand.CommandText = sbInsertSql.ToString(); // 装载参数 DBUtil.AddParameter(oracleCommand, "COMPAREID", (Int32)CommonDBFunction.GenerateIdentity("T_TP_PRICE_COMPARE")); DBUtil.AddParameter(oracleCommand, "OTHERPRICEID", priceCompare.Otherpriceid); DBUtil.AddParameter(oracleCommand, "LOWEST_PRICE_ID", priceCompare.LowestPriceId); DBUtil.AddParameter(oracleCommand, "AUTORESULT", priceCompare.Autoresult); DBUtil.AddParameter(oracleCommand, "HANDRESULT", priceCompare.Handresult); DBUtil.AddParameter(oracleCommand, "MEMO", priceCompare.Memo); int count = 0; //捕获异常 try { count = DSCRM.DBA.ExecuteNonQuery(oracleCommand); } catch { } return(count > 0); }
private static void CompareElongLowestPrice(IList <RouteInformation> routeInformationList) { if (lowestPrice == null || routeInformationList == null) { return; } List <RouteInformation> routeInformationListConverted = (List <RouteInformation>)routeInformationList; RouteInformation routeInformationFinded = routeInformationListConverted.Find(delegate(RouteInformation routeInformation) { return(routeInformation.FlightNO.Trim() == lowestPrice.Flight.Trim()); }); AirLineOperation operation = new AirLineOperation(); int otherPriceId = 0; int autoCompare = (int)EnumDef.EFlightAutoCompare.差异; if (routeInformationFinded != null) { FlightOtherPrice otherPrice = CreateElongOtherPrice(routeInformationFinded); otherPriceId = operation.AddOtherPrice(otherPrice); if (otherPriceId > 0) { otherPrice.Otherpriceid = otherPriceId; if (routeInformationFinded.TicketPrice.Equals(lowestPrice.LowestPrice)) { autoCompare = (int)EnumDef.EFlightAutoCompare.无差异; } } } FlightPriceCompare priceCompare = new FlightPriceCompare(); priceCompare.LowestPriceId = lowestPrice.LowestPriceId; priceCompare.Otherpriceid = otherPriceId; priceCompare.Autoresult = autoCompare; priceCompare.Handresult = (int)EnumDef.EFlightCompare.未核实; operation.AddPriceCompare(priceCompare); }
/// <summary> /// ��Ӽ۸�Ƚ����� /// </summary> /// <param name="priceCompare"></param> /// <returns></returns> public bool AddPriceCompare(FlightPriceCompare priceCompare) { //����������� OracleCommand oracleCommand = DSCRM.DBA.GetOraCommand(); //����sql������� StringBuilder sbInsertSql = new StringBuilder(); sbInsertSql.Append(" insert into T_TP_PRICE_COMPARE( COMPAREID,OTHERPRICEID,LOWEST_PRICE_ID,AUTORESULT,HANDRESULT,MEMO) "); sbInsertSql.Append(" values (:COMPAREID,:OTHERPRICEID,:LOWEST_PRICE_ID,:AUTORESULT,:HANDRESULT,:MEMO) "); oracleCommand.CommandText = sbInsertSql.ToString(); // װ�ز��� DBUtil.AddParameter(oracleCommand, "COMPAREID", (Int32)CommonDBFunction.GenerateIdentity("T_TP_PRICE_COMPARE")); DBUtil.AddParameter(oracleCommand, "OTHERPRICEID", priceCompare.Otherpriceid); DBUtil.AddParameter(oracleCommand, "LOWEST_PRICE_ID", priceCompare.LowestPriceId); DBUtil.AddParameter(oracleCommand, "AUTORESULT", priceCompare.Autoresult); DBUtil.AddParameter(oracleCommand, "HANDRESULT", priceCompare.Handresult); DBUtil.AddParameter(oracleCommand, "MEMO", priceCompare.Memo); int count = 0; //�����쳣 try { count = DSCRM.DBA.ExecuteNonQuery(oracleCommand); } catch { } return count > 0; }