예제 #1
0
        /// <summary>
        /// 取得要引用的條件
        /// </summary>
        /// <param name="AParamName">條件參數名稱</param>
        /// <param name="AParamValue">條件參數值</param>
        /// <returns>條件語法內容</returns>
        public virtual string getCondition(string AParamName, string AParamValue, bool bReplaceKeyword)
        {
            if (AParamName != null && ConditionDictionary.ContainsKey(AParamName))
            {
                if ((AParamName == "MingTai") ||
                    (AParamName == "Aegon") ||
                    (AParamName == "PcaLife") ||
                    (AParamName == "EmployeeSerNoTree") ||
                    (AParamName == "EmployeeTree") ||
                    (AParamName == "DBGSernoNotIn") ||
                    (AParamName == "DBGSernoIn") ||
                    (AParamName == "RTATree") ||
                    (AParamName == "CAPTree") ||
                    (AParamName == "RstStatusIn") ||
                    (AParamName == "MutileTree") ||
                    (AParamName == "JobIDIn") ||
                    (AParamName == "CampaignSerNoIn") ||
                    (AParamName == "EmployeeBossTree") ||
                    (AParamName == "CAPTree") ||
                    (AParamName == "RTACategory2In") ||
                    (AParamName == "RosterAliasSerNoIn") ||
                    (AParamName == "StatusIn"))
                {
#if (Encrypt)
                    foreach (string field in _encryptFields)
                    {
                        if (ConditionDictionary[AParamName].ToString().IndexOf(field) > -1)
                        {
                            return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue == null ? "" : Encrypt(AParamValue)));
                        }
                    }
                    return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue == null ? "" : AParamValue));
#else
                    return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue == null ? "" : AParamValue));
#endif
                }
                else
                {
#if (Encrypt)
                    foreach (string field in _encryptFields)
                    {
                        if (ConditionDictionary[AParamName].ToString().IndexOf(field) > -1)
                        {
                            return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue == null ? "" : Encrypt(AParamValue)));
                        }
                    }
                    return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue == null ? "" : AParamValue));
#else
                    return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue == null ? "" : ((bReplaceKeyword) ? AParamValue.Replace("'", "''") : AParamValue)));
#endif
                }
            }
            else
            {
                return("");
            }
        }
예제 #2
0
 /// <summary>
 /// 取得要引用的條件
 /// </summary>
 /// <param name="AParamName">條件參數名稱</param>
 /// <param name="AParamValue">條件參數值</param>
 /// <returns>條件語法內容</returns>
 public virtual string getCondition(string AParamName, string AParamValue)
 {
     if (ConditionDictionary.ContainsKey(AParamName))
     {
         if (((string)ConditionDictionary[AParamName]).IndexOf("'?'") > 0)
         {
             ((string)ConditionDictionary[AParamName]).Replace("'?'", "N'?'");
         }
         return(((string)ConditionDictionary[AParamName]).Replace("?", AParamValue));
     }
     else
     {
         return("");
     }
 }