Example #1
0
        /// <summary>
        /// 顧客検索画面の選択ボタンが押された時のイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void customerList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            // senderにはイベントを発生させたコントロールが入っている
            DataGridView dgv = (DataGridView)sender;

            if (dgv.Columns[e.ColumnIndex].Name == "editButton")
            {
                // 顧客IDのインデックスを取得
                int cellIndexCusId    = dgv.Columns["cusId"].Index;
                int cellIndexCompName = dgv.Columns["companyName"].Index;
                int cellIndexCusName  = dgv.Columns["cusName"].Index;

                // e.ColumnIndexは列インデックス
                // e.RowIndexは行インデックス

                // クリックされた行の顧客IDの表示
                _cusId    = (string)dgv.Rows[e.RowIndex].Cells[cellIndexCusId].Value;
                _compName = (string)dgv.Rows[e.RowIndex].Cells[cellIndexCompName].Value;
                _cusName  = (string)dgv.Rows[e.RowIndex].Cells[cellIndexCusName].Value;

                //MessageBox.Show(_cusId + _compName + _cusName);
                //Owner.(TextBox)customer.Text = _cusId;

                ReportInput ri = (ReportInput)Owner;
                ri.CustomerId   = _cusId;
                ri.Company      = _compName;
                ri.CustomerName = _cusName;



                this.Close();
            }
        }
Example #2
0
        /// <summary>
        /// ボタン押下で新規作成画面に遷移
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void newReportButton_Click(object sender, EventArgs e)
        {
            Hide();
            ReportInput customerSearch = new ReportInput();

            customerSearch.Show(this);
            Debug.WriteLine("新規作成画面表示");
        }