Пример #1
0
        /// <summary>
        /// 查询JdOrderItem信息
        /// </summary>
        /// <param name="search">查询类</param>
        /// <returns>结果</returns>
        public List <Jinher.AMP.BTP.Deploy.JdOrderItemDTO> GetJdOrderItemListExt(Jinher.AMP.BTP.Deploy.JdOrderItemDTO search)
        {
            List <Jinher.AMP.BTP.Deploy.JdOrderItemDTO> JdOrderItemlist = new List <Jinher.AMP.BTP.Deploy.JdOrderItemDTO>();
            var searchlist = JdOrderItem.ObjectSet().AsQueryable();

            try
            {
                if (!string.IsNullOrEmpty(search.JdPorderId))
                {
                    searchlist = searchlist.Where(p => p.JdPorderId == search.JdPorderId);
                }
                if (search.TempId != Guid.Empty)
                {
                    searchlist = searchlist.Where(p => p.TempId == search.TempId);
                }
                if (!string.IsNullOrEmpty(search.JdOrderId) && search.JdOrderId != "00000000-0000-0000-0000-000000000000")
                {
                    searchlist = searchlist.Where(p => p.JdOrderId == search.JdOrderId);
                }
                if (!string.IsNullOrEmpty(search.MainOrderId) && search.MainOrderId != "00000000-0000-0000-0000-000000000000")
                {
                    searchlist = searchlist.Where(p => p.MainOrderId == search.MainOrderId.Trim().ToLower());
                }
                if (!string.IsNullOrEmpty(search.CommodityOrderId))
                {
                    searchlist = searchlist.Where(p => p.CommodityOrderId == search.CommodityOrderId.Trim().ToLower());
                }
                if (search.State != 0)
                {
                    searchlist = searchlist.Where(p => p.State == search.State);
                }
                JdOrderItemlist = searchlist.ToList().Select(p => p.ToEntityData()).ToList();
            }
            catch (Exception ex)
            {
                LogHelper.Error("JdOrderItemBP.GetJdOrderItemListExt:", ex);
            }
            return(JdOrderItemlist);
        }
Пример #2
0
        /// <summary>
        /// 保存JdOrderItem信息
        /// </summary>
        /// <param name="VatInvoiceProof"></param>
        /// <returns></returns>
        public ResultDTO SaveJdOrderItemExt(Jinher.AMP.BTP.Deploy.JdOrderItemDTO model)
        {
            ResultDTO dto = null;

            try
            {
                ContextSession contextSession = ContextFactory.CurrentThreadContext;
                JdOrderItem    entity         = new JdOrderItem();
                entity.Id                   = model.Id;
                entity.JdPorderId           = model.JdPorderId;
                entity.TempId               = model.TempId;
                entity.JdOrderId            = model.JdOrderId;
                entity.MainOrderId          = model.MainOrderId;
                entity.CommodityOrderId     = model.CommodityOrderId;
                entity.State                = model.State;
                entity.StateContent         = model.StateContent;
                entity.SubTime              = model.SubTime;
                entity.ModifiedOn           = model.ModifiedOn;
                entity.CommoditySkuId       = model.CommoditySkuId;
                entity.CommodityOrderItemId = model.CommodityOrderItemId;
                entity.IsRefund             = model.IsRefund;
                entity.EntityState          = EntityState.Added;
                contextSession.SaveObject(entity);
                contextSession.SaveChanges();
                dto = new ResultDTO {
                    ResultCode = 0, Message = "保存成功", isSuccess = true
                };
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("JdOrderItem保存异常。JdOrderItem:{0}", ex.Message));
                dto = new ResultDTO {
                    ResultCode = 1, Message = ex.Message, isSuccess = false
                };
            }
            return(dto);
        }
Пример #3
0
 /// <summary>
 /// 修改JdOrderItem
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 public ResultDTO UpdateJdOrderItem(Jinher.AMP.BTP.Deploy.JdOrderItemDTO model)
 {
     base.Do(false);
     return(this.UpdateJdOrderItemExt(model));
 }
