public string RenderTab(BsEditorRepositorySettings <ContributorType> settings, out int count) { var html = string.Empty; count = 0; GroupEditorModel model = new GroupEditorModel(); if (settings.Search == null) { settings.Search = new ContributorSearchModel(); } switch (settings.TabId) { case ContributorType.Developer: ((ContributorSearchModel)settings.Search).RolesFilter = new List <ProjectRole>() { ProjectRole.Developer, ProjectRole.TeamLeader }; var gridDevelopers = repo.ToBsGridViewModel(settings.ToGridRepositorySettings <ContributorSearchModel>(), out count); model.Developers = new BsEditorTabModel <ContributorRowModel, ContributorSearchModel, ContributorNewModel> { Grid = gridDevelopers }; break; case ContributorType.Tester: ((ContributorSearchModel)settings.Search).RolesFilter = new List <ProjectRole>() { ProjectRole.Tester }; var gridTesters = repo.ToBsGridViewModel(settings.ToGridRepositorySettings <ContributorSearchModel>(), out count); model.Testers = new ContributorsInheritExample { Grid = gridTesters }; break; } var viewModel = new GroupEditorViewModel() { Editor = model }; html = this.BsRenderPartialView("_Editors", viewModel); return(html); }
public BsJsonResult Search(ContributorSearchModel model, ContributorType tabId) { var settings = new BsEditorRepositorySettings <ContributorType> { Search = model, TabId = tabId }; var count = 0; var html = this.RenderTab(settings, out count); return(new BsJsonResult(new { Count = count, Html = html })); }
public BsJsonResult GetTab(BsEditorRepositorySettings<ContributorType> settings) { var msg = string.Empty; var status = BsResponseStatus.Success; var html = string.Empty; var count = 0; try { html = RenderTab(settings, out count); } catch (Exception ex) { msg = ex.Message; status = BsResponseStatus.ServerError; } return new BsJsonResult(new { Count = count, Html = html }, status, msg); }
public BsJsonResult GetTab(BsEditorRepositorySettings <YesNoValueTypes> settings) { var msg = string.Empty; var status = BsResponseStatus.Success; var html = string.Empty; var count = 0; try { html = RenderTab(settings, out count); } catch (Exception ex) { msg = ex.Message; status = BsResponseStatus.ServerError; } return(new BsJsonResult(new { Count = count, Html = html }, status, msg)); }
public BsJsonResult Search(ContributorSearchModel model, ContributorType tabId) { var settings = new BsEditorRepositorySettings<ContributorType> { Search = model, TabId = tabId }; var count = 0; var html = this.RenderTab(settings, out count); return new BsJsonResult(new { Count = count, Html = html }); }
public string RenderTab(BsEditorRepositorySettings<ContributorType> settings, out int count) { var html = string.Empty; count = 0; GroupEditorModel model = new GroupEditorModel(); if (settings.Search == null) { settings.Search = new ContributorSearchModel(); } switch (settings.TabId) { case ContributorType.Developer: ((ContributorSearchModel)settings.Search).RolesFilter = new List<ProjectRole>() { ProjectRole.Developer, ProjectRole.TeamLeader }; var gridDevelopers = repo.ToBsGridViewModel(settings.ToGridRepositorySettings<ContributorSearchModel>(), out count); model.Developers = new BsEditorTabModel<ContributorRowModel, ContributorSearchModel, ContributorNewModel> { Grid = gridDevelopers }; break; case ContributorType.Tester: ((ContributorSearchModel)settings.Search).RolesFilter = new List<ProjectRole>() { ProjectRole.Tester }; var gridTesters = repo.ToBsGridViewModel(settings.ToGridRepositorySettings<ContributorSearchModel>(), out count); model.Testers = new ContributorsInheritExample { Grid = gridTesters }; break; } var viewModel = new GroupEditorViewModel() { Editor = model }; html = this.BsRenderPartialView("_Editors", viewModel); return html; }