//        private bool EvaluateLogicForVADMS(string valueObj, String value1S, string op, string columnName)
//        {
//            try
//            {
//                if (columnName.Equals("Name"))//For Name Column
//                {
//                    StringTokenizer st = new StringTokenizer(value1S.Trim(), "&|", true);
//                    String[] sta = valueObj.Split(',');//new StringTokenizer(value1S.Trim(), ",", true);
//                    StringBuilder logic = new StringBuilder();
//                    string _operator = null;
//                    valueObj = valueObj.Replace(',', '|');
//                    if (sta.Length > 1)
//                    {
//                        bool retval = EvaluateLogic(st.NextToken().Trim(), valueObj, op);
//                        bool temp = false;
//                        while (st.HasMoreTokens())
//                        {
//                            _operator = st.NextToken().Trim();
//                            if (_operator.Equals("|"))
//                            {
//                                temp = EvaluateLogic(st.NextToken().Trim(), valueObj, op);
//                                retval = retval || temp;
//                            }
//                            else if (_operator.Equals("&"))
//                            {
//                                temp = EvaluateLogic(st.NextToken().Trim(), valueObj, op);
//                                retval = retval && temp;
//                            }

//                        }
//                        return retval;
//                    }
//                    else
//                    {
//                        return EvaluateLogic(valueObj, value1S, op);
//                    }
//                }
//                else if (columnName.Equals("VADMS_ContainText")) //For ContainsText Column
//                {
//                    log.Fine("DocumentContainText:?");
//                    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
//                                {
//                                    int docID = Util.GetValueOfInt(DB.ExecuteScalar(@"SELECT Doc.VADMS_Document_ID
//                                                                FROM VADMS_Document Doc
//                                                                INNER JOIN VADMS_MetaData MD ON (MD.VADMS_Document_ID=Doc.VADMS_Document_ID)
//                                                                INNER JOIN AD_WF_Activity WA ON (WA.Record_ID=MD.VADMS_MetaData_ID)
//                                                                INNER JOIN AD_WF_Node NODE ON (NODE.AD_WF_Node_ID=WA.AD_WF_Node_ID)
//                                                                INNER JOIN AD_WF_NodeNext NN ON (NN.AD_WF_Node_ID=NODE.AD_WF_Node_ID)
//                                                                INNER JOIN AD_WF_NextCondition NC ON (NC.AD_WF_NodeNext_ID=NN.AD_WF_NodeNext_ID)
//                                                                WHERE NC.AD_WF_NextCondition_ID=" + GetAD_WF_NextCondition_ID(), null, Get_TrxName()));
//                                    object[] parametersArray = new object[] { value1S, Env.GetCtx().GetAD_Language(), docID };
//                                    result = methodInfo.Invoke(classInstance, parametersArray);
//                                }
//                                if (result == null)
//                                {
//                                    log.Severe("Mehtod Not Invoked Successfully:ViennaAdvantage.Classes.DocumentOperation.DocumentContainText");
//                                    return false;
//                                }
//                                else if (result.ToString() == "Y")
//                                {
//                                    log.Fine("DocumentContainText Invoked Successfully, Result Is" + result.ToString());
//                                    return true;
//                                }
//                                else
//                                {
//                                    log.Fine("DocumentContainText Invoked Successfully, Result Is" + result.ToString());
//                                    return false;
//                                }
//                            }
//                            log.Severe("Cant Get Method of ViennaAdvantage.Classes.DocumentOperation From VADMSSvc File.");
//                        }
//                        log.Severe("Cant Get Type of ViennaAdvantage.Classes.DocumentOperation From VADMSSvc File.");

//                    }
//                    catch (Exception ex)
//                    {
//                        log.Severe("Error Occured During ConditionEvaluation of DocumentContainText:" + ex.Message);
//                        return false;
//                    }
//                    return false;
//                }

//                else
//                {
//                    return EvaluateLogic(valueObj, value1S, op);
//                }

