本文整理汇总了C#中SoftProject.Domain.SoftProjectAreaEntityDomain.EditSaves方法的典型用法代码示例。如果您正苦于以下问题:C# SoftProjectAreaEntityDomain.EditSaves方法的具体用法?C# SoftProjectAreaEntityDomain.EditSaves怎么用?C# SoftProjectAreaEntityDomain.EditSaves使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoftProject.Domain.SoftProjectAreaEntityDomain
的用法示例。
在下文中一共展示了SoftProjectAreaEntityDomain.EditSaves方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Design_ModularOrFun_EditListSave
//public MyResponseBase Design_ModularOrFun_EditListSave()
//{
// MyResponseBase resp = new MyResponseBase();
// //(1)检查主键ID
// Design_ModularOrFun_PKCheck();
// Design_ModularOrFun_Domain();
// string DBFieldVals = "AreasCode,ControllCode,ModularOrFunCode,ModularName,Design_ModularOrFunParentID,GroupModularOrFun,Design_ModularPageID,ActionPath,PrimaryKey,SearchMethod";
// resp = EditSave(DBFieldVals);
// return resp;
//}
public MyResponseBase Design_ModularOrFun_EditListSave()
{
Design_ModularOrFun_Domain();
#region (2)修改功能模块字段
using (var scope = new TransactionScope())
{
try
{
SoftProjectAreaEntity hOperControl = new SoftProjectAreaEntity { };
#region (1)修改功能模块(无)
#endregion
#region (3)根据功能模块ID查询所有字段
var resptemp = Design_ModularOrFun_GetByModularOrFunParentID(3);
#endregion
#region (2)模块字段--数据整理
Item.Design_ModularOrFuns.ForEach(p =>
{
//p.Design_ModularOrFunParentID = Item.Design_ModularOrFunID;
//p.GroupModularOrFun = 3;
//if ( p.ParentPremID!=null)
//{
// p.BPrem = 1;
// //p.ParentPremID = Item.Design_ModularOrFunID;
//}
if (p.Design_ModularOrFunParentID == null)
p.Design_ModularOrFunParentID = Item.Design_ModularOrFunID;
if (p.GroupModularOrFun == null)
p.GroupModularOrFun = 3;
});
var deleteIDsEnum = (from p in resptemp.Items select p.Design_ModularOrFunID).Except(from o in Item.Design_ModularOrFuns select o.Design_ModularOrFunID);
var updateItems = Item.Design_ModularOrFuns.Where(p => p.Design_ModularOrFunID != null);
var addItems = Item.Design_ModularOrFuns.Where(p => p.Design_ModularOrFunID == null);
#endregion
#region (4)删除元素:执行删除,通过In进行删除
//需要写专门语句?delete xxx where ID IN(XXX)
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);//deleteForecastIDsEnum.ToArray()
var sql = string.Format("DELETE [dbo].[Design_ModularOrFun] WHERE Design_ModularOrFunID IN({0})", deleteIDs);
resptemp = Query16(sql, 1);
}
#endregion
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularOrFun_Domain();
//string DBFieldVals = "Sort,AreasCode,ControllCode,ModularOrFunCode,ModularName,Design_ModularOrFunParentID,GroupModularOrFun,Design_ModularPageID,ActionPath,PrimaryKey,SearchMethod,";
//DBFieldVals += "PageFormEleTypeName,QueryFormEleTypeName,BMenu,MenuName,PageType,ToolbarButtonAreaWidth,TableWidth,MenuParentID,SortCol,bFieldsConfigDisp,bPage,MenuPostion,MainView,PartialView,BPrem,ParentPremID,LoginCategoryID";
//BMenu,MenuName,PageType,TableWidth,ToolbarButtonAreaWidth
string DBFieldVals = "Sort,GroupModularOrFun,Design_ModularOrFunParentID,BMenu,MenuPostion,BMenuPanel,LoginCategoryID,ParentPremID,DataRightDropDown,bFieldsConfigDisp,PageFormEleTypeName,QueryFormEleTypeName,SortCol,bPage,PageType,ModularName,MenuName,BUrlNva,SearchMethod,ModularOrFunCode,MainView,PartialView,ToolbarButtonAreaWidth,TableWidth,BPrem,bValidModularOrFun,bNavModularOrFun,ModularOrFunRemarks,PremSort,PremName,TSql,DBOperTypeFun,ActionCode,PageTitle,TabViewName,TSqlDefaultSort,BCalCol,MenuIdent";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularOrFun_Domain();
//string DBFieldVals = "Sort,AreasCode,ControllCode,ModularOrFunCode,ModularName,Design_ModularOrFunParentID,GroupModularOrFun,Design_ModularPageID,ActionPath,PrimaryKey,SearchMethod,PageFormEleTypeName,QueryFormEleTypeName,BMenu";
//string DBFieldVals = "Sort,AreasCode,ControllCode,ModularOrFunCode,ModularName,Design_ModularOrFunParentID,GroupModularOrFun,Design_ModularPageID,ActionPath,PrimaryKey,SearchMethod,";
//DBFieldVals += "PageFormEleTypeName,QueryFormEleTypeName,BMenu,MenuName,PageType,ToolbarButtonAreaWidth,TableWidth,MenuParentID,SortCol,bFieldsConfigDisp,bPage,MenuPostion,MainView,PartialView,BPrem,ParentPremID,LoginCategoryID";
string DBFieldVals = "Sort,GroupModularOrFun,Design_ModularOrFunParentID,BMenu,MenuPostion,BMenuPanel,LoginCategoryID,ParentPremID,DataRightDropDown,bFieldsConfigDisp,PageFormEleTypeName,QueryFormEleTypeName,SortCol,bPage,PageType,ModularName,MenuName,BUrlNva,SearchMethod,ModularOrFunCode,MainView,PartialView,ToolbarButtonAreaWidth,TableWidth,BPrem,bValidModularOrFun,bNavModularOrFun,ModularOrFunRemarks,PremSort,PremName,TSql,DBOperTypeFun,ActionCode,PageTitle,TabViewName,TSqlDefaultSort,BCalCol,MenuIdent";
domain.AddSaves(DBFieldVals);
}
#endregion
ProjectCache.Design_ModularOrFuns_Clear();
scope.Complete();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
//.........这里部分代码省略.........
示例2: Design_ModularOrFunControll_EditListSave
public MyResponseBase Design_ModularOrFunControll_EditListSave()
{
Design_ModularOrFunControll_Domain();
#region (2)修改功能模块字段
using (var scope = new TransactionScope())
{
try
{
SoftProjectAreaEntity hOperControl = new SoftProjectAreaEntity { };
#region (1)修改功能模块(无)
#endregion
#region (3)根据功能模块ID查询所有字段
var resptemp = Design_ModularOrFunControll_GetByModularOrFunID();
#endregion
#region (2)模块字段--数据整理
Item.Design_ModularOrFunControlls.ForEach(p =>
{ p.Design_ModularOrFunID = Item.Design_ModularOrFunID; });
var deleteIDsEnum = (from p in resptemp.Items select p.Design_ModularOrFunControllID).Except(from o in Item.Design_ModularOrFunControlls select o.Design_ModularOrFunControllID);
var updateItems = Item.Design_ModularOrFunControlls.Where(p => p.Design_ModularOrFunControllID != null);
var addItems = Item.Design_ModularOrFunControlls.Where(p => p.Design_ModularOrFunControllID == null);
#endregion
#region (4)删除元素:执行删除,通过In进行删除
//需要写专门语句?delete xxx where ID IN(XXX)
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);//deleteForecastIDsEnum.ToArray()
var sql = string.Format("DELETE [dbo].[Design_ModularOrFunControll] WHERE Design_ModularOrFunControllID IN({0})", deleteIDs);
resptemp = Query16(sql, 1);
}
#endregion
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularOrFunControll_Domain();
//var DBFieldVals = "Sort,Design_ModularOrFunID,Design_ModularOrFunID1,Design_ModularOrFunDomainID,ControllName,ControllActionPath,ActionMethod,ActionName,ParamName,ViewName,ControllProgramCode,BPrem,ActionMethodCn,DataRightDict,BMenu,ToolbarButtonAreaWidth,TableWidth,ControllModularOrFunCode";
var DBFieldVals = "Sort,Design_ModularOrFunID,Design_ModularOrFunID1,Design_ModularOrFunDomainID,ControllName,ActionMethod,ParamName,BPrem,ActionMethodCn,DataRightDict,ControllModularOrFunCode,ControllProgramCode,ActionName,ViewName";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularOrFunControll_Domain();
//var DBFieldVals = "Sort,Design_ModularOrFunID,Design_ModularOrFunID1,Design_ModularOrFunDomainID,ControllName,ControllActionPath,ActionMethod,ActionName,ParamName,ViewName,ControllProgramCode,BPrem,ActionMethodCn,DataRightDict,BMenu,ToolbarButtonAreaWidth,TableWidth";
var DBFieldVals = "Sort,Design_ModularOrFunID,Design_ModularOrFunID1,Design_ModularOrFunDomainID,ControllName,ActionMethod,ParamName,BPrem,ActionMethodCn,DataRightDict,ControllModularOrFunCode,ControllProgramCode,ActionName,ViewName";
domain.AddSaves(DBFieldVals);
}
#endregion
scope.Complete();
ProjectCache.Design_ModularOrFunBtnControlls_Clear();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
#endregion
return resp;
}
示例3: Design_ModularOrFunRefBtn_EditListSave
public MyResponseBase Design_ModularOrFunRefBtn_EditListSave()
{
Design_ModularOrFunRefBtn_Domain();
#region (2)修改功能模块字段
using (var scope = new TransactionScope())
{
try
{
SoftProjectAreaEntity hOperControl = new SoftProjectAreaEntity { };
#region (1)修改功能模块(无)
#endregion
#region (3)根据功能模块ID查询所有字段
var resptemp = Design_ModularOrFunRefBtn_GetByPremSetID();
#endregion
#region (2)模块字段--数据整理
Item.Items.ForEach(p =>
{ p.Design_PremSetID = Item.Design_PremSetID; });
var deleteIDsEnum = (from p in resptemp.Items select p.Design_ModularOrFunRefBtnID).Except(from o in Item.Items select o.Design_ModularOrFunRefBtnID);//.ToList();
var updateItems = Item.Items.Where(p => p.Design_ModularOrFunRefBtnID != null && !deleteIDsEnum.Contains(p.Design_ModularOrFunRefBtnID));
var addItems = Item.Items.Where(p => p.Design_ModularOrFunRefBtnID == null);
#endregion
#region (4)删除元素:执行删除,通过In进行删除
//需要写专门语句?delete xxx where ID IN(XXX)
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);//deleteForecastIDsEnum.ToArray()
var sql = string.Format("DELETE [dbo].[Design_ModularOrFunRefBtn] WHERE Design_ModularOrFunRefBtnID IN({0})", deleteIDs);
resptemp = Query16(sql, 1);
}
#endregion
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularOrFunRefBtn_Domain();
var DBFieldVals = "Design_PremSetID,Design_ModularOrFunBtnID,PremSetBtnSort";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularOrFunRefBtn_Domain();
var DBFieldVals = "Design_PremSetID,Design_ModularOrFunBtnID,PremSetBtnSort";
domain.AddSaves(DBFieldVals);
}
#endregion
scope.Complete();
ProjectCache.ClearDesign_ModularOrFunRefBtns();
//ProjectCache.Sys_PremSetsAll_Clear();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
#endregion
return resp;
}
示例4: Design_ModularOrFunDomainDetail_EditSave
public MyResponseBase Design_ModularOrFunDomainDetail_EditSave()
{
MyResponseBase resp = new MyResponseBase();
Design_ModularOrFunDomainDetail_Domain();
#region (2)修改顾客
using (var scope = new TransactionScope())
{
try
{
#region (3)根据功能模块ID查询所有字段
var Design_ModularOrFunDomainDetails = Design_ModularOrFunDomainDetail_GetByModularOrFunDomainID();
#endregion
#region (2)模块字段--数据整理
//Item.Design_Design_ModularOrFunDomainDetails.ForEach(p =>
//{ p.Design_ModularPageID = Item.Design_ModularPageID; });
Item.Items.ForEach(p => p.Design_ModularOrFunDomainID = Item.Design_ModularOrFunDomainID);
var deleteIDsEnum = (from p in Design_ModularOrFunDomainDetails select p.Design_ModularOrFunDomainDetailID).Except(from o in Item.Items select o.Design_ModularOrFunDomainDetailID);
var updateItems = Item.Items.Where(p => p.Design_ModularOrFunDomainDetailID != null);
var addItems = Item.Items.Where(p => p.Design_ModularOrFunDomainDetailID == null);
#endregion
MyResponseBase resptemp = new MyResponseBase();
#region (4)删除元素:执行删除,通过In进行删除
//需要写专门语句?delete xxx where ID IN(XXX)
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);//deleteForecastIDsEnum.ToArray()
var sql = string.Format("DELETE [dbo].[Design_ModularOrFunDomainDetail] WHERE Design_ModularOrFunDomainDetailID IN({0})", deleteIDs);
resptemp = Query16(sql, 1);
}
#endregion
var DBFieldVals = "";
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularOrFunDomainDetail_Domain();
DBFieldVals = "ModularOrFunDomainDetailName,Design_ModularOrFunDomainID,DomainType,DBOperCode,Serial,ParamName";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularOrFunDomainDetail_Domain();
DBFieldVals = "ModularOrFunDomainDetailName,Design_ModularOrFunDomainID,DomainType,DBOperCode,Serial,ParamName";
domain.AddSaves(DBFieldVals);
}
#endregion
scope.Complete();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
#endregion
return resp;
}
示例5: Design_ModularOrFunBtn_EditListSave
public MyResponseBase Design_ModularOrFunBtn_EditListSave()
{
Design_ModularOrFunBtn_Domain();
#region (2)修改功能模块字段
using (var scope = new TransactionScope())
{
try
{
SoftProjectAreaEntity hOperControl = new SoftProjectAreaEntity { };
#region (1)修改功能模块(无)
#endregion
#region (3)根据功能模块ID查询所有字段
var resptemp = Design_ModularOrFunBtn_GetByModularOrFunID();
#endregion
#region (2)模块字段--数据整理
Item.Design_ModularOrFunBtns.ForEach(p =>
{ p.Design_ModularOrFunID = Item.Design_ModularOrFunID; });
var deleteIDsEnum = (from p in resptemp.Items select p.Design_ModularOrFunBtnID).Except(from o in Item.Design_ModularOrFunBtns select o.Design_ModularOrFunBtnID);
var updateItems = Item.Design_ModularOrFunBtns.Where(p => p.Design_ModularOrFunBtnID != null);
var addItems = Item.Design_ModularOrFunBtns.Where(p => p.Design_ModularOrFunBtnID == null);
#endregion
#region (4)删除元素:执行删除,通过In进行删除
//需要写专门语句?delete xxx where ID IN(XXX)
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);//deleteForecastIDsEnum.ToArray()
var sql = string.Format("DELETE [dbo].[Design_ModularOrFunBtn] WHERE Design_ModularOrFunBtnID IN({0})", deleteIDs);
resptemp = Query16(sql, 1);
}
#endregion
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularOrFunBtn_Domain();
var DBFieldVals = "Sort,Design_ModularOrFunID,BtnNameEn,BtnNameCn,OperPos,BtnBehavior,PopupAfterTableFun,popupaddrepeat,PopupWidth,DispConditionsExpression,bValid,BtnType,ModularOrFunBtnRemark";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularOrFunBtn_Domain();
var DBFieldVals = "Sort,Design_ModularOrFunID,BtnNameEn,BtnNameCn,OperPos,BtnBehavior,PopupAfterTableFun,popupaddrepeat,PopupWidth,DispConditionsExpression,bValid,BtnType,ModularOrFunBtnRemark";
domain.AddSaves(DBFieldVals);
}
#endregion
scope.Complete();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
#endregion
return resp;
}
示例6: Design_ModularPageField_EditListSave
//.........这里部分代码省略.........
sqlfields += "Query31Pos,Query31FormEleType,Query31QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query32")
{
sqlfields += "Query32Pos,Query32FormEleType,Query32QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query33")
{
sqlfields += "Query33Pos,Query33FormEleType,Query33QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query34")
{
sqlfields += "Query34Pos,Query34FormEleType,Query34QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query35")
{
sqlfields += "Query35Pos,Query35FormEleType,Query35QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query36")
{
sqlfields += "Query36Pos,Query36FormEleType,Query36QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query37")
{
sqlfields += "Query37Pos,Query37FormEleType,Query37QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query38")
{
sqlfields += "Query38Pos,Query38FormEleType,Query38QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query39")
{
sqlfields += "Query39Pos,Query39FormEleType,Query39QueryType,";
}
if (resp1.Items[m].QueryFormEleTypeName == "Query40")
{
sqlfields += "Query40Pos,Query40FormEleType,Query40QueryType,";
}
#endregion
}
if (sqlfields.Length > 0)
{
sqlfields = sqlfields.Trim();
sqlfields = sqlfields.Substring(0, sqlfields.Length - 1);
}
DBFieldVals = "Design_ModularOrFunID,TableInfoSort,FieldFunTypeID,cssclass,calcol,calrow,bTabVer,Design_ModularFieldID,FormEleType,EditAreaName,Design_ModularPageID,AdditionalInfo,";
DBFieldVals += sqlfields;
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularPageField_Domain();
//DBFieldVals = "Design_ModularOrFunID,TableInfoSort,FieldFunTypeID,cssclass,calcol,calrow,bTabVer,Design_ModularFieldID,FormEleType,EditAreaName,Design_ModularPageID,";
//Page01FormEleSort,Page01FormElePos,Page01FormEleType,Page02FormEleSort,Page02FormElePos,Page02FormEleType,Page03FormEleSort,Page03FormElePos,Page03FormEleType,";
//DBFieldVals += "Page04FormEleSort,Page04FormElePos, Page04FormEleType,Page05FormEleSort,Page05FormElePos,Page05FormEleType,Page06FormEleSort,Page06FormElePos,Page06FormEleType,";
//DBFieldVals += "Page07FormEleSort,Page07FormElePos, Page07FormEleType,Page08FormEleSort,Page08FormElePos,Page08FormEleType,Page09FormEleSort,Page09FormElePos,Page09FormEleType,";
//DBFieldVals += "Page10FormEleSort,Page10FormElePos, Page10FormEleType,";
//DBFieldVals += "Query01Pos,Query01FormEleType,Query01QueryType,Query02Pos,Query02FormEleType,Query02QueryType,Query03Pos,Query03FormEleType,Query03QueryType,Query04Pos,Query04FormEleType,Query04QueryType,";
//DBFieldVals += "Query05Pos, Query05FormEleType,Query05QueryType,Query06Pos,Query06FormEleType,Query06QueryType,Query07Pos,Query07FormEleType,Query07QueryType,Query08Pos,Query08FormEleType,Query08QueryType,Query09Pos,Query09FormEleType,Query09QueryType,Query10Pos,Query10FormEleType,Query10QueryType,";
//DBFieldVals += "Sort01,Sort02,Sort03,Sort04,Sort05,Sort06,Sort07,Sort08,Sort09,Sort10";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularPageField_Domain();
//DBFieldVals = "Design_ModularOrFunID,TableInfoSort,FieldFunTypeID,cssclass,calcol,calrow,bTabVer,Design_ModularFieldID,FormEleType,Page01FormEleSort,Page01FormElePos,Page01FormEleType,Page02FormEleSort,Page02FormElePos,Page02FormEleType,Page03FormEleSort,Page03FormElePos,Page03FormEleType,";
//DBFieldVals += "Page04FormEleSort,Page04FormElePos, Page04FormEleType,Page05FormEleSort,Page05FormElePos,Page05FormEleType,Page06FormEleSort,Page06FormElePos,Page06FormEleType,";
//DBFieldVals += "Page07FormEleSort,Page07FormElePos, Page07FormEleType,Page08FormEleSort,Page08FormElePos,Page08FormEleType,Page09FormEleSort,Page09FormElePos,Page09FormEleType,";
//DBFieldVals += "Page10FormEleSort,Page10FormElePos, Page10FormEleType,EditAreaName,Design_ModularPageID,";
//DBFieldVals += "Query01Pos,Query01FormEleType,Query01QueryType,Query02Pos,Query02FormEleType,Query02QueryType,Query03Pos,Query03FormEleType,Query03QueryType,Query04Pos,Query04FormEleType,Query04QueryType,";
//DBFieldVals += "Query05Pos, Query05FormEleType,Query05QueryType,Query06Pos,Query06FormEleType,Query06QueryType,Query07Pos,Query07FormEleType,Query07QueryType,Query08Pos,Query08FormEleType,Query08QueryType,Query09Pos,Query09FormEleType,Query09QueryType,Query10Pos,Query10FormEleType,Query10QueryType,";
//DBFieldVals += "Sort01,Sort02,Sort03,Sort04,Sort05,Sort06,Sort07,Sort08,Sort09,Sort10";
domain.AddSaves(DBFieldVals);
}
#endregion
ProjectCache.Design_ModularPageFields_Clear();
scope.Complete();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
#endregion
return resp;
}
示例7: Design_ModularField_EditListSave
public MyResponseBase Design_ModularField_EditListSave()
{
Design_ModularField_Domain();
#region (2)修改功能模块字段
using (var scope = new TransactionScope())
{
try
{
SoftProjectAreaEntity hOperControl = new SoftProjectAreaEntity { };
#region (1)修改功能模块(无)
#endregion
#region (3)根据功能模块ID查询所有字段
var resptemp = Design_ModularField_GetByModularOrFunID();
#endregion
#region (2)模块字段--数据整理
Item.Design_ModularFields.ForEach(p =>
{ p.Design_ModularOrFunID = Item.Design_ModularOrFunID; });
var deleteIDsEnum = (from p in resptemp.Items select p.Design_ModularFieldID).Except(from o in Item.Design_ModularFields select o.Design_ModularFieldID);
var updateItems = Item.Design_ModularFields.Where(p => p.Design_ModularFieldID != null);
var addItems = Item.Design_ModularFields.Where(p => p.Design_ModularFieldID == null);
#endregion
#region (4)删除元素:执行删除,通过In进行删除
//需要写专门语句?delete xxx where ID IN(XXX)
if (deleteIDsEnum.Count() > 0)
{
var deleteIDs = string.Join(",", deleteIDsEnum);//deleteForecastIDsEnum.ToArray()
var sql = string.Format("DELETE [dbo].[Design_ModularField] WHERE Design_ModularFieldID IN({0})", deleteIDs);
resptemp = Query16(sql, 1);
}
#endregion
#region (5)更新模块字段
if (updateItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = updateItems.ToList() };
domain.Design_ModularField_Domain();
var DBFieldVals = "Design_ModularOrFunID,FieldTypeID,name,NameCn,xtype,length,QueryEn,QueryCn,Dicts,Calformula,Sort,Width,Align,DisFormat,NameCn2,Required,DefaultValue,bPrimaryKeyOrFK,bOperLog,bRepeat,ModularFieldRemark";
domain.EditSaves(DBFieldVals);
}
#endregion
#region (6)添加
if (addItems.Count() > 0)
{
SoftProjectAreaEntityDomain domain = new SoftProjectAreaEntityDomain { Items = addItems.ToList() };
domain.Design_ModularField_Domain();
var DBFieldVals = "Design_ModularOrFunID,FieldTypeID,name,NameCn,xtype,length,QueryEn,QueryCn,Dicts,Calformula,Sort,Width,Align,DisFormat,NameCn2,Required,DefaultValue,bPrimaryKeyOrFK,bOperLog,bRepeat,ModularFieldRemark";
domain.AddSaves(DBFieldVals);
}
#endregion
scope.Complete();
ProjectCache.Design_ModularPageFields_Clear();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
scope.Dispose();
}
}
#endregion
return resp;
}