public ViewResult Edit(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; var viewModel = new EditViewModel(treatmentBMPType); return(ViewEdit(viewModel, treatmentBMPType)); }
public PartialViewResult EditObservationTypesSortOrder(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; EditSortOrderViewModel viewModel = new EditSortOrderViewModel(); return(ViewEditObservationTypesSortOrder(treatmentBMPType, viewModel)); }
public PartialViewResult DeleteTreatmentBMPType(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; var viewModel = new ConfirmDialogFormViewModel(treatmentBMPType.TreatmentBMPTypeID); return(ViewDeleteTreatmentBMPType(treatmentBMPType, viewModel)); }
public ViewResult Detail(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; var viewData = new DetailViewData(CurrentPerson, treatmentBMPType); return(RazorView <Detail, DetailViewData>(viewData)); }
public PartialViewResult EditAttributeTypesSortOrder(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey, int attributeTypePurposeID) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; EditSortOrderViewModel viewModel = new EditSortOrderViewModel(); return(ViewEditAttributeTypesSortOrder(treatmentBMPType, viewModel, attributeTypePurposeID)); }
public ActionResult EditAttributeTypesSortOrder(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey, int attributeTypePurposeID, EditSortOrderViewModel viewModel) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewEditAttributeTypesSortOrder(treatmentBMPType, viewModel, attributeTypePurposeID)); } viewModel.UpdateModel(new List <IHaveASortOrder>(treatmentBMPType.TreatmentBMPTypeCustomAttributeTypes)); SetMessageForDisplay("Successfully Updated Attribute Type Sort Order"); return(new ModalDialogFormJsonResult()); }
public ActionResult EditObservationTypesSortOrder(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey, EditSortOrderViewModel viewModel) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewEditObservationTypesSortOrder(treatmentBMPType, viewModel)); } viewModel.UpdateModel(new List <IHaveASortOrder>(treatmentBMPType.TreatmentBMPTypeAssessmentObservationTypes)); SetMessageForDisplay("Successfully Updated Observation Type Sort Order"); return(new ModalDialogFormJsonResult()); }
public ActionResult DeleteTreatmentBMPType(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey, ConfirmDialogFormViewModel viewModel) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteTreatmentBMPType(treatmentBMPType, viewModel)); } var message = $"{FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabel()} '{treatmentBMPType.TreatmentBMPTypeName}' successfully deleted!"; treatmentBMPType.DeleteFull(HttpRequestStorage.DatabaseEntities); SetMessageForDisplay(message); return(new ModalDialogFormJsonResult()); }
public ActionResult Edit(TreatmentBMPTypePrimaryKey treatmentBMPTypePrimaryKey, EditViewModel viewModel) { var treatmentBMPType = treatmentBMPTypePrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewEdit(viewModel, treatmentBMPType)); } HttpRequestStorage.DatabaseEntities.TreatmentBMPTypeAssessmentObservationTypes.Load(); var treatmentBMPTypeAssessmentObservationTypes = treatmentBMPType.TreatmentBMPTypeAssessmentObservationTypes.ToList(); var allTreatmentBMPTypeAssessmentObservationTypes = HttpRequestStorage.DatabaseEntities.TreatmentBMPTypeAssessmentObservationTypes.Local; HttpRequestStorage.DatabaseEntities.TreatmentBMPTypeCustomAttributeTypes.Load(); var treatmentBMPTypeAttributeTypes = treatmentBMPType.TreatmentBMPTypeCustomAttributeTypes.ToList(); var allTreatmentBMPTypeCustomAttributeTypes = HttpRequestStorage.DatabaseEntities.TreatmentBMPTypeCustomAttributeTypes.Local; viewModel.UpdateModel(treatmentBMPType, treatmentBMPTypeAssessmentObservationTypes, allTreatmentBMPTypeAssessmentObservationTypes, treatmentBMPTypeAttributeTypes, allTreatmentBMPTypeCustomAttributeTypes); return(RedirectToAction(new SitkaRoute <TreatmentBMPTypeController>(c => c.Detail(treatmentBMPType.PrimaryKey)))); }
public GridJsonNetJObjectResult <vTreatmentBMPDetailedWithTreatmentBMPEntity> TreatmentBMPsInTreatmentBMPTypeGridJsonData(TreatmentBMPTypePrimaryKey treatmentBmpTypePrimaryKey) { var treatmentBmpType = treatmentBmpTypePrimaryKey.EntityObject; var stormwaterJurisdictionIDsPersonCanView = CurrentPerson.GetStormwaterJurisdictionIDsPersonCanView(); var showDelete = new JurisdictionManageFeature().HasPermissionByPerson(CurrentPerson); var showEdit = new JurisdictionEditFeature().HasPermissionByPerson(CurrentPerson); var gridSpec = new TreatmentBMPsInTreatmentBMPTypeGridSpec(CurrentPerson, showDelete, showEdit, treatmentBmpType); var treatmentBMPs = HttpRequestStorage.DatabaseEntities.TreatmentBMPs .Include(x => x.WaterQualityManagementPlan) .Include(x => x.CustomAttributes) .Include(x => x.CustomAttributes.Select(y => y.CustomAttributeValues)) .Where(x => stormwaterJurisdictionIDsPersonCanView.Contains(x.StormwaterJurisdictionID) && x.TreatmentBMPTypeID == treatmentBmpType.TreatmentBMPTypeID) .ToList() .Join(HttpRequestStorage.DatabaseEntities.vTreatmentBMPDetaileds, x => x.TreatmentBMPID, y => y.TreatmentBMPID, (x, y) => new vTreatmentBMPDetailedWithTreatmentBMPEntity(x, y)) .ToList(); var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <vTreatmentBMPDetailedWithTreatmentBMPEntity>(treatmentBMPs, gridSpec); return(gridJsonNetJObjectResult); }