//            }
//            catch
//            {
//                return false;
//            }
//            return true;
//        }


        private bool EvaluateLogicForVADMS(string valueObj, String value1S, string op, string columnName)
        {
            try
            {
                if (columnName.Equals("Name"))//For Name Column
                {
                    StringTokenizer st        = new StringTokenizer(value1S.Trim(), "&|", true);
                    String[]        sta       = valueObj.Split(',');//new StringTokenizer(value1S.Trim(), ",", true);
                    StringBuilder   logic     = new StringBuilder();
                    string          _operator = null;
                    valueObj = valueObj.Replace(',', '|');
                    if (sta.Length > 1)
                    {
                        bool retval = EvaluateLogic(st.NextToken().Trim(), valueObj, op);
                        bool temp   = false;
                        while (st.HasMoreTokens())
                        {
                            _operator = st.NextToken().Trim();
                            if (_operator.Equals("|"))
                            {
                                temp   = EvaluateLogic(st.NextToken().Trim(), valueObj, op);
                                retval = retval || temp;
                            }
                            else if (_operator.Equals("&"))
                            {
                                temp   = EvaluateLogic(st.NextToken().Trim(), valueObj, op);
                                retval = retval && temp;
                            }
                        }
                        return(retval);
                    }
                    else
                    {
                        return(EvaluateLogic(valueObj, value1S, op));
                    }
                }
                else if (columnName.Equals("VADMS_ContainText")) //For ContainsText Column
                {
                    log.Fine("DocumentContainText:?");
                    //                    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
                    //                                {
                    //                                    int docID = Util.GetValueOfInt(DB.ExecuteScalar(@"SELECT Doc.VADMS_Document_ID
                    //                                                                FROM VADMS_Document Doc
                    //                                                                INNER JOIN VADMS_MetaData MD ON (MD.VADMS_Document_ID=Doc.VADMS_Document_ID)
                    //                                                                INNER JOIN AD_WF_Activity WA ON (WA.Record_ID=MD.VADMS_MetaData_ID)
                    //                                                                INNER JOIN AD_WF_Node NODE ON (NODE.AD_WF_Node_ID=WA.AD_WF_Node_ID)
                    //                                                                INNER JOIN AD_WF_NodeNext NN ON (NN.AD_WF_Node_ID=NODE.AD_WF_Node_ID)
                    //                                                                INNER JOIN AD_WF_NextCondition NC ON (NC.AD_WF_NodeNext_ID=NN.AD_WF_NodeNext_ID)
                    //                                                                WHERE NC.AD_WF_NextCondition_ID=" + GetAD_WF_NextCondition_ID(), null, Get_TrxName()));
                    //                                    object[] parametersArray = new object[] { value1S, Env.GetCtx().GetAD_Language(), docID };
                    //                                    result = methodInfo.Invoke(classInstance, parametersArray);
                    //                                }
                    //                                if (result == null)
                    //                                {
                    //                                    log.Severe("Mehtod Not Invoked Successfully:ViennaAdvantage.Classes.DocumentOperation.DocumentContainText");
                    //                                    return false;
                    //                                }
                    //                                else if (result.ToString() == "Y")
                    //                                {
                    //                                    log.Fine("DocumentContainText Invoked Successfully, Result Is" + result.ToString());
                    //                                    return true;
                    //                                }
                    //                                else
                    //                                {
                    //                                    log.Fine("DocumentContainText Invoked Successfully, Result Is" + result.ToString());
                    //                                    return false;
                    //                                }
                    //                            }
                    //                            log.Severe("Cant Get Method of ViennaAdvantage.Classes.DocumentOperation From VADMSSvc File.");
                    //                        }
                    //                        log.Severe("Cant Get Type of ViennaAdvantage.Classes.DocumentOperation From VADMSSvc File.");

                    //                    }
                    //                    catch (Exception ex)
                    //                    {
                    //                        log.Severe("Error Occured During ConditionEvaluation of DocumentContainText:" + ex.Message);
                    //                        return false;
                    //                    }
                    //                    return false;

                    int    docID = Util.GetValueOfInt(DB.ExecuteScalar(@"SELECT Doc.VADMS_Document_ID
                                                FROM VADMS_Document Doc
                                                INNER JOIN VADMS_MetaData MD ON (MD.VADMS_Document_ID=Doc.VADMS_Document_ID)
                                                INNER JOIN AD_WF_Activity WA ON (WA.Record_ID=MD.VADMS_MetaData_ID)
                                                INNER JOIN AD_WF_Node NODE ON (NODE.AD_WF_Node_ID=WA.AD_WF_Node_ID)
                                                INNER JOIN AD_WF_NodeNext NN ON (NN.AD_WF_Node_ID=NODE.AD_WF_Node_ID)
                                                INNER JOIN AD_WF_NextCondition NC ON (NC.AD_WF_NodeNext_ID=NN.AD_WF_NodeNext_ID)
                                                WHERE NC.AD_WF_NextCondition_ID=" + GetAD_WF_NextCondition_ID() + @"
                                                AND WA.AD_WF_Activity_ID=" + AD_WF_Activity_ID, null, Get_TrxName()));
                    string res   = string.Empty;
                    //GetPO(Get_TrxName());
                    DocumentAction docAction = new DocumentAction();
                    return(docAction.IsDocumentContainsText(docID, value1S, GetCtx().GetAD_Language(), out res));

                    //return ok;
                }
                else
                {
                    return(EvaluateLogic(valueObj, value1S, op));
                }
            }
            catch
            {
                return(false);
            }
        }