Beispiel #1
0
        private void dgv_BundledList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            if (!(dgv_BundledList.Columns[e.ColumnIndex] is DataGridViewButtonColumn))
            {
                return;
            }
            using (DelayParam dp = DelayParam.Instance)
            {
                dp.ShowDialog();
                if (dp.Tag == null)
                {
                    return;
                }
                DelayParamValue param     = (DelayParamValue)dp.Tag;
                CardInfo        mcardinfo = _mBundledViceCard[e.RowIndex];
                dgv_BundledList.Rows[e.RowIndex].Cells[3].Value = param.DelayTime != mcardinfo.CardTime ? param.DelayTime : DateTime.MinValue;
                dgv_BundledList.Rows[e.RowIndex].Cells[4].Value = param.Partition != mcardinfo.CardPartition ? param.Partition : mcardinfo.CardPartition;

                mcardinfo.CardTime      = param.DelayTime;
                mcardinfo.CardPartition = param.Partition;
            }
        }
Beispiel #2
0
        private void btn_Enter_Click(object sender, EventArgs e)
        {
            DateTime newtime   = t_NewTime.Value;
            int      partition = GetSelectedPartition();

            if (_mCardInfo != null)
            {
                _mCardInfo.CardTime      = newtime;
                _mCardInfo.CardPartition = partition;
                TypeParameter typeparameter = new TypeParameter()
                {
                    Lock     = _mCardInfo.CardLock,
                    Distance = _mCardInfo.CardDistance
                };

                FunctionByteParameter functionbyteparameter = new FunctionByteParameter()
                {
                    Loss                = _mCardInfo.CardReportLoss,
                    Synchronous         = _mCardInfo.Synchronous,
                    RegistrationType    = (CardType)_mCardInfo.CardType,
                    ViceCardCount       = _mCardInfo.ViceCardCount,
                    ParkingRestrictions = _mCardInfo.ParkingRestrictions,
                    InOutState          = _mCardInfo.InOutState
                };

                DistanceParameterContent distancecontent = new DistanceParameterContent()
                {
                    CardNumber = _mCardInfo.CardNumber,
                    Type       = typeparameter,
                    Function   = functionbyteparameter,
                    Count      = ++_mCardInfo.CardCount
                };
                SingleCardData singlecarddata = new SingleCardData()
                {
                    Time      = _mCardInfo.CardTime,
                    Partition = _mCardInfo.CardPartition
                };
                byte[] by = DataCombination.CombinationDistanceCard(distancecontent, singlecarddata);
                if (_mPort.IsOpen)
                {
                    _mPort.Write(by);
                }
            }
            else
            {
                DelayParamValue param = new DelayParamValue()
                {
                    DelayTime = newtime,
                    Partition = partition
                };
                this.Tag = param;
                Close();
            }
        }
Beispiel #3
0
 private void btn_BatchDelay_Click(object sender, EventArgs e)
 {
     using (DelayParam dp = DelayParam.Instance)
     {
         dp.ShowDialog();
         if (dp.Tag == null)
         {
             return;
         }
         DelayParamValue param = (DelayParamValue)dp.Tag;
         for (int i = 0; i < dgv_BundledList.RowCount; i++)
         {
             if ((bool)dgv_BundledList.Rows[i].Cells["cSelected"].Value)
             {
                 CardInfo mcardinfo = _mBundledViceCard[i];
                 dgv_BundledList.Rows[i].Cells[3].Value = param.DelayTime != mcardinfo.CardTime ? param.DelayTime : DateTime.MinValue;
                 dgv_BundledList.Rows[i].Cells[4].Value = param.Partition != mcardinfo.CardPartition ? param.Partition : mcardinfo.CardPartition;
                 mcardinfo.CardTime      = param.DelayTime;
                 mcardinfo.CardPartition = param.Partition;
             }
         }
     }
 }