示例#1
0
        /*******************************************************************************************************/
        #region METHODS

        private void setupControls()
        {
            if (_counterAddresses.Rows.Count > 0)
            {
                //setup table layout panel
                tlpCounters.ColumnCount = (int)Math.Ceiling((double)tlpCounters.Width / tlpCounters.Height);
                tlpCounters.RowCount    = (int)Math.Ceiling((double)_counterAddresses.Rows.Count / tlpCounters.ColumnCount);

                CounterCallStatus counterCallStatus;
                foreach (DataRow row in _counterAddresses.Rows)
                {
                    counterCallStatus = new CounterCallStatus(string.Format(COUNTERLABELFORMAT, row[CounterAddress.COL_DB_Name].ToString()), LIBUtil.Util.wrapNullable <Guid?>(row, CounterAddress.COL_DB_Id));
                    tlpCounters.Controls.Add(counterCallStatus);
                    counterCallStatus.Dock = DockStyle.Fill;
                }

                for (int i = 0; i < _counterAddresses.Rows.Count; i++)
                {
                    tlpCounters.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); //resize cells to be the same size
                    tlpCounters.RowStyles.Add(new ColumnStyle(SizeType.Percent, 50F));    //resize cells to be the same size
                    CounterCallStatus counter = ((CounterCallStatus)tlpCounters.Controls[i]);
                    counter.resizeComponents();
                }
            }

            setupControlsBasedOnRoles();

            AddEventHandlerToChildControls(this);
        }
示例#2
0
 private void populateData()
 {
     for (int i = 0; i < _counterAddresses.Rows.Count; i++)
     {
         CounterCallStatus counter = ((CounterCallStatus)tlpCounters.Controls[i]);
         foreach (DataRow row in Queues.getLastCalledForEachCounter().Rows)
         {
             if (LIBUtil.Util.wrapNullable <Guid>(row, Queues.COL_DB_CounterAddresses_Id) == counter.CounterAddressId)
             {
                 counter.QueueNo = LIBUtil.Util.wrapNullable <string>(row, Queues.COL_CallNo);
                 break;
             }
         }
     }
 }