public void UpdateSelectType(ConfigueSectionAGetModel configueSectionAGetModel) { if (configueSectionAGetModel.LengthAB < 200) { configueSectionAGetModel.PartTypeItems = new List <SelectListItem> { new SelectListItem { Value = "LL1", Text = "LL1" }, new SelectListItem { Value = "LL2", Text = "LL2" }, new SelectListItem { Value = "LL3", Text = "LL3" } }; } else { configueSectionAGetModel.PartTypeItems = new List <SelectListItem> { new SelectListItem { Value = "LL4", Text = "LL4" }, new SelectListItem { Value = "LL5", Text = "LL5" } }; } }
public void UpdateLengthA_LengthB(ConfigueSectionAGetModel configueSectionAGetModel) { if (configueSectionAGetModel.LengthAB != configueSectionAGetModel.LengthA + configueSectionAGetModel.LengthB) { configueSectionAGetModel.LengthAB = configueSectionAGetModel.LengthA + configueSectionAGetModel.LengthB; } }
public IActionResult Update(ConfigueSectionAGetModel configueSectionAGetModel, [FromRoute] int id) { if (id == 0) { return(NotFound()); } var model = _configureService.UpdateConfigueSectionAModel(id, configueSectionAGetModel); return(View(model)); }
public IActionResult Create(ConfigueSectionAGetModel configueSectionAGetModel) { var model = new ConfigureSectionsModel { ConfigueSectionAGetModel = configueSectionAGetModel }; if (ModelState.IsValid) { var id = _configureService.AddConfigueSectionAModel(configueSectionAGetModel); return(Redirect($"Update/{id}")); } return(View("Index", model)); }
public ConfigureSectionsUpdateModel UpdateConfigueSectionAModel(int id, ConfigueSectionAGetModel configueSectionAGetModel) { var model = new ConfigureSectionsUpdateModel { ConfigueSectionAGetModel = configueSectionAGetModel, Id = id }; UpdateSelectType(model.ConfigueSectionAGetModel); var data = DummayData[id]; data.LengthA = configueSectionAGetModel.LengthA; data.LengthB = configueSectionAGetModel.LengthB; data.LengthAB = configueSectionAGetModel.LengthAB; data.PartType = configueSectionAGetModel.PartType; return(model); }
public IActionResult UpdateViewData(ConfigueSectionAGetModel configueSectionAGetModel) { _configureService.UpdateLengthA_LengthB(configueSectionAGetModel); _configureService.UpdateSelectType(configueSectionAGetModel); return(PartialView("PartialConfigure", configueSectionAGetModel)); }