Esempio n. 1
0
        public int Add(SysMenu entity)
        {
            if (VerificationWidget.IsExit(nameof(SysMenu), nameof(SysMenu.MenuCode), entity.MenuCode, nameof(SysMenu.MenuID), entity.MenuID) ||
                VerificationWidget.IsExit(nameof(SysMenu), nameof(SysMenu.MenuName), entity.MenuName, nameof(SysMenu.MenuID), entity.MenuID))
            {
                return(OperationWidget.IsRepeated);
            }

            using (TransactionScope transaction = new TransactionScope())
            {
                if (handle.Add(entity) != OperationWidget.Success)
                {
                    return(OperationWidget.Failed);
                }

                transaction.Complete();
                return(OperationWidget.Success);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 增加菜单
 /// </summary>
 public int Add(SysMenuModel model)
 {
     return(menu_dal.Add(model));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(SysMenu model)
 {
     return(dal.Add(model));
 }