/// <summary>
        /// 通过json对象执行标准化DB操作
        /// </summary>
        /// <param name="p"></param>
        /// <param name="json"></param>
        /// <param name="islog">用于设定是否记录解析结果,以便进行debug操作</param>
        /// <returns></returns>
        public static UnitDataCollection Excute(UnitParameter p, FrameDLRObject json, bool islog = false)
        {
            DBExpress express = null;

            if (p.Dao is ADBAccess)
            {
                express = ((ADBAccess)p.Dao).MyDBExpress;
                DBExpress.Load(express, json);
            }
            express.IsLog = islog;

            return(Excute(p, express));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 给Express加载对应的参数
        /// </summary>
        /// <param name="express"></param>
        /// <param name="json"></param>
        /// <returns></returns>
        public static void Load(DBExpress express, FrameDLRObject json)
        {
            var rtn        = express;
            var acttypekey = "$acttype";

            if (ComFunc.nvl(json.GetValue(acttypekey)) != "")
            {
                rtn.acttype = ComFunc.EnumParse <ActType>(ComFunc.nvl(json.GetValue(acttypekey)));
                json.Remove(acttypekey);
            }
            else
            {
                rtn.acttype = ActType.Query;
            }

            rtn.express = json;
        }
        /// <summary>
        /// 标准化DB执行操作
        /// </summary>
        /// <param name="p"></param>
        /// <param name="express"></param>
        /// <returns></returns>
        public static UnitDataCollection Excute(UnitParameter p, DBExpress express)
        {
            UnitDataCollection rtn = new UnitDataCollection();

            if (express != null)
            {
                p.SetValue("__json__", express);
                if (p.Dao is ADBAccess)
                {
                    if (express.CurrentAct == DBExpress.ActType.Query)
                    {
                        rtn = Query <JsonExpressUnit>(p, "");
                    }
                    else if (express.CurrentAct == DBExpress.ActType.QueryByPage)
                    {
                        rtn = QueryByPage <JsonExpressUnit>(p, "");
                    }
                    else
                    {
                        switch (express.CurrentAct)
                        {
                        case DBExpress.ActType.CreateTable:
                            rtn.ErrorMsg = ExcuteDDL <JsonExpressUnit>(p, "");
                            break;

                        case DBExpress.ActType.AlterColumn:
                            rtn.ErrorMsg = ExcuteDDL <JsonExpressUnit>(p, "");
                            break;

                        case DBExpress.ActType.DropTable:
                            rtn.ErrorMsg = ExcuteDDL <JsonExpressUnit>(p, "");
                            break;

                        default:
                            NonQuery <JsonExpressUnit>(p, "");
                            break;
                        }
                    }
                }
            }
            return(rtn);
        }
Exemplo n.º 4
0
        /// <summary>
        ///  给Express加载对应的参数
        /// </summary>
        /// <param name="express"></param>
        /// <param name="json"></param>
        public static void Load(DBExpress express, string json)
        {
            FrameDLRObject obj = FrameDLRObject.CreateInstance(json);

            Load(express, obj);
        }