Beispiel #1
0
 public HomeExhibitionVM(HomeExhibition he)
 {
     ID             = he.ID;
     Name           = he.Name;
     SortCode       = he.SortCode;
     Activity       = he.Activity;
     Description    = he.Description;
     CreateDateTime = he.CreateDateTime;
     StartDateTime  = he.StartDateTime;
     EndDateTime    = he.EndDateTime;
     IsUse          = he.IsUse;
     Avatar         = he.Avatar;
     ExhibitionLeve = he.ExhibitionLeve;
 }
Beispiel #2
0
 public void MapToAn(HomeExhibition he)
 {
     he.ID             = ID;
     he.Name           = Name;
     he.SortCode       = SortCode;
     he.Activity       = Activity;
     he.Description    = Description;
     he.CreateDateTime = CreateDateTime;
     he.StartDateTime  = StartDateTime;
     he.EndDateTime    = EndDateTime;
     he.IsUse          = IsUse;
     he.Avatar         = Avatar;
     he.ExhibitionLeve = ExhibitionLeve;
 }
Beispiel #3
0
        /// <summary>
        /// 添加进首页呈现
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <IActionResult> HomeExhibitionPresent(Guid id)
        {
            var homeExhhibition = await _homeExhibitionExtension.GetAll().Include(x => x.Activity).Where(x => x.Activity.ID == id).FirstOrDefaultAsync();

            if (homeExhhibition != null)
            {
                return(Json(new { isOK = false, message = homeExhhibition.Activity.Name + "已在首页显示设置里,请在首页显示设置模块设置允许显示" }));
            }
            var activity = await _activityTermExtension.GetAll().Include(x => x.Avatar).Where(x => x.ID == id).FirstOrDefaultAsync();

            homeExhhibition = new HomeExhibition()
            {
                Name           = activity.Name,
                Activity       = activity,
                Description    = activity.Description,
                CreateDateTime = DateTime.Now,
                StartDateTime  = DateTime.Now,
                EndDateTime    = activity.EndDataTime,
                Avatar         = activity.Avatar,
                ExhibitionLeve = ExhibitionLevelEnum.Highest
            };
            _homeExhibitionExtension.AddAndSave(homeExhhibition);
            return(Json(new { isOK = true, message = activity.Name + "添加进首页显示成功,请在首页显示设置模块设置允许显示" }));
        }