Exemple #1
0
        private void buttonBatchAdd_Click(object sender, EventArgs e)
        {
            string        strCardNo = null;
            CardConfigure batchAdd  = new CardConfigure();

            CHCNetSDK.NET_DVR_CARD_CFG_V50 struCardCfg = new CHCNetSDK.NET_DVR_CARD_CFG_V50();
            batchAdd.SetCardCfg(ref struCardCfg);

            if (batchAdd.ShowDialog() == DialogResult.OK)
            {
                struCardCfg = batchAdd.GetCardCfg(strCardNo);
                m_dwCardNum = (uint)batchAdd.GetAddNum();
                CreateSameCfgCard(m_dwCardNum, struCardCfg);
                m_pDisplayListThread = new Thread(new ThreadStart(g_fShowCardListThread));
                m_pDisplayListThread.Start();
            }
        }
Exemple #2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (m_iSelectIndex < 0)
            {
                MessageBox.Show("Select list item first");
                return;
            }
            string strTemp1  = null;
            string strTemp2  = null;
            string strItem   = null;
            int    iSelIndex = m_iSelectIndex;

            CHCNetSDK.NET_DVR_CARD_CFG_V50 struCardInfo = m_struCardInfo[iSelIndex];
            string        strCardNo = listViewGataManage.Items[iSelIndex].SubItems[1].Text;
            CardConfigure batchAdd  = new CardConfigure();

            batchAdd.SetCardCfg(ref struCardInfo, strCardNo);
            if (batchAdd.ShowDialog() == DialogResult.OK)
            {
                listViewGataManage.BeginUpdate();
                struCardInfo = batchAdd.GetCardCfg(strCardNo);
                listViewGataManage.Items[iSelIndex].SubItems[1].Text = System.Text.Encoding.UTF8.GetString(struCardInfo.byCardNo);
                if (1 == struCardInfo.byCardValid)
                {
                    strItem = "Yes";
                }
                else
                {
                    strItem = "No";
                }
                listViewGataManage.Items[iSelIndex].SubItems[2].Text = strItem;
                listViewGataManage.Items[iSelIndex].SubItems[3].Text = System.Text.Encoding.UTF8.GetString(struCardInfo.byCardPassword);
                if (struCardInfo.byCardType == 0 || struCardInfo.byCardType > 7)
                {
                    listViewGataManage.Items[iSelIndex].SubItems[4].Text = AcsDemoPublic.strCardType[0];
                }
                else
                {
                    listViewGataManage.Items[iSelIndex].SubItems[4].Text = AcsDemoPublic.strCardType[struCardInfo.byCardType];
                }
                if (1 == struCardInfo.byLeaderCard)
                {
                    strItem = "Yes";
                }
                else
                {
                    strItem = "No";
                }
                listViewGataManage.Items[iSelIndex].SubItems[5].Text = strItem;
                listViewGataManage.Items[iSelIndex].SubItems[6].Text = struCardInfo.dwMaxSwipeTime.ToString();
                listViewGataManage.Items[iSelIndex].SubItems[7].Text = struCardInfo.dwSwipeTime.ToString();
                if (1 == struCardInfo.struValid.byEnable)
                {
                    strItem = "Yes";
                    CHCNetSDK.NET_DVR_TIME_EX strTimeEx1 = struCardInfo.struValid.struBeginTime;
                    strTemp1 = string.Format("{0,4}-{1,2}-{2,2}, {3,2}:{4,2}:{5,2}", strTimeEx1.wYear, strTimeEx1.byMonth,
                                             strTimeEx1.byDay, strTimeEx1.byHour, strTimeEx1.byMinute, strTimeEx1.bySecond);
                    CHCNetSDK.NET_DVR_TIME_EX strTimeEx2 = struCardInfo.struValid.struEndTime;
                    strTemp2 = string.Format("{0,4}-{1,2}-{2,2}, {3,2}:{4,2}:{5,2}", strTimeEx2.wYear, strTimeEx2.byMonth,
                                             strTimeEx2.byDay, strTimeEx2.byHour, strTimeEx2.byMinute, strTimeEx2.bySecond);
                }
                else
                {
                    strItem = "No";
                }
                listViewGataManage.Items[iSelIndex].SubItems[8].Text  = strItem;
                listViewGataManage.Items[iSelIndex].SubItems[9].Text  = strTemp1;
                listViewGataManage.Items[iSelIndex].SubItems[10].Text = strTemp2;
                listViewGataManage.Items[iSelIndex].SubItems[11].Text = struCardInfo.wRoomNumber.ToString();
                listViewGataManage.EndUpdate();
            }
        }