예제 #1
0
        public async Task <IHttpActionResult> Post([FromBody] GetMaterialTypeTestProtocolsRequestArgs requestArgs)
        {
            var data = await _materialTypeTestProtocolService.GetDataAsync(requestArgs);

            return(Ok(new
            {
                Data = data,
                Total = requestArgs.TotalRows
            }));
        }
예제 #2
0
        public async Task <DataTable> GetDataAsync(GetMaterialTypeTestProtocolsRequestArgs requestArgs)
        {
            var data = await DbContext.ExecuteDataSetAsync(DataConstants.PR_GET_MATERIAL_TYPE_TEST_PROTOCOLS,
                                                           CommandType.StoredProcedure,
                                                           args =>
            {
                args.Add("@Page", requestArgs.PageNumber);
                args.Add("@PageSize", requestArgs.PageSize);
                args.Add("@Filters", requestArgs.ToFilterString());
            });

            var table0 = data.Tables[0];

            if (table0.Columns.Contains("TotalRows"))
            {
                if (table0.Rows.Count > 0)
                {
                    requestArgs.TotalRows = table0.Rows[0]["TotalRows"].ToInt32();
                }
                table0.Columns.Remove("TotalRows");
            }
            return(table0);
        }
 public Task <DataTable> GetDataAsync(GetMaterialTypeTestProtocolsRequestArgs requestArgs)
 {
     return(_repository.GetDataAsync(requestArgs));
 }