Пример #4
0
 /// <summary>
 /// 查询JdOrderItem信息
 /// </summary>
 /// <param name="search">查询类</param>
 /// <returns>结果</returns>
 public List <Jinher.AMP.BTP.Deploy.JdOrderItemDTO> GetJdOrderItemList(Jinher.AMP.BTP.Deploy.JdOrderItemDTO search)
 {
     base.Do(false);
     return(this.GetJdOrderItemListExt(search));
 }
Пример #5
0
        /// <summary>
        /// 修改JdOrderItem
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public ResultDTO UpdateJdOrderItemExt(Jinher.AMP.BTP.Deploy.JdOrderItemDTO model)
        {
            ResultDTO dto = null;

            try
            {
                ContextSession contextSession = ContextFactory.CurrentThreadContext;
                var            jdOrderItem    = JdOrderItem.ObjectSet().FirstOrDefault(p => p.Id == model.Id);
                if (jdOrderItem != null)
                {
                    if (!string.IsNullOrWhiteSpace(model.JdPorderId))
                    {
                        jdOrderItem.JdPorderId = model.JdPorderId;
                    }
                    if (!string.IsNullOrWhiteSpace(model.JdOrderId))
                    {
                        jdOrderItem.JdOrderId = model.JdOrderId;
                    }
                    if (model.TempId != Guid.Empty)
                    {
                        jdOrderItem.TempId = model.TempId;
                    }
                    if (!string.IsNullOrWhiteSpace(model.MainOrderId))
                    {
                        jdOrderItem.MainOrderId = model.MainOrderId;
                    }
                    if (!string.IsNullOrWhiteSpace(model.CommodityOrderId))
                    {
                        jdOrderItem.CommodityOrderId = model.CommodityOrderId;
                    }
                    jdOrderItem.State = model.State;
                    if (!string.IsNullOrWhiteSpace(model.StateContent))
                    {
                        jdOrderItem.StateContent = model.StateContent;
                    }
                    jdOrderItem.CommoditySkuId       = model.CommoditySkuId;
                    jdOrderItem.CommodityOrderItemId = model.CommodityOrderItemId;
                    jdOrderItem.SubTime     = model.SubTime;
                    jdOrderItem.ModifiedOn  = model.ModifiedOn;
                    jdOrderItem.IsRefund    = model.IsRefund;
                    jdOrderItem.EntityState = EntityState.Modified;
                    contextSession.SaveChanges();
                    dto = new ResultDTO()
                    {
                        ResultCode = 0, Message = "修改成功", isSuccess = true
                    };
                }
                else
                {
                    dto = new ResultDTO()
                    {
                        ResultCode = 1, Message = "该信息不存在", isSuccess = false
                    };
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("JdOrderItem信息保存异常。JdOrderItem:{0}", ex.Message));
                dto = new ResultDTO()
                {
                    ResultCode = 1, Message = ex.Message, isSuccess = false
                };
            }
            return(dto);
        }
Пример #6
0
 /// <summary>
 /// 修改JdOrderItem
 /// </summary>
 /// <param name="list"></param>
 /// <returns></returns>
 public ResultDTO UpdateJdOrderItem(Jinher.AMP.BTP.Deploy.JdOrderItemDTO model)
 {
     base.Do();
     return(this.Command.UpdateJdOrderItem(model));
 }
Пример #7
0
 /// <summary>
 /// 查询JdOrderItem信息
 /// </summary>
 /// <param name="search">查询类</param>
 /// <returns>结果</returns>
 public List <Jinher.AMP.BTP.Deploy.JdOrderItemDTO> GetJdOrderItemList(Jinher.AMP.BTP.Deploy.JdOrderItemDTO search)
 {
     base.Do();
     return(this.Command.GetJdOrderItemList(search));
 }