public ActionResult UpdateGrid(int hiddenYearFilter) { try { SiteUser su = ((SiteUser)Session["SiteUser"]); ModelServices modelServices = new ModelServices(); WeightingModel data = new WeightingModel(); int userAssignedDistrict = su.Districts[0].Id; data.DistrictName = modelServices.GetDistrictName(userAssignedDistrict); data.SchoolYear = modelServices.SchoolYearDescriptionByYearId(hiddenYearFilter); data.DropDown = new DropDownData(); data.DropDown.Year = new YearDropDown(modelServices.SchoolYearDropDownData()); data.DropDown.Year.SelectedYear = hiddenYearFilter; data.SummaryList = modelServices.GetWeightingSummary(userAssignedDistrict, hiddenYearFilter);; return(View("Index", data)); } catch (Exception ex) { Logging log = new Logging(); log.LogException(ex); return(View("GeneralError")); } }
public static void ApplyToWeighting(Weighting rule, WeightingModel command) { rule.RuleId = command.RuleId > 0 ? command.RuleId : rule.RuleId; rule.Description = command.Description; rule.InternalType = command.InternalType; //rule.ForceUnderOver = command.ForceUnderOver; //rule.Ignore = command.Ignore; rule.InternalType = command.InternalType; //rule.Over = command.Over; rule.Type = command.Type; //rule.Under = command.Under; rule.Value = command.Value; }
private static Weighting MapToWeighting(WeightingModel command) { var weighting = new Weighting() { Description = command.Description, InternalType = command.InternalType, RuleId = command.RuleId, //ForceUnderOver = command.ForceUnderOver, //Ignore = command.Ignore, //Over = command.Over, Type = command.Type, //Under = command.Under, Value = command.Value }; return(weighting); }