Exemplo n.º 1
0
        /// <summary>
        /// 根据历史明细ID获取历史明细
        /// </summary>
        /// <param name="managerDetailId"></param>
        /// <returns></returns>
        public ManagerDetailInfo GetManagerDetailById(int managerDetailId)
        {
            if (ManagerDetailIdExists(managerDetailId))
            {
                var entity = ManagerDetailRepository.GetManagerDetailById(managerDetailId);
                var model  = new ManagerDetailInfo
                {
                    ManagerDetailId  = entity.ManagerDetailId,
                    ManagerId        = entity.ManagerId,
                    ManagerName      = entity.Manager.ManagerName,
                    CurrentChannelId = entity.CurrentChannelId,
                    CurrentChannel   = ChannelManageBll.GetChannelById(entity.CurrentChannelId).ChannelName,
                    OldChannelId     = entity.OldChannelId,
                    OldChannel       = ChannelManageBll.GetChannelById(entity.OldChannelId).ChannelName,
                    CurrentRank      = entity.CurrentRank,
                    OldRank          = entity.OldRank,
                    RankStatus       = entity.RankStatus,
                    CreatedTime      = entity.CreatedTime,
                    ModifiedTime     = entity.ModifiedTime
                };

                return(model);
            }

            return(new ManagerDetailInfo());
        }
Exemplo n.º 2
0
 /// <summary>
 /// 删除历史明细
 /// </summary>
 /// <param name="managerDetailId"></param>
 /// <returns></returns>
 public bool DeleteManagerDetail(int managerDetailId)
 {
     try
     {
         var entity = ManagerDetailRepository.GetManagerDetailById(managerDetailId);
         if (ManagerDetailRepository.DeleteManagerDetail(entity) == 1)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }