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); } }
/// <summary> /// 增加菜单 /// </summary> public int Add(SysMenuModel model) { return(menu_dal.Add(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(SysMenu model) { return(dal.Add(model)); }