Example #1
0
 private static void MapOrganizationUpdate( Organization organization, OrganizationDetailsModel model )
 {
     organization.Name = model.Name;
     organization.Tagline = model.Tagline;
     organization.ContactEmail = model.ContactEmail;
     organization.ContactPhone = model.ContactPhone;
     organization.YtdGoal = model.YtdGoal;
     organization.FiscalYearStartMonth = model.FiscalYearStartMonth;
     organization.FiscalYearStartDay = model.FiscalYearStartDay;
     organization.SummaryHtml = model.SummaryHtml;
     organization.DescriptionHtml = model.DescriptionHtml;
     organization.PaymentGatewayApiUrl = model.PaymentGatewayApiUrl ?? "";
     organization.PaymentGatewayArbApiUrl = model.PaymentGatewayArbApiUrl ?? "";
     organization.PaymentGatewayApiKey = model.PaymentGatewayApiKey ?? "";
     organization.PaymentGatewayApiSecret = model.PaymentGatewayApiSecret ?? "";
     organization.PaymentGatewayType = model.PaymentGatewayType;
     organization.FacebookPageUrl = model.FacebookPageUrl;
     organization.TwitterName = model.TwitterName;
     organization.BlogRssUrl = model.BlogRssUrl;
     organization.VideoEmbedHtml = model.VideoEmbedHtml;
     organization.ThemeName = model.ThemeName;
 }
Example #2
0
        public ActionResult UpdateOrganization( OrganizationDetailsModel model )
        {
            using (OrganizationRepository)
            {
                var organization = OrganizationRepository.GetDefaultOrganization(readOnly: false);

                if (ModelState.IsValid)
                {
                    MapOrganizationUpdate(organization, model);
                    MapOrganizationSettings(organization, model.OrganizationSettings);
                    OrganizationRepository.Save();
                    TempData["UserFeedback"] = "Your changes have been saved. Please allow a few minutes for them to take effect.";
                    return RedirectToAction("Index", "Admin");
                }
            }

            TempData["OrganizationEditModel"] = model;
            return RedirectToAction( "EditOrganization", "Admin" );
        }