예제 #1
0
        /// <summary>
        /// 进行除法运算
        /// </summary>
        /// <param name="handle"></param>
        /// <returns></returns>
        internal static string DoMod(BQLOperatorHandle handle, KeyWordInfomation info)
        {
            BQLValueItem[] parameters = handle.GetParameters();
            BQLValueItem   item1      = parameters[0];
            BQLValueItem   item2      = parameters[1];
            string         value1     = item1.DisplayValue(info);
            string         value2     = item2.DisplayValue(info);

            return(info.DBInfo.Math.DoMod(new string[] { value1, value2 }));
        }
예제 #2
0
        /// <summary>
        /// 进行加法运算
        /// </summary>
        /// <param name="handle"></param>
        /// <returns></returns>
        internal static string DoAdd(BQLOperatorHandle fHandle, KeyWordInfomation info)
        {
            BQLValueItem[] parameters = fHandle.GetParameters();
            BQLValueItem   item1      = parameters[0];
            BQLValueItem   item2      = parameters[1];

            if (IsStringDBType(item1.ValueDbType) || IsStringDBType(item2.ValueDbType)) //字符串拼合
            {
                string value1 = item1.DisplayValue(info);
                string value2 = item2.DisplayValue(info);
                //if(OperatorPrecedenceUnit.LeftNeedBreak(
                fHandle.ValueDbType = DbType.String;
                return(info.DBInfo.CurrentDbAdapter.ConcatString(value1, value2));
            }
            else
            {
                fHandle.ValueDbType = DbType.Double;
            }
            return(CustomerConnectFunction(fHandle.GetParameters(), "+", info, fHandle.PriorityLevel));
        }
예제 #3
0
 /// <summary>
 /// 运算符函数
 /// </summary>
 /// <param name="fHandle">函数信息</param>
 /// <param name="connect">连接符号</param>
 /// <returns></returns>
 private static string OperatorFunction(BQLOperatorHandle fHandle, string connect, KeyWordInfomation info)
 {
     fHandle.ValueDbType = DbType.Double;
     return(CustomerConnectFunction(fHandle.GetParameters(), connect, info, fHandle.PriorityLevel));
 }