Beispiel #1
0
        /// <summary>
        /// 更新可选配置关联商品
        /// </summary>
        public static bool UpdateOrderOptionReferProducts(List <OrderOptionReferProductModel> refers, int orderOptionId, string user)
        {
            var result = true;
            var model  = DalCreateOrder.SelectOrderOptionReferProducts(orderOptionId);

            if (model.Any())
            {
                var del = DalCreateOrder.DelOrderOptionReferProducts(orderOptionId);
                result = del >= 0;
            }
            if (refers != null && refers.Any())
            {
                foreach (var refer in refers)
                {
                    refer.OrderOptionId = orderOptionId;
                    var res = DalCreateOrder.InsertOrderOptionReferProducts(refer);
                    result = result && res > 0;
                }
            }
            var oprLog = new FlashSaleProductOprLog
            {
                OperateUser    = user,
                CreateDateTime = DateTime.Now,
                BeforeValue    = JsonConvert.SerializeObject(model),
                AfterValue     = JsonConvert.SerializeObject(refers),
                LogType        = "OOption",
                LogId          = orderOptionId.ToString(),
                Operation      = "编辑关联产品"
            };

            LoggerManager.InsertLog("OrderOpertionOprLog", oprLog);
            //LoggerManager.InsertOplog(new ConfigHistory() { BeforeValue = JsonConvert.SerializeObject(refers), AfterValue = JsonConvert.SerializeObject(model), Author = user, Operation = "编辑关联产品", ObjectType = "OrderOption" });
            return(result);
        }
Beispiel #2
0
 /// <summary>
 /// 查询可选配置关联商品
 /// </summary>
 public static IEnumerable <OrderOptionReferProductModel> SelectOrderOptionReferProducts(int orderOptionId)
 {
     return(DalCreateOrder.SelectOrderOptionReferProducts(orderOptionId));
 }