Skip to content

Commit

Permalink
Demo client, first cut
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtavenko committed Apr 30, 2014
1 parent dd9b401 commit 46eb0ea
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 31,267 deletions.
3 changes: 1 addition & 2 deletions SqlCop.DemoClient/App_Start/AutoMapperConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public class AutoMapperConfig
{
public static void CreateMaps()
{
Mapper.CreateMap<RuleModel, ViewModels.Rule>()
.ForMember(m => m.Selected, opt => opt.UseValue(true));
Mapper.CreateMap<RuleModel, ViewModels.Rule>();
}
}
}
12 changes: 8 additions & 4 deletions SqlCop.DemoClient/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public ActionResult Index(Home model)
var dto = new CheckRules { Sql = model.Sql, Rules = new List<RuleModel>()};

if (model.SelectedRules != null)
{
{
foreach (string ruleId in model.SelectedRules)
{
dto.Rules.Add(new RuleModel { Id = ruleId, Namespace = "SqlCop.Rules" });
var item = homeModel.AllRules.SingleOrDefault(s => s.Id == ruleId);
//if (item != null) item.Selected = true;
if (item != null) item.Selected = true;
}
}

Expand All @@ -52,11 +52,15 @@ public ActionResult Index(Home model)
{
homeModel.ErrorDescription = ex.ErrorMessage;
}
if (response !=null && response.Any())

if (response != null && response.Any())
{
homeModel.Problems = response;
}
else
{
homeModel.SuccessMessage = "No rule violations found";
}

return View(homeModel);
}
Expand Down
Binary file modified SqlCop.DemoClient/Scripts/_references.js
Binary file not shown.
2,494 changes: 0 additions & 2,494 deletions SqlCop.DemoClient/Scripts/jquery-1.8.2.intellisense.js

This file was deleted.

Loading

0 comments on commit 46eb0ea

Please sign in to comment.