private void changeLabelsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (dataGridView.SelectedRows.Count == 0)
                {
                    return;
                }

                List <RomLabel> selectedLabels   = new List <RomLabel>();
                List <RomLabel> unselectedLabels = new List <RomLabel>();
                RomLabels       labels           = ((Rom)dataGridView.SelectedRows[0].Tag).RomLabels;

                List <Rom> roms = new List <Rom>();

                foreach (DataGridViewRow row in dataGridView.SelectedRows)
                {
                    roms.Add((Rom)row.Tag);
                }

                if (!FormChooseList.ChooseLabel(roms, out selectedLabels, out unselectedLabels))
                {
                    return;
                }

                RomLabelsBusiness.SetRomLabel(roms, selectedLabels, unselectedLabels);

                foreach (DataGridViewRow row in dataGridView.SelectedRows)
                {
                    FillLabelCell((Rom)row.Tag, row);
                }

                dataGridView.Refresh();
            }
            catch (Exception ex)
            {
                FormCustomMessage.ShowError(ex.Message);
            }
        }
        public static Rom SetRom(Rom rom, string id, string fileName,
                                 string romName, string series, string genre, string status, List <RomLabel> labels, string publisher,
                                 string developer, string description, string year, string dbName,
                                 string rating, bool idLocked, bool changeZipName,
                                 string boxPath, string titlePath, string gameplayPath, bool saveAsJpg, string emulator)
        {
            rom.Genre = string.IsNullOrEmpty(genre) ? null : GenreBusiness.Get(genre);

            string oldfile = rom.FileName;

            rom.Id           = id;
            rom.Name         = romName;
            rom.Publisher    = publisher;
            rom.Developer    = developer;
            rom.Description  = description;
            rom.YearReleased = year;
            rom.DBName       = dbName;
            rom.Series       = series;
            rom.IdLocked     = idLocked;
            rom.Emulator     = emulator;
            float ratingParse = 0;

            if (float.TryParse(rating, out ratingParse))
            {
                if (ratingParse > 0 && ratingParse <= 10)
                {
                    rom.Rating = ratingParse;
                }
            }

            RomFunctions.RenameRomPictures(rom, fileName);
            RomFunctions.RenameRomFile(rom, fileName, changeZipName);

            if (string.IsNullOrEmpty(rom.Id))
            {
                rom.DBName = string.Empty;
            }

            if (oldfile != rom.FileName)
            {
                Set(rom, oldfile);

                if (rom.Status != null)
                {
                    RomStatusBusiness.DeleteRomStatus(rom.Status);
                    rom.Status = null;
                }

                if (rom.RomLabels != null)
                {
                    RomLabelsBusiness.DeleteRomLabels(rom.Platform.Name, oldfile);
                    rom.RomLabels = null;
                }
            }
            else
            {
                Set(rom);
            }

            RomFunctions.SaveRomPictures(rom, boxPath, titlePath, gameplayPath, saveAsJpg);
            RomLabelsBusiness.SetRomLabel(rom, labels, null);
            RomStatusBusiness.SetRomStatus(rom, status);
            XML.SaveXmlRoms(rom.Platform.Name);
            rom.FileNameNoExt = RomFunctions.GetFileNameNoExtension(romName);
            return(rom);
        }