//private bool IsFileContainsText() //{ // log.Fine("MoveDocument:"); // try // { // Assembly assembly = Assembly.Load("VADMSSvc"); // Type type = assembly.GetType("ViennaAdvantage.Classes.DocumentOperation"); // if (type != null) // { // MethodInfo methodInfo = type.GetMethod("DocumentContainText"); // if (methodInfo != null) // { // object result = null; // ParameterInfo[] parameters = methodInfo.GetParameters(); // object classInstance = Activator.CreateInstance(type, null); // if (parameters.Length == 0) // { // result = methodInfo.Invoke(classInstance, null); // } // else // { // GetPO(Get_TrxName()); // int sourceFolderID = _node.GetVADMS_Folder_ID_1(); // int docID = (int)_po.Get_Value("VADMS_Document_ID"); // System.Collections.Generic.List<System.Int32> metaDataID = new System.Collections.Generic.List<System.Int32>() { docID }; // object[] parametersArray = new object[] { get, _node.GetVADMS_Folder_ID(), sourceFolderID == 0 ? -1 : sourceFolderID, false }; // result = methodInfo.Invoke(classInstance, parametersArray); // } // if (result == null) // { // SetTextMsg("Mehtod Invoked Successfully."); // } // else // { // SetTextMsg("Mehtod Invoked Successfully:" + result.ToString()); // } // return true; // } // SetTextMsg("Cant Get Method of ViennaAdvantage.Classes.DocumentOperation From VADMSSvc File."); // } // SetTextMsg("Cant Get Type of ViennaAdvantage.Classes.DocumentOperation From VADMSSvc File."); // } // catch (Exception ex) // { // SetTextMsg("Error Occured During Move Document:" + ex.Message); // return false; // } // return false; //} /// <summary> /// Compare Number /// </summary> /// <param name="valueObj">comparator</param> /// <param name="value1">first value</param> /// <param name="value2">second value</param> /// <returns>true if operation</returns> private bool CompareNumber(Object valueObj, String value1, String value2) { Decimal valueObjB = 0; Decimal value1B = 0; Decimal value2B = 0; try { //if (valueObj instanceof BigDecimal) // valueObjB = (BigDecimal)valueObj; //else if (valueObj instanceof Integer) // valueObjB = new BigDecimal (((Integer)valueObj).intValue()); //else // valueObjB = new BigDecimal (String.valueOf(valueObj)); valueObjB = Convert.ToDecimal(valueObj); } catch (Exception e) { log.Fine("compareNumber - valueObj=" + valueObj + " - " + e.ToString()); return(CompareString(valueObj, value1, value2)); } String op = GetOperation(); //if (OPERATION_Eq.Equals(op)) // return valueObjB.CompareTo(value1B) == 0; //else if (OPERATION_Gt.Equals(op)) // return valueObjB.CompareTo(value1B) > 0; //else if (OPERATION_GtEq.Equals(op)) // return valueObjB.CompareTo(value1B) >= 0; //else if (OPERATION_Le.Equals(op)) // return valueObjB.CompareTo(value1B) < 0; //else if (OPERATION_LeEq.Equals(op)) // return valueObjB.CompareTo(value1B) <= 0; //else if (OPERATION_Like.Equals(op)) // return valueObjB.CompareTo(value1B) == 0; //else if (OPERATION_NotEq.Equals(op)) // return valueObjB.CompareTo(value1B) != 0; // if ((!OPERATION_Sql.Equals(op)) && (!OPERATION_X.Equals(op))) { return(EvaluateNumericLogic(valueObjB, value1, op)); } else if (OPERATION_Sql.Equals(op)) { throw new ArgumentException("SQL not Implemented"); } // else if (OPERATION_X.Equals(op)) { try { value1B = Convert.ToDecimal(value1); } catch (Exception e) { log.Fine("compareNumber - value1=" + value1 + " - " + e.ToString()); return(CompareString(valueObj, value1, value2)); } if (valueObjB.CompareTo(value1B) < 0) { return(false); } // To try { value2B = Convert.ToDecimal(value2); return(valueObjB.CompareTo(value2B) <= 0); } catch (Exception e) { log.Fine("compareNumber - value2=" + value2 + " - " + e.ToString()); return(false); } } // throw new ArgumentException("Unknown Operation=" + op); }
/// <summary> /// Compare String /// </summary> /// <param name="valueObj">comparator</param> /// <param name="value1S">first value</param> /// <param name="value2S">second value</param> /// <returns>true if operation</returns> private bool CompareString(Object valueObj, String value1S, String value2S) { _numeric = false; String valueObjS = valueObj.ToString().ToLower(); value1S = value1S.ToLower(); if (!string.IsNullOrEmpty(value2S)) { value2S = value2S.ToLower(); } // String op = GetOperation(); //if (OPERATION_Eq.Equals(op)) // return valueObjS.CompareTo(value1S) == 0; //else if (OPERATION_Gt.Equals(op)) // return valueObjS.CompareTo(value1S) > 0; //else if (OPERATION_GtEq.Equals(op)) // return valueObjS.CompareTo(value1S) >= 0; //else if (OPERATION_Le.Equals(op)) // return valueObjS.CompareTo(value1S) < 0; //else if (OPERATION_LeEq.Equals(op)) // return valueObjS.CompareTo(value1S) <= 0; //else if (OPERATION_NotEq.Equals(op)) // return valueObjS.CompareTo(value1S) != 0; //else if (OPERATION_Like.Equals(op)) // return valueObjS.CompareTo(value1S) == 0; //specific for DMS DataSet ds = DB.ExecuteDataset(@"SELECT col.ColumnName,tab.TableName FROM AD_Column col INNER JOIN AD_Table tab ON (tab.AD_Table_ID=col.AD_Table_ID) WHERE col.IsActive='Y' AND col.AD_Column_ID=" + GetAD_Column_ID()); if (ds != null && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["TableName"].ToString().Equals("VADMS_MetaData")) { return(EvaluateLogicForVADMS(valueObjS, value1S, op, ds.Tables[0].Rows[0]["ColumnName"].ToString())); } if ((!OPERATION_Sql.Equals(op)) && (!OPERATION_X.Equals(op))) { return(EvaluateLogic(valueObjS, value1S, op)); } // else if (OPERATION_Sql.Equals(op)) { throw new ArgumentException("SQL not Implemented"); } // else if (OPERATION_X.Equals(op)) { if (valueObjS.CompareTo(value1S) < 0) { return(false); } // To return(valueObjS.CompareTo(value2S) <= 0); } // throw new ArgumentException("Unknown Operation=" + op); }