Beispiel #1
0
        public int Edit(SysMenu menu)
        {
            if (VerificationWidget.IsExit(nameof(SysMenu), nameof(SysMenu.MenuCode), menu.MenuCode, nameof(SysMenu.MenuID), menu.MenuID) ||
                VerificationWidget.IsExit(nameof(SysMenu), nameof(SysMenu.MenuName), menu.MenuName, nameof(SysMenu.MenuID), menu.MenuID))
            {
                return(OperationWidget.IsRepeated);
            }

            SysMenu entity = handle.Detail(menu.MenuID);

            using (TransactionScope transaction = new TransactionScope())
            {
                entity.ParentID  = menu.ParentID;
                entity.MenuName  = menu.MenuName;
                entity.MenuCode  = menu.MenuCode;
                entity.Status    = menu.Status;
                entity.Icon      = menu.Icon;
                entity.Url       = menu.Url;
                entity.SortNo    = menu.SortNo;
                entity.Operation = menu.Operation;

                if (handle.Edit(entity) != OperationWidget.Success)
                {
                    return(OperationWidget.Failed);
                }

                transaction.Complete();
                return(OperationWidget.Success);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(SysMenu model)
 {
     return(dal.Edit(model));
 }