예제 #1
0
        protected void SaveDetailEntities(List <DetailObjectInfo> detailList)
        {
            if (detailList == null)
            {
                return;
            }

            foreach (var detailInfo in detailList)
            {
                IDataAccessBase da = EntityFactory.GetEntityDataAccessByName(detailInfo.EntityName, detailInfo.AdditionalDataKey);
                da.AutoSave = false;
                if (detailInfo.FnName == RuleFunctionSEnum.Insert)
                {
                    da.Insert(detailInfo.EntitySet, new InsertParameters());
                }
                else if (detailInfo.FnName == RuleFunctionSEnum.Update)
                {
                    da.Update(detailInfo.EntitySet, new UpdateParameters());
                }
                else if (detailInfo.FnName == RuleFunctionSEnum.Delete)
                {
                    da.Delete(detailInfo.EntitySet, new DeleteParameters());
                }
                else
                {
                    throw new Exception("Function " + detailInfo.FnName + " is not defined in DataAccessLayer");
                }
            }
        }
예제 #2
0
 public virtual T Update(T entity)
 {
     return(_dataAccessBase.Update(entity));
 }
예제 #3
0
 /// <summary>
 /// 修改菜单信息
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool UpdateMenu(MenuModel menuModel, int id)
 {
     return(_dbContext.Update(menuModel, id));
 }