public void setDetails(Films f) { seriesProd = f.getProducer(); seriesLeading = f.getLeading(); seriesName = f.getName(); seriesGenre = f.getGenre(); seriesYear = f.getYear(); }
public void setFilmSettings(Films f) { filmProducer = f.getProducer(); filmLeading = f.getLeading(); filmName = f.getName(); genreId = f.getGenre(); filmYear = f.getYear(); }
/// <summary> /// Промяна на данни в определената таблица /// </summary> /// <param name="data">Данните, който ще променяме</param> /// <param name="tableName">Името на таблицата, чиито данни ще променяме</param> public void chandeData(Object data, string tableName) { switch (tableName) { case "Films": { Films f = data as Films; f.setGenre(genres.returnID(f.getStringGenre())); films.changeRow(f); break; } } }
/// <summary> /// Запазване на данните за филтриране /// </summary> /// <param name="f">Данните за филтриране</param> public void setFilterItem(Films f) { filterItem = f; }
/// <summary> /// Задаване на данни, в определената таблица /// </summary> /// <param name="data">Данните, които ще вкарваме в масива и в базата данни</param> /// <param name="tableName">Името на таблицата, в която ще вкарваме данните</param> public void setData(Object data, string tableName) { switch (tableName) { case "Cities": { cities.insertRow(data as Cities); break; } case "Films": { Films f = data as Films; f.setGenre(genres.returnID(f.getStringGenre())); films.insertRow(f); break; } case "Series": { Series s = data as Series; s.setGenre(genres.returnID(s.getStringGenre())); series.insertRow(s); break; } case "Genres": { genres.insertRow(data as Genres); break; } case "ServicesNames": { services.insertRow(data as ServicesNames); break; } case "Types": { types.insertRow(data as Types); break; } case "Positions": { positions.insertRow(data as Positions); break; } case "Employees": { Employees e = data as Employees; e.setPos(positions.getID(e.getStringPos())); e.setCity(cities.getID(e.getStringCity())); employees.insertRow(e); break; } case "Users": { users.insertRow(data as Users); loggedUser = data as Users; filmsLibrary.initializeFilmsForUser(loggedUser); break; } case "Subscriptions": { Subscriptions s = data as Subscriptions; subs.insertRow(s); break; } case "FilmsLibrary": { filmsLibrary.insertRow(data as FilmsLibrary); break; } case "SeriesLibrary": { seriesLibrary.insertRow(data as SeriesLibrary); break; } } }
/// <summary> /// Запълва с данни посоченият ViewControl от масивите. Спрямо подадената опция /// </summary> /// <param name="view">ViewControl-ът, който ще запълваме с данни</param> /// <param name="sectionName">Използва се за да разграничим, с какви данни ще пълним ViewControl-a</param> public void fillViewControl(ListView view, string sectionName) { switch (sectionName) { case "films": { foreach (Films f in films.returnRecords()) { f.setStringGenre(genres.returnGenre(f.getGenre())); view.Items.Add(new ListViewItem(f.getStringArray())); } break; } case "series": { foreach (Series s in series.returnRecords()) { s.setStringGenre(genres.returnGenre(s.getGenre())); view.Items.Add(new ListViewItem(s.getStringArray())); } break; } case "cities": { foreach (Cities c in cities.returnRecords()) { view.Items.Add(new ListViewItem(c.getCitiesArray())); } break; } case "FilmsLibrary": { foreach (FilmsLibrary f in filmsLibrary.returnRecords()) { Films film = films.returnFilmByID(f.getFilmID()); film.setStringGenre(genres.returnGenre(film.getGenre())); view.Items.Add(new ListViewItem(film.getStringArray())); } break; } case "SeriesLibrary": { foreach (SeriesLibrary s in seriesLibrary.returnRecords()) { Series serial = series.returnSeriesByID(s.getSeries()); serial.setStringGenre(genres.returnGenre(serial.getGenre())); view.Items.Add(new ListViewItem(serial.getStringArray())); } break; } case "genres": { foreach (Genres g in genres.returnRecords()) { view.Items.Add(new ListViewItem(g.getGenreName())); } break; } case "services": { foreach (ServicesNames s in services.returnRecords()) { view.Items.Add(new ListViewItem(s.returnStringArray())); } break; } case "types": { foreach (Types t in types.returnRecords()) { view.Items.Add(new ListViewItem(t.getType())); } break; } case "employees": { foreach (Employees e in employees.returnRecords()) { e.setStringCity(cities.getCity(e.getCity())); e.setStringPos(positions.getPosition(e.getPos())); view.Items.Add(new ListViewItem(e.getStringEmployee())); } break; } case "positions": { foreach (Positions p in positions.returnRecords()) { view.Items.Add(new ListViewItem(p.getPosName())); } break; } } }