private void cmbx_group_SelectedIndexChanged(object sender, EventArgs e) { string sesValue = cmbx_session.SelectedValue.ToString(); string grValue = cmbx_group.SelectedValue.ToString(); List <FinishResult> finishResults = new List <FinishResult>(); using (SqlConnection sqlConnection = new SqlConnection(Extension.ConnectToDb())) { sqlConnection.Open(); using (SqlCommand sqlCommand = new SqlCommand(Extension.StudentRatingQuery(sesValue, grValue), sqlConnection)) { using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader()) { using (DataTable dataTable = new DataTable()) { while (sqlDataReader.Read()) { FinishResult finishResult = new FinishResult() { SudentName = sqlDataReader["StName"].ToString(), Results = int.Parse(sqlDataReader["SessiounAVGPounts"].ToString()) }; finishResults.Add(finishResult); } dtgv_student_rating.DataSource = finishResults; } } } } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is Item) { object message = null; FinishResult res = Finish.Invoke(from, m_CraftSystem, m_Tool, (Item)targeted, ref message, m_Polish); bool bad = true; switch (res) { case FinishResult.NotInBackpack: message = "The item must be in your backpack to finish it."; break; // The item must be in your backpack to Finish it. case FinishResult.BadContext: message = "Context not found."; break; // The item must be in your backpack to Finish it. case FinishResult.AlreadyFinishd: message = "You've done as much finishing work as you can on this item."; break; // This item is already Finishd with the properties of a special material. case FinishResult.BadItem: message = "You may not do any finishing work on that."; break; // You cannot Finish this type of item with the properties of the selected special material. case FinishResult.WrongOne: message = "No, that's not right at all, you've ruined any hope of perfecting it."; ((TeiravonMobile)from).LastCrafted = null; break; case FinishResult.FinishNext: { bad = false; from.BeginAction(typeof(CraftSystem)); new InternalTimer(from, m_CraftSystem, m_Tool, Utility.RandomMinMax(4, 10)).Start(); break; } } if (bad) { from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message)); } } }
private void cmbx_faculty_SelectedIndexChanged(object sender, EventArgs e) { string facValue = cmbx_faculty.SelectedValue.ToString(); string sesValue = cmbx_session.SelectedValue.ToString(); List <FinishResult> finishResults = new List <FinishResult>(); string connection = "Data Source= DESKTOP-A4JVK6F\\SQLEXPRESS; Initial Catalog=AZTU; Integrated Security=true;"; using (SqlConnection sqlConnection = new SqlConnection(connection)) { sqlConnection.Open(); string query = @"SELECT Stud.Name AS [StName] , AVG(Pounts.ResultPount) AS SessiounAVGPounts FROM Students as Stud INNER JOIN Groups AS GR ON GR.ID=Stud.GroupID INNER JOIN Professions AS PR ON PR.ID=GR.ProfessionID INNER JOIN Departments AS DP ON DP.ID = PR.DepartmentID INNER JOIN Faculties AS F ON F.ID=DP.FacultyID INNER JOIN Pounts ON Pounts.StudentID = Stud.ID INNER JOIN Sessions AS SES ON SES.ID = Pounts.SessionID INNER JOIN Subjects ON Pounts.SubjectID = Subjects.ID WHERE F.ID=" + facValue + " AND SES.ID=" + sesValue + " Group by Stud.Name ORDER BY SessiounAVGPounts DESC"; using (SqlCommand sqlCommand = new SqlCommand(query, sqlConnection)) { using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader()) { while (sqlDataReader.Read()) { FinishResult finishResult = new FinishResult() { SudentName = sqlDataReader["StName"].ToString(), Results = int.Parse(sqlDataReader["SessiounAVGPounts"].ToString()) }; finishResults.Add(finishResult); } dtgv_groups.DataSource = finishResults; } } } }
private void Cmbx_faculty_SelectedIndexChanged(object sender, EventArgs e) { string sesValue = cmbx_session.SelectedValue.ToString(); string facValue = cmbx_faculty.SelectedValue.ToString(); List <FinishResult> allFinishResults = new List <FinishResult>(); string conString = "Data Source= DESKTOP-A4JVK6F\\SQLEXPRESS;Initial Catalog=AZTU;Integrated Security=SSPI"; using (SqlConnection connection = new SqlConnection(conString)) { connection.Open(); string query = @"SELECT Stud.Name AS [StName] , AVG(Pounts.ResultPount) AS SessiounAVGPounts FROM Students as Stud INNER JOIN Groups AS GR ON GR.ID=Stud.GroupID INNER JOIN Pounts ON Pounts.StudentID = Stud.ID INNER JOIN Sessions ON SessionID = Pounts.SessionID INNER JOIN Subjects ON Pounts.SubjectID = Subjects.ID WHERE SessionID=" + sesValue + " AND GR.ID=" + facValue + " Group by Stud.Name ORDER BY SessiounAVGPounts DESC"; using (SqlCommand command = new SqlCommand(query, connection)) { using (SqlDataReader sqlDataReader = command.ExecuteReader()) { using (DataTable dataTable = new DataTable()) { while (sqlDataReader.Read()) { FinishResult allFinishResult = new FinishResult() { SudentName = sqlDataReader["StName"].ToString(), Results = int.Parse(sqlDataReader["SessiounAVGPounts"].ToString()) }; allFinishResults.Add(allFinishResult); } dtgv_student_rating.DataSource = allFinishResults; } } } } }
public void Finish(FinishResult result) { if (!IsRunning) { return; } IsRunning = false; Target.Save.Result = result; Target.Save.TimeElapsed = Time.fixedTime - _StartTime; NicknameInputPlaceholder.SetText(CurrentNickname); NicknameInputOverlay.SetActive(true); if (Target.Save.Finished) { NicknamePromptMessage.SetText($"Congratulations! Your time: {Target.Save.TimeElapsed}"); } else { NicknamePromptMessage.SetText($"Your score: {Target.Save.Score}"); } }