Exemple #1
0
        private void trackInfoDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == trackInfoDataGridView.Columns["Trackvalue"].Index)
            {
                int currentRowIndex = trackInfoDataGridView.CurrentRow.Index;
                DataGridViewRow dr = trackInfoDataGridView.Rows[currentRowIndex];
                if (dr.Cells["Trackkey"].Value.Equals("ArtistName"))
                {
                    foreach (MusicDataSet.ArtistInfoRow artist in ArtistCurInfo.Rows)
                    {
                        SelectArtist artSelForm = new SelectArtist(Convert.ToInt32(artist.ArtistID), artist.ArtistName);
                        artSelForm.accept += new EventHandler(SelectArtistAccept);
                        artSelForm.ShowDialog(this);
                        return;
                    }

                }

                if (dr.Cells["Trackkey"].Value.Equals("TrackTypeName"))
                {
                    AbstractSelect trackType = new AbstractSelect(CommonConst.TableName.T_TRACK_TYPE_MST, CommonConst.ColumnName.TRACK_TYPE_ID, CommonConst.ColumnName.TRACK_TYPE_NAME, false,
                        new string[] { CommonConst.ColumnName.TRACK_TYPE_NAME, CommonConst.ColumnName.DESCRIPTION });
                    trackType.accept += new EventHandler(SelectTrackTypeAccept);
                    trackType.ShowDialog(this);
                    return;
                }

                if (dr.Cells["Trackkey"].Value.Equals("AnimeName"))
                {
                    AbstractSelect animes = new AbstractSelect(CommonConst.TableName.T_ANIME_TBL, CommonConst.ColumnName.ANIME_NO, CommonConst.ColumnName.ANIME_CHN_NAME, true
                            , new string[] { CommonConst.ColumnName.ANIME_NO, CommonConst.ColumnName.ANIME_CHN_NAME, CommonConst.ColumnName.ANIME_JPN_NAME, CommonConst.ColumnName.ANIME_NN });
                    animes.accept += new EventHandler(SelectTrackAnimeAccept);
                    animes.ShowDialog(this);
                    return;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 单元格单击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MusicDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {

                if (e.ColumnIndex == MusicDataGridView.Columns[ANIMENAMECLN].Index)
                {
                    if (MusicDataGridView.SelectedCells.Count == 1)
                    {
                        //动画名称
                        AbstractSelect animes = new AbstractSelect(CommonConst.TableName.T_ANIME_TBL, CommonConst.ColumnName.ANIME_NO, CommonConst.ColumnName.ANIME_CHN_NAME, true
                            , new string[] { CommonConst.ColumnName.ANIME_NO, CommonConst.ColumnName.ANIME_CHN_NAME, CommonConst.ColumnName.ANIME_JPN_NAME, CommonConst.ColumnName.ANIME_NN });
                        animes.accept += new EventHandler(SelectAnimeAccept);
                        animes.ShowDialog(this);
                    }
                    else if (MusicDataGridView.SelectedCells.Count > 1)
                    {
                        //动画名称
                        AbstractSelect animes = new AbstractSelect(CommonConst.TableName.T_ANIME_TBL, CommonConst.ColumnName.ANIME_NO, CommonConst.ColumnName.ANIME_CHN_NAME, true
                            , new string[] { CommonConst.ColumnName.ANIME_NO, CommonConst.ColumnName.ANIME_CHN_NAME, CommonConst.ColumnName.ANIME_JPN_NAME, CommonConst.ColumnName.ANIME_NN });
                        animes.accept += new EventHandler(SelectAllAnimeAccept);
                        animes.ShowDialog(this);
                    }
                }
                else if (e.ColumnIndex == MusicDataGridView.Columns[ALBUMTYPECLN].Index)
                {
                    //专辑种类
                    AbstractSelect albumtype = new AbstractSelect(CommonConst.TableName.T_ALBUM_TYPE_MST, CommonConst.ColumnName.ALBUM_TYPE_ID, CommonConst.ColumnName.ALBUM_TYPE_NAME, false,
                        new string[] { CommonConst.ColumnName.ALBUM_TYPE_NAME, CommonConst.ColumnName.DESCRIPTION });
                    albumtype.accept += new EventHandler(SelectAlbumTypeAccept);
                    albumtype.ShowDialog(this);
                }
                else if (e.ColumnIndex == MusicDataGridView.Columns[TRACKTYPECLN].Index)
                {
                    if (MusicDataGridView.SelectedCells.Count == 1)
                    {
                        //曲目种类
                        AbstractSelect trackType = new AbstractSelect(CommonConst.TableName.T_TRACK_TYPE_MST, CommonConst.ColumnName.TRACK_TYPE_ID, CommonConst.ColumnName.TRACK_TYPE_NAME, false,
                            new string[] { CommonConst.ColumnName.TRACK_TYPE_NAME, CommonConst.ColumnName.DESCRIPTION });
                        trackType.accept += new EventHandler(SelectTrackTypeAccept);
                        trackType.ShowDialog(this);
                    }
                    else if (MusicDataGridView.SelectedCells.Count > 1)
                    {
                        //曲目种类
                        AbstractSelect trackType = new AbstractSelect(CommonConst.TableName.T_TRACK_TYPE_MST, CommonConst.ColumnName.TRACK_TYPE_ID, CommonConst.ColumnName.TRACK_TYPE_NAME, false,
                            new string[] { CommonConst.ColumnName.TRACK_TYPE_NAME, CommonConst.ColumnName.DESCRIPTION });
                        trackType.accept += new EventHandler(SelectAllTrackTypeAccept);
                        trackType.ShowDialog(this);
                    }
                }
                else if (e.ColumnIndex == MusicDataGridView.Columns[ARTISTNAMECLN].Index)
                {
                    //艺术家
                    int currentRowIndex = MusicDataGridView.CurrentRow.Index;
                    DataGridViewRow dr = MusicDataGridView.Rows[currentRowIndex];
                    SelectArtist artSelForm = new SelectArtist(Convert.ToInt32(dr.Cells[ARTISTIDCLN].Value), dr.Cells[ARTISTNAMECLN].Value.ToString());
                    artSelForm.accept += new EventHandler(SelectArtistAccept);
                    artSelForm.ShowDialog(this);
                }

            }
            catch(Exception ex)
            {
                MsgBox.Show(MSG_COMMON_001, ex.ToString());
            }
        }