コード例 #1
0
        public ActionResult Edit(Guid?id)
        {
            Association association = new Association();

            if (id != null)
            {
                association = reposetory.GetAssociation((Guid)id);
            }
            else
            {
                association.TeamMessageTeamLeader       = DefaultForening.TeamMessageTeamLeader;
                association.TeamMessage                 = DefaultForening.TeamMessage;
                association.SendTeamText                = true;
                association.SendNoteTeamleader          = true;
                association.NoteTextTime                = Convert.ToInt32(DefaultForening.NoteTextTime);
                association.SendTeamTextDays            = Convert.ToInt32(DefaultForening.SendTeamTextDays);
                association.TextServiceProviderUserName = DefaultForening.TextServiceProviderUserName;
                association.TextServiceProviderPassword = DefaultForening.TextServiceProviderPassword;
                association.Scheduletext                = DefaultForening.Scheduletext;
                association.Country     = Country.DK;
                association.PageSponsor = new Content {
                    Title = DefaultForening.PageContentSponsorTitle, Body = DefaultForening.PageContentSponsor
                };
                association.PageAbout = new Content {
                    Title = DefaultForening.PageContentAboutTitle, Body = DefaultForening.PageContentAbout
                };
                association.PagePress = new Content {
                    Title = DefaultForening.PageContentPressTitle, Body = DefaultForening.PageContentPress
                };
                association.PageLink = new Content {
                    Title = DefaultForening.PageContentLinkTitle, Body = DefaultForening.PageContentLink
                };
            }

            ViewBag.Networks = reposetory.GetActiveNetworks().Select(d => new SelectListItem {
                Value = d.NetworkID.ToString(), Text = d.NetworkName
            }).ToList();

            var SeniorInstructors = reposetory.GetSeniorInstructors().Select(d => new SelectListItem {
                Value = d.PersonID.ToString(), Text = d.FullName
            }).ToList();

            SeniorInstructors.Insert(0, new SelectListItem {
                Value = Guid.Empty.ToString(), Text = General.DropDownChoose
            });
            ViewBag.SeniorInstructors = SeniorInstructors;

            return(View(association));
        }