/// <summary> /// 保存 /// </summary> /// <returns></returns> public string CondBySQLTemplate_Save() { string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQLTemplate.ToString(); string sql = this.GetRequestVal("TB_Docs"); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, fk_mainNode, CondAttr.ToNodeID, toNodeID, CondAttr.CondType, (int)condTypeEnum); cond.MyPK = mypk; cond.HisDataFrom = ConnDataFrom.SQLTemplate; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Node = this.GetRequestValInt("FK_MainNode"); cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.FK_Flow = this.FK_Flow; cond.OperatorValue = sql; cond.Note = this.GetRequestVal("TB_Note"); //备注. cond.FK_Flow = this.FK_Flow; cond.HisCondType = condTypeEnum; cond.Insert(); return("保存成功.."); }
internal ResourceIconCondition(XmlNode node) { if (node.Name == "prop") { _type = CondType.PropValue; } else if (node.Name == "hasprop") { _type = CondType.HasProp; } else if (node.Name == "hasinlink") { _type = CondType.HasInLink; } else { throw new Exception("Invalid icon condition " + node.Name); } _propName = XmlTools.GetRequiredAttribute(node, "name"); if (_type == CondType.PropValue) { _propValue = XmlTools.GetRequiredAttribute(node, "value"); } }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public string CondBySQL_Save() { string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQL.ToString(); string sql = this.GetRequestVal("TB_Docs"); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condTypeEnum + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + toNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.SQL); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, fk_mainNode, CondAttr.ToNodeID, toNodeID, CondAttr.CondType, (int)condTypeEnum); cond.MyPK = mypk; cond.HisDataFrom = ConnDataFrom.SQL; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Node = this.GetRequestValInt("FK_MainNode"); cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.FK_Flow = this.FK_Flow; cond.OperatorValue = sql; cond.Note = this.GetRequestVal("TB_Note"); //备注. cond.FK_Flow = this.FK_Flow; cond.HisCondType = condTypeEnum; cond.Insert(); return("保存成功.."); }
public CILCondition(SourceInfo si, CILExpression lhs, CondType op, CILExpression rhs) : base(si) { Lhs = lhs; Op = op; Rhs = rhs; }
/// /// <summary> /// Parses conditional expressions /// </summary> /// /// <param name="leftOp">Left operand</param> /// <param name="rightOp">Right operand</param> /// <param name="type">Conditional operator type</param> /// /// <returns>The result of applying the conditional operator</returns> /// public static CseObject Parse(CseObject leftOp, CseObject rightOp, CondType type) { CseObject obj = new CseObject(null) { IsLiteral = leftOp.IsLiteral && rightOp.IsLiteral }; try { switch (type) { case CondType.EQ: obj.Value = leftOp.Value == rightOp.Value; break; case CondType.NEQ: obj.Value = leftOp.Value != rightOp.Value; break; case CondType.GT: obj.Value = leftOp.Value > rightOp.Value; break; case CondType.GTE: obj.Value = leftOp.Value >= rightOp.Value; break; case CondType.LT: obj.Value = leftOp.Value < rightOp.Value; break; case CondType.LTE: obj.Value = leftOp.Value <= rightOp.Value; break; default: throw new System.NotImplementedException("Not implemented."); } } catch { // TODO: Fill this out! } return obj; }
public SubrecordStructure(Subrecord node) : base(node) { this.notininfo = node.notininfo; this.size = node.size; this.Condition = (!string.IsNullOrEmpty(node.condition)) ? (CondType)Enum.Parse(typeof(CondType), node.condition, true) : CondType.None; this.CondID = node.condid; this.CondOperand = node.condvalue; this.UseHexEditor = node.usehexeditor; // if (optional && repeat) // { // throw new RecordXmlException("repeat and optional must both have the same value if they are non zero"); // } var elements = new List <ElementStructure>(); foreach (var elem in node.Elements) { elements.Add(new ElementStructure(elem)); } this.elements = elements.ToArray(); this.ContainsConditionals = this.elements.Count(x => x.CondID != 0) > 0; }
/// <summary> /// 初始化 /// </summary> /// <returns></returns> public string CondByFrm_Init() { DataSet ds = new DataSet(); string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); Node nd = new Node(int.Parse(fk_mainNode)); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); //string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQLTemplate.ToString(); //增加条件集合. Conds conds = new Conds(); conds.Retrieve(CondAttr.FK_Node, fk_mainNode, CondAttr.ToNodeID, toNodeID); ds.Tables.Add(conds.ToDataTableField("WF_Conds")); string noteIn = "'FID','PRI','PNodeID','PrjNo', 'PrjName', 'FK_NY','FlowDaySpan', 'MyNum','Rec','CDT','RDT','AtPara','WFSta','FlowNote','FlowStartRDT','FlowEnderRDT','FlowEnder','FlowSpanDays','WFState','OID','PWorkID','PFlowNo','PEmp','FlowEndNode','GUID'"; //增加字段集合. string sql = ""; if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL) { sql = "SELECT KeyOfEn as No, KeyOfEn||' - '||Name as Name FROM Sys_MapAttr WHERE FK_MapData='ND" + int.Parse(nd.FK_Flow) + "Rpt'"; sql += " AND KeyOfEn Not IN (" + noteIn + ") "; sql += " AND MyDataType NOT IN (6,7) "; } else if (SystemConfig.AppCenterDBType == DBType.MySQL) { sql = "SELECT KeyOfEn as No, CONCAT(KeyOfEn,' - ', Name ) as Name FROM Sys_MapAttr WHERE FK_MapData='ND" + int.Parse(nd.FK_Flow) + "Rpt'"; sql += " AND KeyOfEn Not IN (" + noteIn + ") "; sql += " AND MyDataType NOT IN (6,7) "; } else { sql = "SELECT KeyOfEn as No, KeyOfEn+' - '+Name as Name FROM Sys_MapAttr WHERE FK_MapData='ND" + int.Parse(nd.FK_Flow) + "Rpt'"; sql += " AND KeyOfEn Not IN (" + noteIn + ") "; sql += " AND MyDataType NOT IN (6,7) "; } DataTable dt = DBAccess.RunSQLReturnTable(sql); dt.TableName = "Sys_MapAttr"; dt.Columns[0].ColumnName = "No"; dt.Columns[1].ColumnName = "Name"; DataRow dr = dt.NewRow(); dr[0] = "all"; dr[1] = "请选择表单字段"; dt.Rows.Add(dr); ds.Tables.Add(dt); return(BP.Tools.Json.DataSetToJson(ds, false)); // cond.ToJson(); }
/// <summary> /// 条件 /// </summary> /// <param name="ct">类型</param> /// <param name="nodeID">节点</param> public Conds(CondType ct, int nodeID, Int64 workid, GERpt enData) { this.NodeID = nodeID; this.Retrieve(CondAttr.NodeID, nodeID, CondAttr.CondType, (int)ct, CondAttr.PRI); foreach (Cond en in this) { en.WorkID = workid; en.en = enData; } }
/// <summary> /// Clone structure with optional and repeat values overridden /// </summary> /// <param name="src"></param> /// <param name="optional"></param> /// <param name="repeat"></param> public SubrecordStructure(SubrecordStructure src, int optional, int repeat) : base(src, optional, repeat) { elements = src.elements; notininfo = src.notininfo; size = src.size; Condition = src.Condition; CondID = src.CondID; CondOperand = src.CondOperand; ContainsConditionals = src.ContainsConditionals; UseHexEditor = src.UseHexEditor; }
/// <summary> /// Initializes a new instance of the <see cref="SubrecordStructure"/> class. /// Clone structure with optional and repeat values overridden. /// </summary> /// <param name="src"> /// </param> /// <param name="optional"> /// </param> /// <param name="repeat"> /// </param> public SubrecordStructure(SubrecordStructure src, int optional, int repeat) : base(src, optional, repeat) { this.elements = src.elements; this.notininfo = src.notininfo; this.size = src.size; this.Condition = src.Condition; this.CondID = src.CondID; this.CondOperand = src.CondOperand; this.ContainsConditionals = src.ContainsConditionals; this.UseHexEditor = src.UseHexEditor; }
/// <summary> /// 保存 /// </summary> /// <returns></returns> public string CondByStation_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType HisCondType = CondType.Dir; Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, FK_MainNode, CondAttr.ToNodeID, ToNodeID, CondAttr.CondType, (int)HisCondType); string mypk = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString(); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)HisCondType + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + ToNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.Stas); // 删除岗位条件. cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Stas; cond.NodeID = FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = ToNodeID; cond.Insert(); } string val = this.GetRequestVal("emps").Replace(",", "@"); string valT = this.GetRequestVal("orgEmps").Replace(",", " "); cond.OperatorValue = val; //cond.OperatorValueT = valT; cond.SetPara("OrgEmps", valT); cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay"); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara"); } else { cond.SpecOperPara = string.Empty; } cond.HisDataFrom = ConnDataFrom.Stas; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功.."); }
public string CondByDept_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType condType = (CondType)this.GetRequestValInt("CondType"); Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, this.GetRequestValInt("FK_MainNode"), CondAttr.ToNodeID, this.GetRequestValInt("ToNodeID"), CondAttr.CondType, (int)condType); string mypk = this.GetRequestValInt("FK_MainNode") + "_" + this.GetRequestValInt("ToNodeID") + "_" + condType.ToString() + "_" + ConnDataFrom.Depts.ToString(); cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Depts; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.Insert(); } string val = this.GetRequestVal("depts").Replace(",", "@"); cond.OperatorValue = val; cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay"); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara"); } else { cond.SpecOperPara = string.Empty; } cond.HisDataFrom = ConnDataFrom.Depts; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功!!"); }
/// <summary> /// 初始化 /// </summary> /// <returns></returns> public string CondBySQL_Init() { string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQL.ToString(); Cond cond = new Cond(); cond.MyPK = mypk; cond.RetrieveFromDBSources(); return(cond.ToJson()); }
public string CondByDept_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType condType = (CondType)this.GetRequestValInt("CondType"); Cond cond = new Cond(); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condType + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + this.GetRequestValInt("ToNodeID") + ") AND DataFrom!=" + (int)ConnDataFrom.Depts); string mypk = this.GetRequestValInt("FK_MainNode") + "_" + this.GetRequestValInt("ToNodeID") + "_" + condType.ToString() + "_" + ConnDataFrom.Depts.ToString(); cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Depts; cond.NodeID = this.GetRequestValInt("FK_MainNode"); cond.FK_Flow = this.FK_Flow; cond.ToNodeID = this.GetRequestValInt("ToNodeID"); cond.Insert(); } string val = this.GetRequestVal("depts").Replace(",", "@"); cond.OperatorValue = val; cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay"); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara"); } else { cond.SpecOperPara = string.Empty; } cond.HisDataFrom = ConnDataFrom.Depts; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功!!"); }
public SubrecordStructure(Subrecord node, ElementBase[] elementTree, ElementStructure[] elements) : base(node) { this.notininfo = node.notininfo; this.size = node.size; this.Condition = (!string.IsNullOrEmpty(node.condition)) ? (CondType)Enum.Parse(typeof(CondType), node.condition, true) : CondType.None; this.CondID = node.condid; this.CondOperand = node.condvalue; this.UseHexEditor = node.usehexeditor; this.elementTree = elementTree; this.elements = elements; this.ContainsConditionals = this.elements.Count(x => x.CondID != 0) > 0; }
public SubrecordStructure(Subrecord node, ElementBase[] elementTree, ElementStructure[] elements) : base(node) { this.notininfo = node.notininfo; this.size = node.size; this.Condition = (!string.IsNullOrEmpty(node.condition)) ? (CondType) Enum.Parse(typeof (CondType), node.condition, true) : CondType.None; this.CondID = node.condid; this.CondOperand = node.condvalue; this.UseHexEditor = node.usehexeditor; this.elementTree = elementTree; this.elements = elements; this.ContainsConditionals = this.elements.Count(x => x.CondID != 0) > 0; }
/// /// <summary> /// Parses conditional expressions /// </summary> /// /// <param name="leftOp">Left operand</param> /// <param name="rightOp">Right operand</param> /// <param name="type">Conditional operator type</param> /// /// <returns>The result of applying the conditional operator</returns> /// public static CseObject Parse(CseObject leftOp, CseObject rightOp, CondType type) { CseObject obj = new CseObject(null) { IsLiteral = leftOp.IsLiteral && rightOp.IsLiteral }; try { switch (type) { case CondType.EQ: obj.Value = leftOp.Value == rightOp.Value; break; case CondType.NEQ: obj.Value = leftOp.Value != rightOp.Value; break; case CondType.GT: obj.Value = leftOp.Value > rightOp.Value; break; case CondType.GTE: obj.Value = leftOp.Value >= rightOp.Value; break; case CondType.LT: obj.Value = leftOp.Value < rightOp.Value; break; case CondType.LTE: obj.Value = leftOp.Value <= rightOp.Value; break; default: throw new System.NotImplementedException("Not implemented."); } } catch { // TODO: Fill this out! } return(obj); }
/// <summary> /// 删除 /// </summary> /// <returns></returns> public string CondByStation_Delete() { string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQL.ToString(); Cond deleteCond = new Cond(); int i = deleteCond.Delete(CondAttr.NodeID, fk_mainNode, CondAttr.ToNodeID, toNodeID, CondAttr.CondType, (int)condTypeEnum); if (i == 1) { return("删除成功.."); } return("无可删除的数据."); }
public SubrecordStructure(Xml.Subrecord node) : base(node) { this.notininfo = node.notininfo; this.size = node.size; this.Condition = (!string.IsNullOrEmpty(node.condition)) ? (CondType) Enum.Parse(typeof (CondType), node.condition, true) : CondType.None; this.CondID = node.condid; this.CondOperand = node.condvalue; this.UseHexEditor = node.usehexeditor; // if (optional && repeat) // { // throw new RecordXmlException("repeat and optional must both have the same value if they are non zero"); // } this.elementTree = GetElementTree(node.Items).ToArray(); this.elements = GetElementArray(elementTree).ToArray(); this.ContainsConditionals = this.elements.Count(x => x.CondID != 0) > 0; }
public SubrecordStructure(Xml.Subrecord node) : base(node) { this.notininfo = node.notininfo; this.size = node.size; this.Condition = (!string.IsNullOrEmpty(node.condition)) ? (CondType)Enum.Parse(typeof(CondType), node.condition, true) : CondType.None; this.CondID = node.condid; this.CondOperand = node.condvalue; this.UseHexEditor = node.usehexeditor; // if (optional && repeat) // { // throw new RecordXmlException("repeat and optional must both have the same value if they are non zero"); // } this.elementTree = GetElementTree(node.Items).ToArray(); this.elements = GetElementArray(elementTree).ToArray(); this.ContainsConditionals = this.elements.Count(x => x.CondID != 0) > 0; }
public SubrecordStructure(Subrecord node) : base(node) { this.notininfo = node.notininfo; this.size = node.size; this.Condition = (!string.IsNullOrEmpty(node.condition)) ? (CondType)Enum.Parse(typeof(CondType), node.condition, true) : CondType.None; this.CondID = node.condid; this.CondOperand = node.condvalue; this.UseHexEditor = node.usehexeditor; // if (optional && repeat) // { // throw new RecordXmlException("repeat and optional must both have the same value if they are non zero"); // } var elements = new List<ElementStructure>(); foreach (var elem in node.Elements) { elements.Add(new ElementStructure(elem)); } this.elements = elements.ToArray(); this.ContainsConditionals = this.elements.Count(x => x.CondID != 0) > 0; }
private EventCond_AtomDet(Pos pos, CondType condType) : base(pos, condType) { }
public SubrecordStructure(XmlNode node) { if (node.Name != "Subrecord") { throw new RecordXmlException("Invalid node"); } name = node.Attributes.GetNamedItem("name").Value; desc = node.Attributes.GetNamedItem("desc").Value; var node2 = node.Attributes.GetNamedItem("repeat"); repeat = node2 != null?int.Parse(node2.Value) : 0; node2 = node.Attributes.GetNamedItem("optional"); optional = node2 != null?int.Parse(node2.Value) : 0; node2 = node.Attributes.GetNamedItem("size"); size = node2 != null?int.Parse(node2.Value) : 0; node2 = node.Attributes.GetNamedItem("notininfo"); if (node2 != null && node2.Value == "true") { notininfo = true; } else { notininfo = false; } node2 = node.Attributes.GetNamedItem("usehexeditor"); if (node2 != null && node2.Value == "true") { UseHexEditor = true; } else { UseHexEditor = false; } if (optional != 0 && repeat != 0 && optional != repeat) { throw new RecordXmlException("repeat and optional must both have the same value if they are non zero"); } node2 = node.Attributes.GetNamedItem("condition"); if (node2 != null) { switch (node2.Value) { case "equal": Condition = CondType.Equal; break; case "not": Condition = CondType.Not; break; case "greater": Condition = CondType.Greater; break; case "less": Condition = CondType.Less; break; case "greaterequal": Condition = CondType.GreaterEqual; break; case "lessequal": Condition = CondType.LessEqual; break; case "startswith": Condition = CondType.StartsWith; break; case "endswith": Condition = CondType.EndsWith; break; case "contains": Condition = CondType.Contains; break; case "exists": Condition = CondType.Exists; break; case "missing": Condition = CondType.Missing; break; default: throw new RecordXmlException("Invalid condition"); } CondID = int.Parse(node.Attributes.GetNamedItem("condid").Value); CondOperand = node.Attributes.GetNamedItem("condvalue").Value; } else { Condition = CondType.None; CondID = 0; CondOperand = null; } var elements = new List <ElementStructure>(); foreach (XmlNode n in node.ChildNodes) { if (n.NodeType == XmlNodeType.Comment) { continue; } elements.Add(new ElementStructure(n)); } this.elements = elements.ToArray(); ContaintsConditionals = false; var containsBlob = false; foreach (var es in this.elements) { if (es.CondID != 0) { ContaintsConditionals = true; } if (es.type == ElementValueType.fstring || es.type == ElementValueType.Blob) { containsBlob = true; } } if (containsBlob && elements.Count > 1) { throw new RecordXmlException("A subrecord containing a blorb or fstring may only contain one element"); } for (var i = 0; i < this.elements.Length - 1; i++) { if (this.elements[i].repeat || this.elements[i].optional) { throw new RecordXmlException( "Repeat and optional attributes are only valid on the final element of a subrecord"); } } }
public SubrecordStructure(XmlNode node) { if (node.Name != "Subrecord") { throw new RecordXmlException("Invalid node"); } name = node.Attributes.GetNamedItem("name").Value; desc = node.Attributes.GetNamedItem("desc").Value; var node2 = node.Attributes.GetNamedItem("repeat"); repeat = node2 != null ? int.Parse(node2.Value) : 0; node2 = node.Attributes.GetNamedItem("optional"); optional = node2 != null ? int.Parse(node2.Value) : 0; node2 = node.Attributes.GetNamedItem("size"); size = node2 != null ? int.Parse(node2.Value) : 0; node2 = node.Attributes.GetNamedItem("notininfo"); if (node2 != null && node2.Value == "true") { notininfo = true; } else { notininfo = false; } node2 = node.Attributes.GetNamedItem("usehexeditor"); if (node2 != null && node2.Value == "true") { UseHexEditor = true; } else { UseHexEditor = false; } if (optional != 0 && repeat != 0 && optional != repeat) { throw new RecordXmlException("repeat and optional must both have the same value if they are non zero"); } node2 = node.Attributes.GetNamedItem("condition"); if (node2 != null) { switch (node2.Value) { case "equal": Condition = CondType.Equal; break; case "not": Condition = CondType.Not; break; case "greater": Condition = CondType.Greater; break; case "less": Condition = CondType.Less; break; case "greaterequal": Condition = CondType.GreaterEqual; break; case "lessequal": Condition = CondType.LessEqual; break; case "startswith": Condition = CondType.StartsWith; break; case "endswith": Condition = CondType.EndsWith; break; case "contains": Condition = CondType.Contains; break; case "exists": Condition = CondType.Exists; break; case "missing": Condition = CondType.Missing; break; default: throw new RecordXmlException("Invalid condition"); } CondID = int.Parse(node.Attributes.GetNamedItem("condid").Value); CondOperand = node.Attributes.GetNamedItem("condvalue").Value; } else { Condition = CondType.None; CondID = 0; CondOperand = null; } var elements = new List<ElementStructure>(); foreach (XmlNode n in node.ChildNodes) { if (n.NodeType == XmlNodeType.Comment) { continue; } elements.Add(new ElementStructure(n)); } this.elements = elements.ToArray(); ContaintsConditionals = false; var containsBlob = false; foreach (var es in this.elements) { if (es.CondID != 0) { ContaintsConditionals = true; } if (es.type == ElementValueType.fstring || es.type == ElementValueType.Blob) { containsBlob = true; } } if (containsBlob && elements.Count > 1) { throw new RecordXmlException("A subrecord containing a blorb or fstring may only contain one element"); } for (var i = 0; i < this.elements.Length - 1; i++) { if (this.elements[i].repeat || this.elements[i].optional) { throw new RecordXmlException( "Repeat and optional attributes are only valid on the final element of a subrecord"); } } }
public string StandAloneFrm_Save() { string frmID = this.GetRequestVal("FrmID"); //定义变量. string field = this.GetRequestVal("DDL_Fields"); field = frmID + "_" + field; int toNodeID = this.GetRequestValInt("ToNodeID"); int fk_Node = this.GetRequestValInt("FK_Node"); string oper = this.GetRequestVal("DDL_Operator"); string operVal = this.GetRequestVal("OperVal"); //节点,子线城,还是其他 CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType"); //把其他的条件都删除掉. DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condTypeEnum + " AND NodeID=" + this.FK_Node + " AND ToNodeID=" + toNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.NodeForm); Cond cond = new Cond(); cond.HisDataFrom = ConnDataFrom.StandAloneFrm; cond.NodeID = fk_Node; cond.ToNodeID = toNodeID; cond.FK_Node = this.FK_Node; cond.FK_Operator = oper; cond.OperatorValue = operVal; //操作值. cond.FK_Attr = field; //字段属性. // cond.OperatorValueT = ""; // this.GetOperValText; cond.FK_Flow = this.FK_Flow; cond.HisCondType = condTypeEnum; ; //保存类型. if (this.GetRequestVal("SaveType").Equals("AND") == true) { cond.CondOrAnd = CondOrAnd.ByAnd; } else { cond.CondOrAnd = CondOrAnd.ByOr; } #region 方向条件,全部更新. Conds conds = new Conds(); QueryObject qo = new QueryObject(conds); qo.AddWhere(CondAttr.NodeID, this.FK_Node); qo.addAnd(); qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.StandAloneFrm); qo.addAnd(); qo.AddWhere(CondAttr.CondType, (int)condTypeEnum); if (toNodeID != 0) { qo.addAnd(); qo.AddWhere(CondAttr.ToNodeID, toNodeID); } int num = qo.DoQuery(); foreach (Cond item in conds) { item.CondOrAnd = cond.CondOrAnd; item.Update(); } #endregion /* 执行同步*/ string sqls = "UPDATE WF_Node SET IsCCFlow=0"; sqls += "@UPDATE WF_Node SET IsCCFlow=1 WHERE NodeID IN (SELECT NODEID FROM WF_Cond a WHERE a.NodeID= NodeID AND CondType=1 )"; BP.DA.DBAccess.RunSQLs(sqls); string sql = "UPDATE WF_Cond SET DataFrom=" + (int)ConnDataFrom.StandAloneFrm + " WHERE NodeID=" + cond.NodeID + " AND FK_Node=" + cond.FK_Node + " AND ToNodeID=" + toNodeID; switch (condTypeEnum) { case CondType.Flow: case CondType.Node: cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); break; case CondType.Dir: // cond.MyPK = cond.NodeID +"_"+ this.Request.QueryString["ToNodeID"]+"_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.ToNodeID = toNodeID; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); break; case CondType.SubFlow: //启动子流程. cond.MyPK = BP.DA.DBAccess.GenerOID().ToString(); //cond.NodeID + "_" + cond.FK_Node + "_" + cond.FK_Attr + "_" + cond.OperatorValue; cond.ToNodeID = toNodeID; cond.Insert(); BP.DA.DBAccess.RunSQL(sql); break; default: throw new Exception("未设计的情况。" + condTypeEnum.ToString()); } return("保存成功!!"); }
public EventCond_AtomCount(Pos pos, CondType condType) : base(pos, condType) { }
public EventCond_AtomCount(Pos pos, CondType condType, string id, string value) : base(pos, condType) { entityName = id; entityValue = Int32.Parse(value); }
public EventCond(Pos p_pos, CondType p_type) { pos = p_pos; condType = p_type; }
public EventCond_AtomDet(Pos pos, CondType condType, string value) : base(pos, condType) { param = Double.Parse(value, CultureInfo.InvariantCulture); }
public EventCond_AtomStates(Pos pos, CondType condType, Node state_list_node) : base(pos, condType) { this.condType = condType; PTN_EventCond_StateList stateList = (PTN_EventCond_StateList)state_list_node; eventStates = new List<EventState>(); stateList.BuildList(eventStates); }
public EventCond_AtomStates(Pos pos, CondType condType, List<EventState> states) : base(pos, condType) { eventStates = states; }
/// <summary> /// 条件 - 配置信息 /// </summary> /// <param name="ct"></param> /// <param name="nodeID"></param> public Conds(CondType ct, int nodeID) { this.Retrieve(CondAttr.NodeID, nodeID, CondAttr.CondType, (int)ct, CondAttr.PRI); }
public string CondStation_Save() { int FK_MainNode = this.GetRequestValInt("FK_MainNode"); int ToNodeID = this.GetRequestValInt("ToNodeID"); CondType HisCondType = CondType.Dir; Cond cond = new Cond(); cond.Delete(CondAttr.NodeID, FK_MainNode, CondAttr.ToNodeID, ToNodeID, CondAttr.CondType, (int)HisCondType); string mypk = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString(); // 删除岗位条件. cond.MyPK = mypk; if (cond.RetrieveFromDBSources() == 0) { cond.HisDataFrom = ConnDataFrom.Stas; cond.NodeID = FK_MainNode; cond.FK_Flow = this.FK_Flow; cond.ToNodeID = ToNodeID; cond.Insert(); } string val = ""; Stations sts = new Stations(); sts.RetrieveAllFromDBSource(); foreach (Station st in sts) { if (this.GetRequestVal("CB_" + st.No) != "1") { continue; } val += "@" + st.No; } val += "@"; cond.OperatorValue = val; cond.HisDataFrom = ConnDataFrom.Stas; cond.FK_Flow = this.FK_Flow; cond.HisCondType = CondType.Dir; cond.FK_Node = FK_MainNode; #region //获取“指定的操作员”设置,added by liuxc,2015-10-7 cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_" + CondAttr.SpecOperWay); if (cond.SpecOperWay != SpecOperWay.CurrOper) { cond.SpecOperPara = this.GetRequestVal("TB_" + CondAttr.SpecOperPara); } else { cond.SpecOperPara = string.Empty; } #endregion cond.ToNodeID = ToNodeID; cond.Update(); return("保存成功.."); }