public void init()
 {
     tq.erase();
     csq.erase();
     if (tq.queueno == "")
     {
         dt = new DataTable();
         dt = connect.executeQuery("select * from queue where division = 'Teller' and status in ('Not Done') limit 1");
         if (dt.Rows.Count != 0)
         {
             data1 = dt.Rows[0];
             tq.setValue(data1["queueno"].ToString(), data1["uniquequeue"].ToString());
             tellerqueue.Content = tq.queueno.ToString();
         }
     }
     if (csq.queueno == "")
     {
         dt2 = new DataTable();
         dt2 = connect.executeQuery("select * from queue where division = 'Customer Service' and status in ('Not Done') limit 1");
         if (dt2.Rows.Count != 0)
         {
             data2 = dt2.Rows[0];
             csq.setValue(data2["queueno"].ToString(), data2["uniquequeue"].ToString());
             csqueue.Content = csq.queueno.ToString();
         }
     }
 }
示例#2
0
        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();
        }