Exemplo n.º 1
0
        public ActionResult ToggleWhitelist(int id, bool state)
        {
            Links link = LinksBll.GetById(id);

            link.Except = !state;
            bool b = LinksBll.UpdateEntitySaved(link);

            return(ResultData(null, b, b ? "切换成功!" : "切换失败!"));
        }
Exemplo n.º 2
0
        public ActionResult Toggle(int id, bool state)
        {
            Links link = LinksBll.GetById(id);

            link.Status = !state ? Status.Available : Status.Unavailable;
            bool b = LinksBll.UpdateEntitySaved(link);

            return(ResultData(null, b, b ? "切换成功!" : "切换失败!"));
        }
Exemplo n.º 3
0
        public ActionResult Edit(Links model)
        {
            Links links = LinksBll.GetById(model.Id);

            links.Name = model.Name;
            links.Url  = model.Url;
            bool b = LinksBll.UpdateEntitySaved(links);

            return(ResultData(null, b, b ? "保存成功" : "保存失败"));
        }