Example #1
0
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateOrderExceptionExt(Jinher.AMP.BTP.Deploy.CommodityOrderExceptionDTO dto)
        {
            ResultDTO result = new ResultDTO();

            if (dto == null)
            {
                result.ResultCode = -1;
                result.Message    = "参数不能为空!";
                return(result);
            }

            try
            {
                var oeQuery = from coe in CommodityOrderException.ObjectSet()
                              where coe.Id == dto.Id
                              select coe;
                if (!oeQuery.Any())
                {
                    result.ResultCode = -2;
                    result.Message    = "未更新任何订单异常日志!";
                    return(result);
                }
                var oeFirst = oeQuery.First();
                if (dto.State != oeFirst.State && dto.State >= 0)
                {
                    oeFirst.State = dto.State;
                }
                oeFirst.Note = dto.Note;
                ContextSession contextSession = ContextFactory.CurrentThreadContext;
                contextSession.SaveChanges();

                result.Message    = "保存成功!";
                result.ResultCode = 0;
            }
            catch (Exception ex)
            {
                string msg = "UpdateOrderExceptionExt接口异常,异常信息:{0}";
                msg = string.Format(msg, ex);
            }

            return(result);
        }
 /// <summary>
 ///  更新订单异常日志状态
 ///  </summary>
 /// <param name="dto">参数实体</param>
 /// <returns></returns>
 public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateOrderException(Jinher.AMP.BTP.Deploy.CommodityOrderExceptionDTO dto)
 {
     base.Do();
     return(this.UpdateOrderExceptionExt(dto));
 }