Ejemplo n.º 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 }));
        }
Ejemplo n.º 2
0
        public static BQLOperatorHandle operator /(BQLValueItem handle, object value)
        {
            BQLValueItem oValue = ToValueItem(value);

            UnityDbType(handle, oValue);
            BQLOperatorHandle fHandle = new BQLOperatorHandle(FunctionManager.DoDiv, new BQLValueItem[] { handle, oValue });

            //fHandle.PriorityLevel = 7;
            fHandle.PriorityLevel = OperatorPrecedenceUnit.GetPrecedence("/");
            return(fHandle);
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
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));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 进行除法运算
 /// </summary>
 /// <param name="handle"></param>
 /// <returns></returns>
 internal static string DoDiv(BQLOperatorHandle handle, KeyWordInfomation info)
 {
     return(OperatorFunction(handle, "/", info));
 }