private IRestRequest GetRequest(MethodMetadata methodMetadata, object[] args) { var bindingSource = new ModelBindingSource(); foreach (var parameter in methodMetadata.MethodInfo.GetParameters()) { var parameterValue = new RestValue(args[parameter.Position], parameter.ParameterType); bindingSource.AddValue(parameter.Name, parameterValue); } return(_modelMapper.MapRequest(methodMetadata.Request, bindingSource)); }
private void update(SearchModel searcher) { searcher.name = nameText.Text.Trim(); searcher.code = codeText.Text.Trim(); Pagination pagination = ConfigResolver.GetInstance().GetDataProvider().Provide(searcher); ModelBindingSource.Clear(); for (int i = 0; i < pagination.Records.Count; i++) { ModelBindingSource.Add(pagination.Records[i]); } if (pagination.PageNo <= 1) { ForwardFirstLabel.Enabled = false; ForwardPrevLabel.Enabled = false; } else { ForwardFirstLabel.Enabled = true; ForwardPrevLabel.Enabled = true; } if (searcher.pageNo >= pagination.getTotalPage()) { ForwardNextLabel.Enabled = false; ForwardLastLabel.Enabled = false; } else { ForwardNextLabel.Enabled = true; ForwardLastLabel.Enabled = true; } StatisticLabel.Text = String.Format("页次:{0}/{1} 共{2}条数据", pagination.PageNo, pagination.getTotalPage(), pagination.TotalCount); PagingPanel.Tag = pagination; ForwardPageText.Text = pagination.PageNo.ToString(); StudentTable.ClearSelection(); }
private void CancelButton_Click(object sender, EventArgs e) { ModelBindingSource.Clear(); }