public async Task <PartialViewResult> CreateOrEditModal(int?id) { var output = new PerformacneIndicatorDto(); if (id != null) { try { output = _staffPerformance.GetKeyResultAreaAttribute(new GetKeyResultAreaAttributeInput { AttributeId = id.Value }); } catch (Exception exception) { //ignored } } var viewModel = new CreateOrEditKeyResultAreaAttributeModel(output, id == null || id == 0); return(PartialView(viewModel)); }
public CreateOrEditKeyResultAreaAttributeModel(PerformacneIndicatorDto input, bool isNew) { IsEditMode = !isNew; Attribute = input; }