c# - How to check the missing element in the sequence -


I am doing a project related to payroll where for each I will have some payperiodnumbers Has been run.

Let's say that when I bind to a grid

image here Enter the details

Now if I select 1 from the grid and click when I delete, I'll tell you an error message, you must first delete the maximum payment period.

Similarly, if my maximum salary is in the form of the period number 7 and if the user chooses 1,2,3,4, 5,6 And try to delete I would like to display the same error. I am saving the selected id of in an એરલલિસ્ટ so that someone can help me how I can check my status as I can get the maximum paydaydays using the query But I want to do the rest of the code.

I am using 2.0 , so there is no point in using LINQ here. Anyone can help me

As Azodious told me that I am showing a situation that should work and nothing

if max Number and I would like to display an error message if I select 1,5,7 .

If I select 5,6,7 it should be deleted.

something like this:

  selectedNumbers.Sort (); SelectedNumbers.Reverse (); Int maxPeriodNumber = 5; // This is the full last address you have = (int) the selected number [0]; If the (final value & lt; maxPeriodNumber) {// highest number selected is smaller than necessary, warn the user or remove the exception return; } Foreach (int value in selected digits) {if (val> (final value-1)) // // numbering is a difference, warn the user or remove the exception return; } LastValue = val; } // When you end here, everything is fine and you can delete items whose number is in the list    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -