/// <summary> /// 录入成本价 (录入成本价后自动生成实际售价) /// </summary> /// <param name="listVID">蔬菜编号列表</param> /// <param name="values">蔬菜成本价列表</param> /// <returns></returns> public bool TypeInWholesalePrice(List <string> listVID, List <double> values) { try { if (listVID.Count == 0) { return(false); } StringBuilder str = new StringBuilder(); str.Append(@" set xact_abort on begin transaction "); for (int i = 0; i < listVID.Count; i++) { str.Append(@" INSERT INTO [UnitPrice] ([VID] ,[WholesalePrice]) VALUES (" + listVID[i] + "," + values[i] + " ) "); //str.Append(@" update UnitPrice set WholesalePrice =" + values[i]); //str.Append(" where VID= " + listVID[i]); } //关联订单明细UPID str.Append(UpdateUPID()); //生成售价 //str.Append(GenerateActualPrice()); str.Append(@" commit transaction set xact_abort off "); Dictionary <string, object> dic = new Dictionary <string, object>(); int count = dao.ExecuteNoQurey(str.ToString(), dic); return(count > 0); } catch (Exception ex) { XphpTool.CreateErrorLog(ex.ToString()); return(false); } }