//构造更新的数据 /// <summary> /// 构造更新的数据 /// </summary> private List <RightLkFunctionGroup> BuildUpdateEntity() { var updateList = new List <RightLkFunctionGroup>(); var groupSysid = UI.GetValue(ddlFunctionGroup); for (var i = 0; i < gridViewSel.Rows.Count; i++) { var rightFunction = gridViewSel.Rows[i].DataBoundItem as RightFunction; if (rightFunction == null) { continue; } var findInDb = _selectedFunctionsInDb.FindAll(p => p.Sysid == rightFunction.Sysid); if (findInDb.Count <= 0) { continue; } var rightLKFunctionGroup = new RightLkFunctionGroup { GroupSysid = groupSysid, FunctionSysid = rightFunction.Sysid, Sequence = rightFunction.Sequence }; updateList.Add(rightLKFunctionGroup); } return(updateList); }
public static bool Delete(RightLkFunctionGroup rightLKFunctionGroup, SqlConnection conn, SqlTransaction trans) { const string sql = @" DELETE FROM T_RIGHT WHERE FUNCTION_SYSID=@FunctionSysid AND FUNCTION_GROUP_SYSID=@GroupSysid "; return Dapper.Save(rightLKFunctionGroup, sql, conn, trans); }
public static bool Insert(RightLkFunctionGroup rightLkFunctionGroup, SqlConnection conn, SqlTransaction trans) { const string sql = @" INSERT INTO T_RIGHT_LK_FUNCTION_GROUP(GROUP_SYSID,FUNCTION_SYSID,SEQUENCE) VALUES(@GroupSysid,@FunctionSysid,@Sequence) "; return Dapper.Save(rightLkFunctionGroup, sql, conn, trans); }
//构造删除的数据 /// <summary> /// 构造删除的数据 /// </summary> private List <RightLkFunctionGroup> BuildDeleteEntity() { var deleteList = new List <RightLkFunctionGroup>(); var groupSysid = UI.GetValue(ddlFunctionGroup); for (var i = 0; i < _selectedFunctionsInDb.Count; i++) { var rightFunction = _selectedFunctionsInDb[i]; var findInDb = SelectedFunctions.FindAll(p => p.Sysid == rightFunction.Sysid); if (findInDb.Count > 0) { continue; } var rightLKFunctionGroup = new RightLkFunctionGroup { GroupSysid = groupSysid, FunctionSysid = rightFunction.Sysid, Sequence = rightFunction.Sequence }; deleteList.Add(rightLKFunctionGroup); } return(deleteList); }
//构造更新的数据 /// <summary> /// 构造更新的数据 /// </summary> private List<RightLkFunctionGroup> BuildUpdateEntity() { var updateList = new List<RightLkFunctionGroup>(); var groupSysid = UI.GetValue(ddlFunctionGroup); for (var i = 0; i < gridViewSel.Rows.Count; i++) { var rightFunction = gridViewSel.Rows[i].DataBoundItem as RightFunction; if (rightFunction == null) continue; var findInDb = _selectedFunctionsInDb.FindAll(p => p.Sysid == rightFunction.Sysid); if (findInDb.Count <= 0) continue; var rightLKFunctionGroup = new RightLkFunctionGroup { GroupSysid = groupSysid, FunctionSysid = rightFunction.Sysid, Sequence = rightFunction.Sequence }; updateList.Add(rightLKFunctionGroup); } return updateList; }
//构造新增的数据 /// <summary> /// 构造新增的数据 /// </summary> private List<RightLkFunctionGroup> BuildInsertEntity() { var insertList = new List<RightLkFunctionGroup>(); var groupSysid = UI.GetValue(ddlFunctionGroup); for (var i = 0; i < SelectedFunctions.Count; i++) { var rightFunction = SelectedFunctions[i]; var findInDb = _selectedFunctionsInDb.FindAll(p => p.Sysid == rightFunction.Sysid); if (findInDb.Count > 0) continue; var rightLKFunctionGroup = new RightLkFunctionGroup { GroupSysid = groupSysid, FunctionSysid = rightFunction.Sysid, Sequence = rightFunction.Sequence }; insertList.Add(rightLKFunctionGroup); } return insertList; }
public static bool Update(RightLkFunctionGroup rightLkFunctionGroup, SqlConnection conn, SqlTransaction trans) { const string sql = @" UPDATE T_RIGHT_LK_FUNCTION_GROUP SET SEQUENCE=@Sequence WHERE GROUP_SYSID=@GroupSysid AND FUNCTION_SYSID=@FunctionSysid "; return Dapper.Save(rightLkFunctionGroup, sql, conn, trans); }