Exemple #1
0
        private void OnCellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0)
                {
                    return;
                }

                //签章
                if (e.ColumnIndex == this.colSign.Index)
                {
                    string path = this.grdFile.Rows[e.RowIndex].Tag as string;

                    string[] certIds = MonitorXTX.GetInstance().GetCertID();

                    if (certIds.Length > 0)
                    {
                        MonitorXTX.GetInstance().XTX.SOF_SignFile(certIds[0], path);
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                MetroMessageBox.Show(this, "签章失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        public Login()
        {
            InitializeComponent();

            //登录方式
            this.cboLoginType.SelectedIndex = MonitorXTX.GetInstance().XTX.GetDeviceCount() > 0 ? 1 : 0;
        }
        private void cboLoginType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.cboLoginType.SelectedIndex == 0)
            {
                this.txtUserName.Text = "td_zbr";
            }
            else
            {
                //填充账号
                string[] certIds = MonitorXTX.GetInstance().GetCertID();

                if (certIds.Length > 0)
                {
                    this.txtUserName.Text = certIds[0];
                }
            }
        }