Esempio n. 1
0
        /// <summary>
        /// 交班
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO ShiftExchangeExt(Jinher.AMP.BTP.Deploy.CustomDTO.ShiftLogDTO dto)
        {
            Deploy.CustomDTO.ResultDTO ret = new Deploy.CustomDTO.ResultDTO()
            {
                isSuccess = false, ResultCode = 1, Message = "添加失败!"
            };

            if (dto == null)
            {
                ret.Message = "参数不能为空!";
                return(ret);
            }
            BE.ShiftTimeLog shift = new ShiftTimeLog();
            shift.Id          = dto.id;
            shift.UserId      = dto.userId;
            shift.ShiftTime   = dto.shiftTime;
            shift.SubId       = dto.subId;
            shift.SubTime     = dto.subTime;
            shift.ModifiedOn  = dto.modifiedOn;
            shift.StoreId     = dto.storeId;
            shift.AppId       = dto.appId;
            shift.EntityState = System.Data.EntityState.Added;
            try
            {
                ContextSession contextSession = ContextFactory.CurrentThreadContext;
                contextSession.SaveObject(shift);
                int change = contextSession.SaveChanges();
                ret.isSuccess = change > 0;
                if (ret.isSuccess)
                {
                    ret.Message = "添加成功!";
                }

                return(ret);
            }
            catch (Exception ex)
            {
                ret.Message = ex.Message;
            }
            return(ret);
        }
Esempio n. 2
0
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO ShiftExchange(Jinher.AMP.BTP.Deploy.CustomDTO.ShiftLogDTO dto)
        {
            //定义返回值
            Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO result;

            try
            {
                //调用代理方法
                result = base.Channel.ShiftExchange(dto);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Esempio n. 3
0
 /// <summary>
 /// 交班
 /// </summary>
 /// <param name="dto"></param>
 /// <returns></returns>
 public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO ShiftExchange(Jinher.AMP.BTP.Deploy.CustomDTO.ShiftLogDTO dto)
 {
     base.Do();
     return(this.ShiftExchangeExt(dto));
 }