Example #1
0
        /// <summary>
        /// 批量添加用户
        /// </summary>
        /// <param name="UserList"></param>
        /// <returns></returns>
        public int AddUser(List <IUser> UserList)
        {
            IDvTableBatch dvtb = entityfactory.CreateDriveTableBatch();

            foreach (IUser user in UserList)
            {
                dvtb.AddInsert(user);
            }
            int i = dvtb.Execute();

            return(i);
        }
Example #2
0
        /// <summary>
        /// 批量更新用户
        /// </summary>
        /// <param name="UserList"></param>
        /// <returns></returns>
        public int Update(List <IUser> UserList)
        {
            IDvTableBatch dvtb = entityfactory.CreateDriveTableBatch();

            foreach (IUser user in UserList)
            {
                IDvTable dvt = dvtb.CreateDriveTable(user);
                dvt.WhereClause("UserCode", Operator.Deng, LinkOperator.nul);
                dvtb.AddUpdate(dvt);
            }
            int i = dvtb.Execute();

            return(i);
        }