Your issue is because you are re-declaring your variables.
int myInt;
myInt = 22;
myInt = 33;
Once you declare a variable it is available throughout the scope, which is determined where you declare it.
For instance, if you declare it outside of a method, it is available throughout the entire class.
If you declare it inside a method, it is available throughout the method
If you declare it inside of an if or using statement then it is available throughout if or using statement but not outside of it.
Additional Examples below
using System;
private int ClassAccessibleInt = 12;
public static void Main(string[] args)
{
int MethodAccessibleInt = 10;
int AnotherMethodAccessibleInt = ClassAccessibleInt + MethodAccessibleInt;
if(DateTime.Today.Month > 2)
{
int IfAccessibleInt = DateTime.Today.Month + ClassAccessibleInt;
AnotherMethodAccessibleInt = AnotherMethodAccessibleInt + IfAccessibleInt;
}
}
Kind Regards