Пример #1
0
        private void textBoxLoanCycle_TextChanged(object sender, EventArgs e)
        {
            int?loanCycle = ServicesHelper.ConvertStringToNullableInt32(textBoxLoanCycle.Text);

            if (!loanCycle.HasValue)
            {
                textBoxLoanCycle.BackColor = Color.Red;
                _tempPerson.LoanCycle      = 0;
            }
            else
            {
                textBoxLoanCycle.BackColor = Color.White;
                _tempPerson.LoanCycle      = loanCycle.Value;
            }
        }
Пример #2
0
 public void TestConvertStringToNullableInt32()
 {
     Assert.AreEqual(3, ServicesHelper.ConvertStringToNullableInt32("3").Value);
 }
Пример #3
0
 public void TestConvertStringToNullableInt32WhenStringIsEmpty()
 {
     Assert.AreEqual(null, ServicesHelper.ConvertStringToNullableInt32(String.Empty));
 }