private void Button_Click(object sender, RoutedEventArgs e) { DataTable dt = new DataTable(); connect.executeUpdate("update queue set status = 'Done' where division = 'Customer Service' and status in ('Not Done') limit 1"); dt = connect.executeQuery("select * from queue where division = 'Customer Service' and status in ('Not Done') limit 1"); csq.erase(); if (dt.Rows.Count == 1) { DataRow data = dt.Rows[0]; csq.setValue(data["queueno"].ToString(), data["uniquequeue"].ToString()); } connect.executeUpdate("update employee set rating = (((rating*ratecount) + " + float.Parse(star.ToString()) + ")/(ratecount+1)), ratecount = (ratecount + 1) where id = '" + employee.id + "'"); MessageBox.Show("Thank You For Your Rating! "); Window cswindow = new CSWindow(employee); cswindow.Show(); this.Close(); }