private void SetHao(ViTriHao viTriHao, TungXu tungXu) { switch (viTriHao) { case ViTriHao.None: break; case ViTriHao.Hao1: CheckHaoAndHaoDong(ucQueDich.uiHao1, ucQueDich.uiIsHao1Dong, tungXu); break; case ViTriHao.Hao2: CheckHaoAndHaoDong(ucQueDich.uiHao2, ucQueDich.uiIsHao2Dong, tungXu); break; case ViTriHao.Hao3: CheckHaoAndHaoDong(ucQueDich.uiHao3, ucQueDich.uiIsHao3Dong, tungXu); break; case ViTriHao.Hao4: CheckHaoAndHaoDong(ucQueDich.uiHao4, ucQueDich.uiIsHao4Dong, tungXu); break; case ViTriHao.Hao5: CheckHaoAndHaoDong(ucQueDich.uiHao5, ucQueDich.uiIsHao5Dong, tungXu); break; case ViTriHao.Hao6: CheckHaoAndHaoDong(ucQueDich.uiHao6, ucQueDich.uiIsHao6Dong, tungXu); break; default: break; } }
private void SetResultForHaoAndHaoDong(ViTriHao viTriHao) { TungXu tungXu = new TungXu(); tungXu.Run(); SetHao(viTriHao, tungXu); ucQueDich.ShowCacHao(viTriHao); labelKetQua.Text = tungXu.GetKetQua(); }
private void CheckHaoAndHaoDong(ucLabel chkHao, CheckBox chkHaoDong, TungXu tungXu) { chkHao.Checked = tungXu.Duong; chkHaoDong.Checked = tungXu.Dong; }