/// <summary> /// method to return the expression condition to filter out those records that are not accessible to position's locations/equipments /// </summary> /// <param name="currentUserID"></param> /// <param name="roleNameCode">role code.</param> /// <param name="isLocation"> if this is true, it will be based on location, else equipment</param> /// <param name="hierarchyPathColumn">pass in the column to be built condition, forexample, TablesLogic.tContract.Locations.HierarchyPath</param> /// <returns></returns> public static ExpressionCondition GetAccessibleCondition(string currentUserID, bool isLocation, SchemaString hierarchyPathColumn, params string[] roleNameCode) { OUser user = TablesLogic.tUser.Load(new Guid(currentUserID)); List<OPosition> positions = OPosition.GetPositionsByUserByRoleCode(user, roleNameCode); if (positions != null && positions.Count > 0) { foreach (OPosition position in positions) { if (isLocation) { ExpressionCondition cond = null; foreach (OLocation location in position.LocationAccess) { if (cond == null) cond = hierarchyPathColumn.Like(location.HierarchyPath + "%"); else cond = cond | hierarchyPathColumn.Like(location.HierarchyPath + "%"); } return cond; } else { ExpressionCondition cond = null; foreach (OEquipment equipment in position.EquipmentAccess) { if (cond == null) cond = hierarchyPathColumn.Like(equipment.HierarchyPath + "%"); else cond = cond | hierarchyPathColumn.Like(equipment.HierarchyPath + "%"); } return cond; } } } return null; }
public void ReplaceNameAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Attribute, "", "Name", index, newValue.ToString()); }
public void AddName(SchemaString newValue) { AppendDomChild(NodeType.Attribute, "", "Name", newValue.ToString()); }
public void InsertFormatAt(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Element, "", "Format", index, newValue.ToString()); }
public void Replacedefault2At(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Attribute, "", "default", index, newValue.ToString()); }
public void Adddefault2(SchemaString newValue) { AppendDomChild(NodeType.Attribute, "", "default", newValue.ToString()); }
public void InsertunitSymbolAt(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Attribute, "", "unitSymbol", index, newValue.ToString()); }
public void ReplaceFormatAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "http://www.opengis.net/wms", "Format", index, newValue.ToString()); }
public void AddToolBarImage(SchemaString newValue) { AppendDomChild(NodeType.Element, "", "ToolBarImage", newValue.ToString()); }
public void ReplaceAbstract2At(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "", "Abstract", index, newValue.ToString()); }
public void InsertAbstract2At(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Element, "", "Abstract", index, newValue.ToString()); }
public void AddAbstract2(SchemaString newValue) { AppendDomChild(NodeType.Element, "", "Abstract", newValue.ToString()); }
public void ReplaceauthorityAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Attribute, "", "authority", index, newValue.ToString()); }
public void InsertauthorityAt(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Attribute, "", "authority", index, newValue.ToString()); }
public void Addauthority(SchemaString newValue) { AppendDomChild(NodeType.Attribute, "", "authority", newValue.ToString()); }
public EnumerationType(SchemaString newValue) : base(newValue) { Validate(); }
public void InsertToolBarImageAt(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Element, "", "ToolBarImage", index, newValue.ToString()); }
public void AddunitSymbol(SchemaString newValue) { AppendDomChild(NodeType.Attribute, "", "unitSymbol", newValue.ToString()); }
public void ReplaceToolBarImageAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "", "ToolBarImage", index, newValue.ToString()); }
public void ReplaceunitSymbolAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Attribute, "", "unitSymbol", index, newValue.ToString()); }
public void AddTitle(SchemaString newValue) { AppendDomChild(NodeType.Element, "http://www.opengis.net/wms", "Title", newValue.ToString()); }
public void Insertdefault2At(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Attribute, "", "default", index, newValue.ToString()); }
public void InsertTitleAt(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Element, "http://www.opengis.net/wms", "Title", index, newValue.ToString()); }
public void AddFormat(SchemaString newValue) { AppendDomChild(NodeType.Element, "", "Format", newValue.ToString()); }
public void AddProcessingInstruction(SchemaString name, SchemaString newValue) { AppendDomChild(NodeType.ProcessingInstruction, "", name.ToString(), newValue.ToString()); }
public void ReplaceFormatAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "", "Format", index, newValue.ToString()); }
public void AddCDataNode(SchemaString newValue) { AppendDomChild(NodeType.CData, "", "", newValue.ToString()); }
public void InsertNameAt(SchemaString newValue, int index) { InsertDomChildAt(NodeType.Attribute, "", "Name", index, newValue.ToString()); }
public void AddComment(SchemaString newValue) { AppendDomChild(NodeType.Comment, "", "", newValue.ToString()); }
public void AddTextNode(SchemaString newValue) { AppendDomChild(NodeType.Text, "", "", newValue.ToString()); }
public void setValue(SchemaString newValue) { SetDomNodeValue(domNode, newValue.ToString()); }