Exemple #1
0
        // GET: WebSite

        /// <summary>
        /// 站点设置
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var web = mangae.db.TG_WebSite.FirstOrDefault();

            if (web == null)
            {
                web = new TG_WebSite();
            }
            ViewBag.bIsSuper = LoginStatus.bIsSuper;
            return(View(web));
        }
Exemple #2
0
 /// <summary>
 /// 站点设置
 /// </summary>
 /// <param name="webSite"></param>
 public void Set(TG_WebSite webSite)
 {
     if (webSite.ID == 0)
     {//添加
         mangae.Add <TG_WebSite>(webSite);
         result.success = mangae.SaveChange();
     }
     else
     {//编辑
         mangae.Edit <TG_WebSite>(webSite);
         result.success = mangae.SaveChange();
     }
 }
 /// <summary>
 /// 站点设置
 /// </summary>
 /// <param name="webSite"></param>
 public void Set(TG_WebSite webSite)
 {
     if (LoginStatus.iUserType == 0)
     {
         if (string.IsNullOrEmpty(LoginStatus.sCategoryIds) || LoginStatus.sCategoryIds.Contains("a") == false)
         {
             result.info = "您没有权限操作";
         }
         else
         {
             if (webSite.ID == 0)
             {//添加
                 mangae.Add <TG_WebSite>(webSite);
                 result.success = mangae.SaveChange();
             }
             else
             {//编辑
                 mangae.Edit <TG_WebSite>(webSite);
                 result.success = mangae.SaveChange();
             }
         }
     }
     else
     {
         if (webSite.ID == 0)
         {//添加
             mangae.Add <TG_WebSite>(webSite);
             result.success = mangae.SaveChange();
         }
         else
         {//编辑
             mangae.Edit <TG_WebSite>(webSite);
             result.success = mangae.SaveChange();
         }
     }
 }