Example #1
0
        public object Insert(IConnection conn, object obj, string[] fields, string tablename)
        {
            ObjectManager oa = _d1.GetObjectManager(tablename);
            object        identity;

            return(oa.MyInsert(conn, obj, fields, out identity));
        }
Example #2
0
        /// <summary>
        /// 插入一条记录(指定数据库)
        /// </summary>
        /// <param name="conn">连接串信息</param>
        /// <param name="obj"></param>
        /// <param name="fields"></param>
        /// <returns></returns>
        public object Insert(IConnection conn, object obj, string[] fields)
        {
            //idSyc.Obj = obj;
            //asyncTriggerBroadcast asyCall = new asyncTriggerBroadcast(idSyc.StartBroadcast);
            //IAsyncResult result = asyCall.BeginInvoke(null, null);
            //asyCall.EndInvoke(result);

            ObjectManager oa = _d1.GetObjectManager(obj.GetType());
            object        identity;

            return(oa.MyInsert(conn, obj, fields, out identity));
        }
Example #3
0
        public object Insert(IConnection conn, object obj, string[] fields)
        {
            int    rowsAffected = 0;
            object identity     = null;
            bool   stoped       = false;

            AssistantEntity typedEntity = new AssistantEntity(obj);

            if (AssertContinueInserting(typedEntity, fields, out stoped))
            {
                ObjectManager oa = _d1.GetObjectManager(obj.GetType());
                rowsAffected = oa.MyInsert(conn, obj, fields, out identity);
            }
            if (!stoped)
            {
            }

            return(rowsAffected);
        }