Ejemplo n.º 1
0
        /// <summary>
        ///     加载数据
        /// </summary>
        /// <param name="where"></param>
        /// <param name="order"></param>
        private void LoadPageData(string where = null, string order = null)
        {
            //select * from ( select *,ROW_NUMBER() OVER(Order by Id) as rownum from Account) as twhere t.rownum between (@pageIndex - 1) * pageSize + 1 and @pageSize * pageIndex order by t.Id asc
            this.LoadData.Func = () => SqlHelperByYem.Query($"select * from(select *,ROW_NUMBER() OVER({order}) as rownum from core.UserAssetRatios where  IsDelete=0 and Status in(10,20,40) and DeptRedeemStatus=10 {where})as t where t.rownum between {(this.LoadData.PageIndex - 1) * this.LoadData.PageSize + 1} and {this.LoadData.PageSize * this.LoadData.PageIndex}", null, false);

            this.LoadData.FuncNums = () => Convert.ToInt16(SqlHelperByYem.ExecuteScalar($"select count(*) from core.UserAssetRatios where  IsDelete=0 and Status in(10,20,40) and DeptRedeemStatus=10  {where}"));

            this.LoadData.LoadOneTablePageData();
            this.LoadData.Action  = () => this.LoadData.Lbl_infos1.Text = "每页";
            this.LoadData.Atcion1 = () => { };
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     加载数据
        /// </summary>
        private void LoadPageData(int pageIndex, int type, string userId = "", string userAssetRatioId = "")
        {
            SqlParameter pageIndexParam        = new SqlParameter("@pageIndex", pageIndex);
            SqlParameter pageSizeParam         = new SqlParameter("@pageSize", Convert.ToInt32(this.cbx_pageSize.Text));
            SqlParameter userIdParam           = new SqlParameter("@userId", userId);
            SqlParameter userAssetRatioIdParam = new SqlParameter("@UserAssetRatioId", userAssetRatioId);
            SqlParameter totalCountParam       = new SqlParameter("@totalCount", SqlDbType.Int)
            {
                Direction = ParameterDirection.Output
            };

            SqlParameter[] sqlparams = { pageIndexParam, pageSizeParam, userIdParam, userAssetRatioIdParam, totalCountParam };

            this.LoadData.Func = () => SqlHelperByYem.Query(type == 0 ? "[Core].PROC_UserRedeemableSubOrderForDev" : "[Core].PROC_UserRedeemableUserAssetRatioForDev", sqlparams, true);

            this.LoadData.FuncNums = () => Convert.ToInt32(totalCountParam.Value);

            this.LoadData.LoadOneTablePageData();
            this.LoadData.Action = () => this.LoadData.Lbl_infos1.Text = "每页";
        }