Ejemplo n.º 1
0
        private void populateDgvQueue()
        {
            DataTable datatable;

            try
            {
                datatable = Queues.get(true, null, null, MAXDISPLAYEDQUEUE, null, null, Settings.QueueNoCutoffTimestamp);
                if (pnlHeader.BackColor == _HeaderColor_ERROR)
                {
                    pnlHeader.BackColor = _HeaderColor_DEFAULT;
                }
            }
            catch {
                //save default header color
                if (pnlHeader.BackColor != _HeaderColor_ERROR)
                {
                    _HeaderColor_DEFAULT = pnlHeader.BackColor;
                }

                //set header color to error
                pnlHeader.BackColor = _HeaderColor_ERROR;

                return;
            }

            Util.populateDataGridView(dgv, datatable);

            Guid newCalledId;

            if (datatable.Rows.Count > 0)
            {
                //highlight first row only
                //dgv.Rows[0].DefaultCellStyle.ForeColor = LASTCALLEDHIGHLIGHTCOLOR;
                //if (dgv.Rows.Count > 1)
                //    dgv.Rows[1].DefaultCellStyle.ForeColor = dgv.DefaultCellStyle.ForeColor;

                DataRow row = datatable.Rows[0];
                newCalledId = (Guid)row[Queues.COL_DB_Id];
                if (_lastCalledId != newCalledId)
                {
                    showLargeCallDisplay(datatable.Rows[0]);

                    _lastCalledId = newCalledId;
                    _CALL_QueueNumber.Add(row[Queues.COL_CallNo].ToString());
                    _CALL_CounterName.Add(row[Queues.COL_DB_CounterAddresses_Name].ToString());

                    if (!_isSoundPlaying)
                    {
                        bgwCaller.RunWorkerAsync();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void clearQueueIfStartOfDay()
        {
            DataTable datatable = Queues.get(true, null, null, 1);

            if (datatable.Rows.Count > 0)
            {
                DateTime lastdate = Util.wrapNullable <DateTime>(datatable.Rows[0], Queues.COL_DB_Timestamp);
                if (lastdate.Date < DateTime.Now.Date)
                {
                    Queues.deleteAll();
                }
            }
        }