display warning when users enter a value greater than the actual value - vb.net

can anyone give me some idea how to write a code to display warning when users enter a value greater than the actual value, but it still can enter values ​​for other fields. I use VB.net and access database. I think it is able to use onchange but i still don't have any idea to write the code
here is example

Use the built-in validation scheme. Example here :
http://msdn.microsoft.com/en-us/library/system.windows.data.binding.validatesondataerrors.aspx

Related

How to create a custom Allure step function for sensible data

I am currently working on a Testing Automation team, using Python and Allure to make reports of all the test cases that we run. Sometimes we deal with sensible data (e.g: passwords) that I can't show on the reports. If I use a function with a step decorator, something like this:
Which takes an element (a text box) and enters the value in it. In the step function I display the value that I want to enter, I could easily change that but the problem resides in the actual report. No matter what I enter on the step title, the report always shows the info that was passed as arguments to the function:
Thus, the "value" argument will always be displayed and that is something that I cannot have on certain projects. Is there anyway to make a custom step function that solves my problem?. I could either use with not showing the value at all or to change it to something like '*****'.
Just a thought.
#allure.step("Entering a value in element {3}")
def setSecureBoxValue(driver, element, value, box_name):
I solved my problem with the use of Fernet cryptography library.
I created a new function for the sensible data that encrypts the strings and then, inside this new function I call the one I shared on the screenshot (with a slight modification to decrypt the data). This results in the following report:

Bug in Google Sheets Formatting

I believe I may have found a bug in Google Sheets formatting or else my preferred option is I'm doing something wrong! * Brief rant - I find GridRange a PITBS!! Rant over.
I'm simply trying to format a cell and make the text bold. I send the following JSON request:
{"requests":[{"repeatCell":{"range":{"startRowIndex":1,"endRowIndex":"2","startColumnIndex":1,"endColumnIndex"
:2,"sheetId":0},"cell":{"effectiveFormat":{"textFormat":{"bold":"true"}}},"fields":"*"}},{"repeatCell"
:{"range":{"startRowIndex":7,"endRowIndex":"8","startColumnIndex":1,"endColumnIndex":7,"sheetId":0},"cell"
:{"effectiveFormat":{"textFormat":{"bold":"true"}}},"fields":"*"}}]}
And the values in the cells disappear?? I know the values are there because if I omit this styling code then nothing is altered and the values remain. What am I doing wrong? (For ref the fields here are B2:B2 and B8:G8). Any help gratefully appreciated.
I am sending this through the JS API but believe I have seen the same through the PHP too.
You are setting the fields parameter to *, which means, "I want to set every field.". Since you don't supply a value but said you want to set each field, the values are being reset to their defaults (which is empty).
If you only want to apply formatting, you need to set the fields parameter to just the format fields, e.g userEnteredFormat. See the documentation on field masks for more info.
Note also that you're attempting to set effectiveFormat, but per the reference docs that field is read-only.

Aurelia Value Converter Buggy Behavior with percentage

I am trying to convert a user input to a percentage using aurelia converter and Numeral.js.
Here is the gist: https://gist.run/?id=5bbfa902b1d14bff6f506dfcf2045370
The conversion is buggy. Basically, when I am entering the number, it does not behave as expected. Sometimes, I am not able to enter the value, and sometimes it just enters wrong value. The behavior is random.
I am not sure if the error is caused by value converter trying to convert the number at the same time I am typing. Is there a workaround?
It's trying to update on every key stroke. You want it to update after leaving the input. Try using value.bind="score | numberFormat & updateTrigger:'blur'" instead.
You can learn more about binding behaviors in the Aurelia docs.

Formatting duration for display

In a SAP database there are values formatted as PxDTyH where x is the number of days and y is the number of hours. A value like P2DT0H is 2 days + 0 hours. I can see that via SE16:
Unfortunately, this is exactly displayed like that to the user, "3" corresponds to the index in the database (not seen in the screenshot above).
I'd like to see it displayed
without the index (changing the options "show keys within drop-down lists" did not have an effect)
instead of the technical name P2DT0H I'd like to see "2 days and 0 hours" (or similar)
Is there a way to process the data before it gets displayed in the combo box? The developers can't change the format in the database because it would change the API.
FYI: I'm just a tester, I don't know how to code in ABAP, but from knowledge of other programming languages, I'd say that the data can be converted before it's displayed. I don't need a fully-fledged answer, just a pointer to a SAP hook or event which enables writing a conversion function.
Probably, conversion routines can be an option for you. What you should do is to:
Take your domain (which is used for PxDTyH values) or create new one specially for this.
Create FM with name CONVERSION_EXIT_%NAME%_OUTPUT, and put conversion logic in there. Mandatory parameters INPUT and OUTPUT should exist.
Enter the %NAME% into Convers.routine field in domain properties.
Enable Check conversion exits checkbox in user parameters.
More info is here.

iRegex for date in user entered textfield

I have an input box and the user can write his DOB(mm/dd/yyyy) into the box.
Before I save the data I like to test for valid input. I am using Regexlite.h and Regexlite.m.I have the regular expression too. I want to compare the regex to the user entered value in text box.But am not knowing how to do it.
Any idea how to test for a valid date? (in .NET I use a simple regex but for the iPhone sdk I am a bit helpless) - but somebody must have been done this before.
Here is a regex you can use to parse it if your looking for something else just leave me a comment
^\d{2}/\d{2}/\d{4}$
I think that you should do more validation than that---you don't want anything happening on 30 February nor allow a birth-year of 1001 and 3001 (time-travellers and Methusaleh's Children can go hang).
Perhaps someone cleverer than I could do this all with regular expressions, but I'd suggest just looking at the string and using some logic.
Why are you not using UIDatePicker to prevent user to enter your own not valid date.