コード例 #1
0
 private void dataGridView1_DoubleClick(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count == 1)
     {
         var row = dataGridView1.CurrentRow;
         if (dataGridView1.CurrentCell.ColumnIndex == dataGridView1.Columns["QRCodeImage"].Index)
         {
             if (!string.IsNullOrEmpty((string)row.Cells["EnglishName"].Value) && !string.IsNullOrEmpty((string)row.Cells["PassportNo"].Value))
             {
                 FrmQRCode frm = new FrmQRCode(row.Cells["EnglishName"].Value + "|" + row.Cells["PassportNo"].Value);
                 frm.ShowDialog();
             }
         }
         else
         {
             VisaInfo model = _bllVisaInfo.GetModel(Guid.Parse(dataGridView1.CurrentRow.Cells["VisaInfo_id"].Value.ToString()));
             if (model == null)
             {
                 MessageBoxEx.Show(Resources.FindModelFailedPleaseCheckInfoCorrect);
                 return;
             }
             FrmInfoTypeIn frm = new FrmInfoTypeIn(model, LoadDataToDataGridView, _curPage);
             frm.ShowDialog();
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// 录入资料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmsItemTypeInInfo_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count > 1)
            {
                MessageBoxEx.Show(Resources.SelectEditMoreThanOne);
                return;
            }

            string visainfoid = dataGridView1.SelectedRows[0].Cells["VisaInfo_id"].Value.ToString();

            Model.VisaInfo model = _bllVisaInfo.GetModel(new Guid(visainfoid));
            if (model == null)
            {
                MessageBoxEx.Show(Resources.FindModelFailedPleaseCheckInfoCorrect);
                return;
            }

            Action <int>  updateDel = new Action <int>(LoadDataToDataGridView);
            FrmInfoTypeIn dlg       = new FrmInfoTypeIn(model, updateDel, _curPage);

            dlg.ShowDialog();
        }