Exemplo n.º 1
0
 public ActionResult Group(MvcGroupModel model)
 {
     var group = new GroupDetailModel
     {
         Id = model.Id,
         Name = model.Name,
         Leaders = model.Leaders == null ? new List<SmsPersonModel>() : model.Leaders.Select(l => new SmsPersonModel { Id = Convert.ToInt32(l) }).ToList(),
         Members = model.Members == null ? new List<SmsPersonModel>() : model.Members.Select(m => new SmsPersonModel { Id = Convert.ToInt32(m) }).ToList(),
     };
     _message.Save(group);
     return Redirect(Url.Action("Index", "Messaging"));
 }
Exemplo n.º 2
0
        public ActionResult Group(int? id )
        {
            var group = id.HasValue ? _message.GetGroup((int)id) : _message.NewGroup();
             var people = _message.GetPeople();

            var model = new MvcGroupModel
            {
                Id = group.Id,
                Leaders = group.Leaders.Select(l => l.Id).ToArray(),
                Members = group.Members.Select(m => m.Id).ToArray(),
                Name = group.Name,
                PossiblePeople = people.Select(p => new SelectListItem{ Value = p.Id.ToString(), Text = p.Name}).ToList()
            };
            return View(model);
        }