本文整理汇总了C#中SoftProject.Domain.SoftProjectAreaEntityDomain.ExecuteEnums方法的典型用法代码示例。如果您正苦于以下问题:C# SoftProjectAreaEntityDomain.ExecuteEnums方法的具体用法?C# SoftProjectAreaEntityDomain.ExecuteEnums怎么用?C# SoftProjectAreaEntityDomain.ExecuteEnums使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoftProject.Domain.SoftProjectAreaEntityDomain
的用法示例。
在下文中一共展示了SoftProjectAreaEntityDomain.ExecuteEnums方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Pre_RolePremSet_AddUpdateDeleteSaves
/// <summary>
/// 用户管理:添加、修改、删除
/// </summary>
/// <returns></returns>
public MyResponseBase Pre_RolePremSet_AddUpdateDeleteSaves()
{
using (var scope = new TransactionScope())
{
try
{
//(1)根据用户ID查询:用户角色
Sys_HOperControl = null;
OperCode = "Pre_RolePremSet.ByRoleID";
var OldItems = Execute().Items;
if (Item.Items == null)
Item.Items = new List<SoftProjectAreaEntity>();
#region (2)数据整理
Item.Items.ForEach(p => p.Pre_RoleID = Item.Pre_RoleID);
var deleteIDsEnum = (from p in OldItems select p.Pre_RolePremSetID).Except(from o in Item.Items select o.Pre_RolePremSetID);
var updateItems = Item.Items.Where(p => p.Pre_RolePremSetID != null && !deleteIDsEnum.Contains(p.Pre_RolePremSetID));
var addItems = Item.Items.Where(p => p.Pre_RolePremSetID == null);
#endregion
//return null;
#region (3)删除
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);
var sql = string.Format("DELETE [dbo].[Pre_RolePremSet] WHERE Pre_RolePremSetID IN({0})", deleteIDs);
var resptemp = Query16(sql, 1);
}
#endregion
#region 更新
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Pre_RolePremSet_Domain();
var operCode = "Pre_RolePremSet.EditSave";
var resptemp = domain.ExecuteEnums(operCode);
}
#endregion
#region 添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Pre_RolePremSet_Domain();
var operCode = "Pre_RolePremSet.AddSave";
var resptemp = domain.ExecuteEnums(operCode);
}
#endregion
scope.Complete();
SoftProjectAreaEntityDomain.Pre_RolePremSetAll_Clare();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
return resp;
}