示例#1
0
        public ActionResult Edit(int id)
        {
            var meeting = ps.GetMeeting(id);
            meeting.EventDate = meeting.EventDate.AddHours(SessionStorage.User.HoursOffsetFromUtc);

            var team = ps.GetProjectTeam(meeting.ProjectId);
            var model = new Form
                            {
                                ProjectId = id,
                                Team = team,
                                Meeting = meeting,
                                TeamParticipants = string.Join(" ",
                                                               meeting.Participants.Where(
                                                                   p => meeting.Project.Team.Any(t => t.UserId == p.Id))
                                                                   .Select(
                                                                       p => p.Id)),
                                OtherParticipants =
                                    string.Join(" ",
                                                meeting.Participants.Where(
                                                    p => !meeting.Project.Team.Any(t => t.UserId == p.Id)).Select(
                                                        p => p.Email))
                            };

            return View("Create", model);
        }
示例#2
0
        public ActionResult Create(Form model)
        {
            model.Meeting.OrganizerId = SessionStorage.User.Id;
            ps.AddMeeting(model.Meeting, model.TeamParticipants, model.OtherParticipants);

            return RedirectToAction("Show", "Project", new {model.Meeting.ProjectId});
        }
示例#3
0
        public ActionResult Edit(Form model)
        {
            //set time to UTC
            model.Meeting.EventDate = model.Meeting.EventDate.AddHours(-SessionStorage.User.HoursOffsetFromUtc);

            ps.UpdateMeeting(model.Meeting, model.TeamParticipants, model.OtherParticipants);

            return RedirectToAction("List", new {id = model.Meeting.ProjectId});
        }