Example #1
0
 public void UpdateFunction(T_S_Function f)
 {
     using (var uow = GetUnitOfWork())
     {
         uow.Repository <T_S_Function>().Update(f);
         uow.Save();
     }
 }
Example #2
0
 public void AddFunction(T_S_Function f)
 {
     using (var uow = GetUnitOfWork())
     {
         f.FunctionId = Guid.NewGuid();
         uow.Repository <T_S_Function>().Insert(f);
         uow.Save();
     }
 }
Example #3
0
        public static string BuildFunctionTreeItem(T_S_Function item)
        {
            var menuItemClass    = "tree-item";
            var subMenuItemClass = "tree-sub-item";
            var content          = new StringBuilder();

            content.Append(
                string.Format(
                    "<div class=\"{0}\"><label><input type=\"checkbox\" data-fid=\"{2}\"/><span>{1}</span></label></div>",
                    menuItemClass, item.Name, item.FunctionId));
            if (item.SubMenus.Count > 0)
            {
                var subMenus = new StringBuilder();
                item.SubMenus.OrderBy(x => x.Seq).ToList()
                .ForEach(x => subMenus.Append(BuildFunctionTreeItem(x)));
                content.Append(string.Format("<ul  class=\" {1}\">{0}</ul>", subMenus.ToString(), subMenuItemClass));
            }
            return(string.Format("<li>{0}</li>", content.ToString()));
        }
Example #4
0
        public static string BuildMenuItem(T_S_Function item)
        {
            var menuItemClass    = "J_menuItem";
            var subMenuItemClass = "nav-second-level";
            var content          = new StringBuilder();

            if (!item.IsParent)
            {
                content.Append(string.Format("<a class=\"{3}\" href=\"{0}\"><i class=\"fa {1}\"></i> <span class=\"nav-label\">{2}</span></a>", item.Url, item.Icon, item.Name, menuItemClass));
            }
            else
            {
                content.Append(string.Format("<a href=\"{0}\"><i class=\"fa {1}\"></i><span class=\"nav-label\">{2}</span><span class=\"fa arrow\"></span></a>", item.Url, item.Icon, item.Name));
            }
            if (item.SubMenus.Count > 0)
            {
                var subMenus = new StringBuilder();
                item.SubMenus.OrderBy(x => x.Seq).ToList()
                .ForEach(x => subMenus.Append(BuildMenuItem(x)));
                content.Append(string.Format("<ul  class=\"nav {1}\">{0}</ul>", subMenus.ToString(), subMenuItemClass));
            }
            return(string.Format("<li>{0}</li>", content.ToString()));
        }
Example #5
0
 public ActionResult UpdateFunction(T_S_Function item)
 {
     BS.UpdateFunction(item);
     return(Json(""));
 }
Example #6
0
 public ActionResult AddFunction(T_S_Function item)
 {
     BS.AddFunction(item);
     return(Json(""));
 }