当前位置: 首页 > 工具软件 > TSK > 使用案例 >

Tsk4.5异步

洪和平
2023-12-01
public async void LoadData<T>(WhereClip where,OrderByClip order) where T : Entity, new()
        {
            try
            {
                cmd.ShowOpaqueLayer(this.GridViewCellPhone, 125, true);
                int perpage = pagerControl1.PageSize;
                int page = pagerControl1.PageIndex;

                List<T> result = await Task.Run(() => OrmHelper.GetData<T>(perpage, page, where, order));
                GridViewCellPhone.DataSource = result;
                int count = await Task.Run(() => OrmHelper.GetDataCount<T>(where));
                this.pagerControl1.DrawControl(count);
            }
            finally
            {
                cmd.HideOpaqueLayer();
            }
            
        }

 

 类似资料: