public void CheckValidate() { QJVRMS.Business.ObjectRuleWS.ObjectRuleService ors = new QJVRMS.Business.ObjectRuleWS.ObjectRuleService(); this.isValidate = ors.CheckValidate(securityObject.ObjectId, ioperator.OperatorId, (int)method, (int)securityObject.ObjectType); // SqlParameter[] Parameters = new SqlParameter[5]; // Parameters[0] = new SqlParameter("@SecurityObjId", SqlDbType.UniqueIdentifier); // Parameters[1] = new SqlParameter("@OperatorId", SqlDbType.UniqueIdentifier); // Parameters[2] = new SqlParameter("@OperatorMethd", SqlDbType.TinyInt); // Parameters[3] = new SqlParameter("@SecurityObjType", SqlDbType.TinyInt); // Parameters[4] = new SqlParameter("@ResultOutput", SqlDbType.Bit); // Parameters[0].Value = securityObject.ObjectId; // Parameters[1].Value = ioperator.OperatorId; // Parameters[2].Value = (int)method; // Parameters[3].Value = (int)securityObject.ObjectType; // Parameters[4].Direction = ParameterDirection.Output; // try // { // SqlHelper.ExecuteNonQuery(SqlHelper.SqlCon_QJVRMS, CommandType.StoredProcedure, "Rule_CheckRuleByCondition", Parameters); // object result = Parameters[4].Value; // this.isValidate = bool.Parse(result.ToString()); // } // catch // { // this.isValidate = false; // } }
// public static void CheckRules( public static void CheckRules(List <ObjectRule> rules) { QJVRMS.Common.SerializeObjectFactory sof = new QJVRMS.Common.SerializeObjectFactory(); string rulesStr = sof.SerializeToBase64(rules); QJVRMS.Business.ObjectRuleWS.ObjectRuleService ors = new QJVRMS.Business.ObjectRuleWS.ObjectRuleService(); string ruleResult = ors.CheckRules(rulesStr); object o = sof.DesializeFromBase64(ruleResult); List <ObjectRule> result = (List <ObjectRule>)o; for (int i = 0; i < result.Count; i++) { rules[i].IsValidate = result[i].IsValidate; } //StringBuilder sqlQuery = new StringBuilder(); //string sql = "CREATE TABLE #RuleList(ruleId uniqueidentifier);"; //sqlQuery.Append(sql); //foreach (IRule rule in rules) //{ // sqlQuery.Append(rule.GetSqlQuery()); //} //sql = "select * from #RuleList"; //sqlQuery.Append(sql); //using (DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sqlQuery.ToString()).Tables[0]) //{ // foreach (IRule rule in rules) // { // DataRow[] rows = dt.Select("ruleId='" + rule.RuleId.ToString() + "'"); // if (rows.Length > 0) rule.IsValidate = true; // } //} }
public static bool SetRules(string rulesStr, string secObjStr, string opersStr) { QJVRMS.Business.ObjectRuleWS.ObjectRuleService ors = new QJVRMS.Business.ObjectRuleWS.ObjectRuleService(); return(ors.SetRules(rulesStr, secObjStr, opersStr)); }
public static bool SetRules(string rulesStr, string secObjStr, string opersStr) { QJVRMS.Business.ObjectRuleWS.ObjectRuleService ors = new QJVRMS.Business.ObjectRuleWS.ObjectRuleService(); return ors.SetRules(rulesStr, secObjStr, opersStr); }
// public static void CheckRules( public static void CheckRules(List<ObjectRule> rules) { QJVRMS.Common.SerializeObjectFactory sof = new QJVRMS.Common.SerializeObjectFactory(); string rulesStr = sof.SerializeToBase64(rules); QJVRMS.Business.ObjectRuleWS.ObjectRuleService ors = new QJVRMS.Business.ObjectRuleWS.ObjectRuleService(); string ruleResult = ors.CheckRules(rulesStr); object o = sof.DesializeFromBase64(ruleResult); List<ObjectRule> result = (List<ObjectRule>)o; for (int i = 0; i < result.Count; i++) { rules[i].IsValidate = result[i].IsValidate; } //StringBuilder sqlQuery = new StringBuilder(); //string sql = "CREATE TABLE #RuleList(ruleId uniqueidentifier);"; //sqlQuery.Append(sql); //foreach (IRule rule in rules) //{ // sqlQuery.Append(rule.GetSqlQuery()); //} //sql = "select * from #RuleList"; //sqlQuery.Append(sql); //using (DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.SqlCon_QJVRMS, CommandType.Text, sqlQuery.ToString()).Tables[0]) //{ // foreach (IRule rule in rules) // { // DataRow[] rows = dt.Select("ruleId='" + rule.RuleId.ToString() + "'"); // if (rows.Length > 0) rule.IsValidate = true; // } //} }