110,533
社区成员
发帖
与我相关
我的任务
分享
protected void UpdateState(string stateA, string stateB)
{
if (stateA == "0")
{
stateA = "1";
SetLoBcodeState(stateB);
}
else
{
stateA = "0";
SetLoBcodeState(stateB);
}
}
protected string SetStateB(string state)
{
switch (state)
{
case "0":
return "2";
case "1":
return "3";
case "2":
return "0";
case "3":
return "1";
default:
return "Wrong State Value";
}
}
protected void UpdateState2(string stateA, string stateB)
{
if (stateA == "0")
{
stateA = "1";//此时stateB为"2"或"3"
stateB = (Convert.ToInt32(stateB) + 2).ToString();
}
else
{
stateA = "0";//此时stateB为"0"或"1"
stateB = (Convert.ToInt32(stateB) - 2).ToString();
}
}
protected void UpdateState(string stateA, string stateB)
{
if (stateA == "0")
{
stateA = "1";
SetLoBcodeState(stateB);//这里应该是 SetStateB(stateB)
}
else
{
stateA = "0";
SetLoBcodeState(stateB);//这里应该是 SetStateB(stateB)
}
}