private async void link_lbl_go_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var intakeListActivity = new IntakeListActivity(); var intakeCheckActivity = new IntakeCheckActivity(); var intakeTimetableActivity = new IntakeTimetableActivity(); var result = tb_intake_code.Text.ToUpper(); var errorCode = 0; for (var i = 0; i < intakeListActivity.GetIntakeCode().Count; i++) { if (result == intakeListActivity.GetIntakeCode()[i]) { errorCode = 3; } } if (!intakeCheckActivity.GetIntakeCheck(result) && errorCode == 3) { errorCode = 1; } switch (errorCode) { case 0: lbl_message.Visible = true; lbl_message.Text = "Invalid Intake Code"; break; case 1: lbl_message.Visible = true; lbl_message.Text = "You have no class on this week."; break; case 3: pnl_home.Visible = false; pnl_pw.Visible = true; lbl_message.Visible = false; //Download the data if no error await Task.Run(() => intakeTimetableActivity.GetIntakeTimetable()); pnl_pw.Visible = false; pnl_Timetable.Visible = true; lbl_IntakeCode.Text = result; //Show TimeTable Data LoadTimeTableData(); break; } }
private async void lnklbl_update_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { pnl_pw.Visible = true; pnl_Timetable.Visible = false; IntakeCheckActivity intakeCheckActivity = new IntakeCheckActivity(); IntakeTimetableActivity intakeTimetableActivity = new IntakeTimetableActivity(); intakeCheckActivity.GetIntakeCheck(lbl_IntakeCode.Text); await Task.Run(() => intakeTimetableActivity.GetIntakeTimetable()); pnl_pw.Visible = false; pnl_Timetable.Visible = true; //Show TimeTable Data LoadTimeTableData(); }