CSL.DataGridViewHandler.SendIndividualTorrent C# (CSharp) Method

SendIndividualTorrent() public method

public SendIndividualTorrent ( string datatable ) : void
datatable string
return void
        public void SendIndividualTorrent(string datatable)
        {
            DataGridViewSelectedRowCollection rc;
            DataGridViewSelectedCellCollection cc;
            int id;
            switch (datatable)
            {
                case "music":
                    rc = dv.SelectedRows;
                    cc = dv.SelectedCells;

                    if (rc.Count > 0)
                        foreach (DataGridViewRow r in rc)
                        {
                            id = (int)r.Cells["ID"].Value;
                            uTorrentHandler.SendTorrent("music", id);
                        }
                    else if (cc.Count > 0)
                        foreach (DataGridViewCell c in cc)
                        {
                            id = (int)c.OwningRow.Cells["ID"].Value;
                            uTorrentHandler.SendTorrent("music", id);
                        }

                    if (MainWindow.HideSent)
                        HideSentTorrents();
                    break;
                case "movies":
                    rc = movie_dv.SelectedRows;
                    cc = movie_dv.SelectedCells;

                    if (rc.Count > 0)
                        foreach (DataGridViewRow r in rc)
                        {
                            id = (int)r.Cells["MovieID"].Value;
                            uTorrentHandler.SendTorrent("movies", id);
                        }
                    else if (cc.Count > 0)
                        foreach (DataGridViewCell c in cc)
                        {
                            id = (int)c.OwningRow.Cells["MovieID"].Value;
                            uTorrentHandler.SendTorrent("movies", id);
                        }

                    if (MainWindow.HideSent)
                        HideSentTorrents();
                    break;
                case "others":
                    rc = other_dv.SelectedRows;
                    cc = other_dv.SelectedCells;

                    if (rc.Count > 0)
                        foreach (DataGridViewRow r in rc)
                        {
                            id = (int)r.Cells["OthersID"].Value;
                            uTorrentHandler.SendTorrent("others", id);
                        }
                    else if (cc.Count > 0)
                        foreach (DataGridViewCell c in cc)
                        {
                            id = (int)c.OwningRow.Cells["OthersID"].Value;
                            uTorrentHandler.SendTorrent("others", id);
                        }

                    if (MainWindow.HideSent)
                        HideSentTorrents();
                    break;
            }
        }