Beispiel #1
0
        /// <summary>
        /// DGV 单击单元格内容
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Dgv_DataList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            if (!(dgv_DataList.Columns[e.ColumnIndex] is DataGridViewButtonColumn))
            {
                return;
            }
            int             index          = 0;
            CbAssociateCard mAssociateCard = FormComm.GetDataSourceToClass <CbAssociateCard>(dgv_DataList, ref index);

            //单个延期
            using (DelayParam_Form delayparam = new DelayParam_Form(mAssociateCard))
            {
                if (delayparam.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mAssociateCard = delayparam.Tag as CbAssociateCard;
                if (mAssociateCard.AssociateCardTime.Date != mAssociateCard.UpdateTime.Date)
                {
                    mAssociateCard.UseState = 3;
                }
                //更新列表中的显示
                FormComm.UpdateDgvDataSource <CbAssociateCard>(mAssociateCard, dgv_DataList, index);
            }
        }
        private void Btn_Edit_Click(object sender, EventArgs e)
        {
            int        index     = 0;
            CbCardInfo mCardInfo = FormComm.GetDataSourceToClass <CbCardInfo>(dgv_InfoList, ref index);

            using (EditInfo_Form edit = new EditInfo_Form(mCardInfo))
            {
                if (edit.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mCardInfo = edit.Tag as CbCardInfo;
                FormComm.UpdateDgvDataSource <CbCardInfo>(mCardInfo, dgv_InfoList, index);
            }
        }
Beispiel #3
0
        private void Btn_ChangePassword_Click(object sender, EventArgs e)
        {
            int          index       = 0;
            CbManageInfo mManageInfo = FormComm.GetDataSourceToClass <CbManageInfo>(dgv_ManageList, ref index);

            using (ChangePassword_Form changepassword = new ChangePassword_Form(mManageInfo))
            {
                if (changepassword.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mManageInfo = changepassword.Tag as CbManageInfo;
                FormComm.UpdateDgvDataSource <CbManageInfo>(mManageInfo, dgv_ManageList, index);
            }
        }
Beispiel #4
0
        private void Btn_Edit_Click(object sender, EventArgs e)
        {
            int          index       = 0;
            CbManageInfo mManageInfo = FormComm.GetDataSourceToClass <CbManageInfo>(dgv_ManageList, ref index);

            using (EditManager_Form editmanage = new EditManager_Form(mManageInfo))
            {
                if (editmanage.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mManageInfo = editmanage.Tag as CbManageInfo;
                FormComm.UpdateDgvDataSource <CbManageInfo>(mManageInfo, dgv_ManageList, index);
            }
        }
Beispiel #5
0
        private void Btn_Edit_Click(object sender, EventArgs e)
        {
            int          index       = 0;
            CbDeviceInfo mDeviceInfo = FormComm.GetDataSourceToClass <CbDeviceInfo>(dgv_DeviceInfo, ref index);

            using (EditDeviceInfo_Form editdeviceinfo = new CbznSystem.EditDeviceInfo_Form(mDeviceInfo))
            {
                if (editdeviceinfo.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mDeviceInfo = editdeviceinfo.Tag as CbDeviceInfo;
                FormComm.UpdateDgvDataSource <CbDeviceInfo>(mDeviceInfo, dgv_DeviceInfo, index);
            }
        }
Beispiel #6
0
        /// <summary>
        /// 批量延期
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_Delays_Click(object sender, EventArgs e)
        {
            //获取选择批量延期的副卡
            List <CbAssociateCard> mAssociateCards = new List <CbAssociateCard>();

            for (int i = 0; i < dgv_DataList.RowCount; i++)
            {
                bool flag = Utils.StrToBool(dgv_DataList["c_Selected", i].Value, false);
                if (!flag)
                {
                    continue;
                }
                CbAssociateCard mAssociateCard = FormComm.GetDataSourceToClass <CbAssociateCard>(dgv_DataList, i);
                mAssociateCards.Add(mAssociateCard);
            }
            using (DelayParam_Form delayparam = new DelayParam_Form(mAssociateCards))
            {
                if (delayparam.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mAssociateCards = delayparam.Tag as List <CbAssociateCard>;
                //延期后的时间和车牌分区显示在列表中
                foreach (CbAssociateCard item in mAssociateCards)
                {
                    for (int i = 0; i < dgv_DataList.RowCount; i++)
                    {
                        if (dgv_DataList["AssociateCardNumber", i].Value.Equals(item.AssociateCardNumber))
                        {
                            if (item.AssociateCardTime.Date != item.UpdateTime.Date)
                            {
                                item.UseState = 3;
                            }
                            //更新列表中的显示
                            FormComm.UpdateDgvDataSource <CbAssociateCard>(item, dgv_DataList, i);
                            break;
                        }
                    }
                }
            }
        }