Prizm.Main.Forms.Parts.Inspection.PartInspectionViewModel.InspectionTestResultsMaxOrder C# (CSharp) Méthode

InspectionTestResultsMaxOrder() public méthode

public InspectionTestResultsMaxOrder ( ) : int
Résultat int
        public int InspectionTestResultsMaxOrder()
        {
            var max = InspectionTestResults.Max(x => x.Order);
            return max;
        }

Usage Example

        private void inspectionsView_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
        {
            GridView             v = sender as GridView;
            InspectionTestResult inspectionTestResult
                = v.GetRow(e.RowHandle) as InspectionTestResult;

            inspectionTestResult.IsActive = true;
            inspectionTestResult.Status   = PartInspectionStatus.Pending;
            inspectionTestResult.Part     = viewModel.ConvertedPart;

            //set order
            inspectionTestResult.Order = viewModel.InspectionTestResultsMaxOrder() + 1;
        }