我有GridView有一列是CheckBoxList(Mon, Tues, Wed, Thur, Fri, Sat, Sun)
选定周的数据:
- “1101000”的意思是(周一、周二、周四被选中)
- “1000000”均值(选择周一)
- “0100000”的意思(选择周二)
下面是用来标识所选项目的
Boolean isMonday = false;
Boolean isTuesday = false;
Boolean isWednesday = false;
Boolean isThursday = false;
Boolean isFriday = false;
Boolean isSaturday = false;
Boolean isSunday = false;
if (alertDayInt >= 1000000)
{
isMonday = true;
alertDayInt -= 1000000;
}
else if (alertDayInt >= 100000)
{
isTuesday = true;
alertDayInt -= 100000;
}
else if (alertDayInt >= 10000)
{
isWednesday = true;
alertDayInt -= 10000;
}
else if (alertDayInt >= 1000)
{
isThursday = true;
alertDayInt -= 1000;
}
else if (alertDayInt >= 100)
{
isFriday = true;
alertDayInt -= 100;
}
else if (alertDayInt >= 10)
{
isSaturday = true;
alertDayInt -= 10;
}
else if (alertDayInt >= 1)
{
isSunday = true;
alertDayInt -= 1;
}