Ejemplo n.º 1
0
 public ActionResult Edit(Config config)
 {
     if (config != null)
     {
         if (!string.IsNullOrEmpty(config.Name) &&
             !string.IsNullOrEmpty(config.Title))
         {
             Config model = ConfigManager.GetConfig();
             if (model != null)
             {
                 model.Name = config.Name;
                 model.Title = config.Title;
                 model.Keywords = config.Keywords;
                 model.Description = config.Description;
                 model.Tel = config.Tel;
                 model.Phone = config.Phone;
                 model.Domain = config.Domain;
                 model.Email = config.Email;
                 model.QQ1 = config.QQ1;
                 model.QQ2 = config.QQ2;
                 model.QQ3 = config.QQ3;
                 model.Address = config.Address;
                 model.Company = config.Company;
                 model.Weixin = config.Weixin;
                 model.ICP = config.ICP;
                 model.StatisticalCode = config.StatisticalCode;
                 ConfigManager.EditConfig(model);
                 Witbird.SHTS.Web.Public.StaticUtility.UpdateConfig();
             }
         }
     }
     return Redirect("/admin/config/index");
 }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            Config model = new Config();

            model = ConfigManager.GetConfig();

            if (model == null)
            {
                model = new Config();
            }
            return View(model);
        }
Ejemplo n.º 3
0
 public static bool EditConfig(Config config)
 {
     bool result = false;
     try
     {
         if (config != null)
         {
             ConfigRepository configRepository = new ConfigRepository();
             result = configRepository.UpdateEntitySave(config);
         }
     }
     catch (Exception e)
     {
         LogService.Log("编辑配置信息失败", e.ToString());
     }
     return result;
 }
Ejemplo n.º 4
0
 public static void UpdateConfig()
 {
     config = ConfigManager.GetConfig();
 }