Beispiel #1
0
        /// <summary>
        /// 查看该主链接关联的参数
        /// </summary>
        public ActionResult List(int id)
        {
            RouterConfigManager manager = new RouterConfigManager();

            if (id != 0)
            {
                return(View(manager.GetLinkList(id)));
            }
            return(null);
        }
Beispiel #2
0
 public ActionResult EditParameter(int id)
 {
     if (id == 0)
     {
         return(View(new RouterParameter()));
     }
     else
     {
         RouterConfigManager manager = new RouterConfigManager();
         return(View(manager.GetParameter(id)));
     }
 }
Beispiel #3
0
 public ActionResult EditMainLink(int id)
 {
     if (id == 0)
     {
         return(View(new RouterMainLink()));
     }
     else
     {
         RouterConfigManager manager = new RouterConfigManager();
         return(View(manager.GetMainLink(id)));
     }
 }
Beispiel #4
0
        /// <summary>
        /// 删除选中的主链接
        /// </summary>
        public ActionResult DeleteMainLink(int id)
        {
            RouterConfigManager manager = new RouterConfigManager();
            var before = manager.GetMainLink(id);

            if (manager.DeleteMainLink(id))
            {
                LoggerManager.InsertOplog(new ConfigHistory()
                {
                    AfterValue = "", Author = User.Identity.Name, BeforeValue = JsonConvert.SerializeObject(before), ChangeDatetime = DateTime.Now, ObjectID = id.ToString(), ObjectType = "MainLink", Operation = "删除主链接配置-" + before.Discription + "-" + before.Content
                });
                return(Json(1));
            }

            return(Json(0));
        }
Beispiel #5
0
 public ActionResult EditLink(int id, int mId)
 {
     if (id == 0)
     {
         RouterConfigManager manager = new RouterConfigManager();
         return(View(new RouterLink()
         {
             MainLink = manager.GetMainLink(mId), RouterParameterList = manager.GetParameterList(mId)
         }));
     }
     else
     {
         RouterConfigManager manager = new RouterConfigManager();
         return(View(manager.GetLink(id)));
     }
 }
Beispiel #6
0
        // GET: RouterConfig
        //配置工具的配置功能

        /// <summary>
        /// 查询所有主链接及参数
        /// </summary>
        public ActionResult Index(int linkKind)
        {
            RouterConfigManager manager = new RouterConfigManager();

            if (linkKind == 0)
            {
                return(View(manager.GetList()));
            }
            if (linkKind == 1)
            {
                return(View(manager.GetListForApp()));
            }
            if (linkKind == 2)
            {
                return(View(manager.GetListForWeixin()));
            }
            return(null);
        }
Beispiel #7
0
        /// <summary>
        /// 保存链接关系的新增或修改操作
        /// </summary>
        public ActionResult LinkSave(RouterLink model)
        {
            RouterConfigManager manger = new RouterConfigManager();

            if (model.PKID == 0)
            {
                if (manger.AddLink(model))
                {
                    LoggerManager.InsertOplog(new ConfigHistory()
                    {
                        AfterValue = JsonConvert.SerializeObject(model), Author = User.Identity.Name, BeforeValue = "", ChangeDatetime = DateTime.Now, ObjectID = model.PKID.ToString(), ObjectType = "Link", Operation = "新增链接参数配置,id:" + model.PKID
                    });
                    return(Json(1));
                }
                else
                {
                    return(Json(0));
                }
            }
            else
            {
                var before = manger.GetLink(model.PKID);
                if (manger.UpdateLink(model))
                {
                    LoggerManager.InsertOplog(new ConfigHistory()
                    {
                        AfterValue = JsonConvert.SerializeObject(model), Author = User.Identity.Name, BeforeValue = JsonConvert.SerializeObject(before), ChangeDatetime = DateTime.Now, ObjectID = model.PKID.ToString(), ObjectType = "Link", Operation = "编辑链接参数配置,id:" + model.PKID
                    });
                    return(Json(1));
                }
                else
                {
                    return(Json(0));
                }
            }
        }