예제 #1
0
        public ActionResult ActivityAdd()
        {
            ActivityDetailsModel defaultModel = new ActivityDetailsModel();

            defaultModel.Disable        = false;
            defaultModel.PublishDateStr = DateTime.UtcNow.AddHours(8).ToString("yyyy\\/MM\\/dd");
            defaultModel.Sort           = 1;
            return(View(defaultModel));
        }
예제 #2
0
        // GET: Activity/Details/5
        public ActionResult Details(int id)
        {
            var e = _manager.GetActivity(id);

            var model = new ActivityDetailsModel
            {
                CreationDate   = e.CreationDate,
                LastUpdateDate = e.LastUpdateDate,
                BeginDate      = e.BeginDate,
                EndDate        = e.EndDate,
                Title          = e.Title,
                Location       = e.Location,
                Description    = e.Description
            };

            return(PartialView("_Details", model));
        }
예제 #3
0
        public ActionResult ActivityEdit(int?ID)
        {
            if (!ID.HasValue)
            {
                return(RedirectToAction("ActivityList"));
            }
            ActivityDetailsModel model = new ActivityDetailsModel();

            using (ActivityModule module = new ActivityModule())
            {
                model = module.DoGetDetailsByID((int)ID);
            }
            FileModule fileModule = new FileModule();

            model.Files = fileModule.GetFiles((int)model.ID, "Activity", "F");
            return(View(model));
        }
예제 #4
0
        public ActivityDetailsModel DoGetDetailsByID(int ID)
        {
            ActivityDetailsModel details =
                DB.OLACT.Where(w => w.ID == ID)
                .Select(s => new ActivityDetailsModel()
            {
                ID             = s.ID,
                Disable        = s.DISABLE,
                PublishDateStr = s.PUB_DT_STR,
                Sort           = s.SQ,
                Title          = s.ACTITLE,
                ActivityDateTimeDescription = s.ACT_DATE_DESC,
                ActivityContent             = s.ACT_CONTENT,
                ApplyDateTimeBegin          = s.APPLY_DATE_BEGIN,
                ApplyDateTimeEnd            = s.APPLY_DATE_END,
                ActivityNumber = s.ACT_NUM
            })
                .FirstOrDefault();

            PublicMethodRepository.HtmlDecode(details);

            if (details != null)
            {
                details.ActivityGroup = DB.OLACTGROUP
                                        .Where(o => o.MAP_ACT_ID == ID)
                                        .Select(s => new ActivityGroup()
                {
                    GroupID         = s.ID,
                    GroupName       = s.GROUP_NAME,
                    GroupApplyLimit = s.TEAM_APPLY_LIMIT,
                    CountApplyLimit = s.COUNT_APPLY_LIMIT
                })
                                        .ToList();
            }
            return(details);
        }
예제 #5
0
 public ActionResult Details(int activityId)
 {
     var model = new ActivityDetailsModel { ActivityId = activityId };
     return View(model);
 }