├── WatchMovie ├── global_using.cs ├── Resources │ ├── dfdf.png │ ├── logo2.png │ ├── sds.png │ ├── likepic.jpg │ ├── xbutton.jpg │ ├── Screenshot 2023-07-28 155531.png │ ├── Web capture_26-7-2023_63958_watchmovieshd.ru.jpeg │ └── 93-938050_png-file-transparent-white-user-icon-png-download.png ├── AppDbcontext.cs ├── Program.cs ├── Properties │ ├── DataSources │ │ ├── Core.Enum.genre.datasource │ │ ├── Core.models.film.datasource │ │ ├── Core.models.Users.datasource │ │ ├── Core.Migrations.hello.datasource │ │ ├── Core.models.duration.datasource │ │ ├── Core.Inheritance.Movies.datasource │ │ ├── Core.models.Achivement.datasource │ │ ├── Core.models.likedFilms.datasource │ │ ├── Core.models.Achivements.datasource │ │ └── Core.models.Viewedfilms.datasource │ ├── Resources.Designer.cs │ └── Resources.resx ├── sortedmovies.cs ├── likedMovies.cs ├── SortedByType.cs ├── filmspage.cs ├── WatchMovie.csproj ├── login.cs ├── dapper.cs ├── likedMovies.Designer.cs ├── sortedmovies.Designer.cs ├── homepage.cs ├── filmspage.resx ├── SortedByType.resx ├── adminpanel.resx ├── likedMovies.resx ├── sortedmovies.resx ├── filmspage.Designer.cs ├── register.cs ├── adminpanel.cs ├── SortedByType.Designer.cs ├── homepage.resx ├── login.Designer.cs ├── adminpanel.Designer.cs ├── Migrations │ └── 20230801070249_ee.cs └── homepage.Designer.cs ├── Core ├── global_using.cs ├── Program.cs ├── Interface │ ├── ISaved.cs │ ├── ILiked.cs │ ├── IYear.cs │ ├── ICountry.cs │ ├── IProducer.cs │ ├── IAchivements.cs │ ├── IDuration.cs │ ├── IAnime.cs │ ├── IFilm.cs │ ├── ICartoon.cs │ └── ISeries.cs ├── Enum │ ├── movies.cs │ └── genre.cs ├── models │ ├── Achivements.cs │ ├── duration.cs │ ├── Achivement.cs │ ├── likedFilms.cs │ ├── users.cs │ ├── ViewFilmes.cs │ └── film.cs ├── ExtencionMethod │ └── Capital_Letter.cs ├── Core.csproj ├── Migrations │ ├── 20230803094241_addtablerrrrtr.cs │ ├── 20230803070858_addtable.cs │ └── 20230803070507_initial.cs ├── Data │ └── WatchMovieDb.cs └── Seeddata │ └── SeedData.cs ├── WatchMovieHD ├── Form1.cs ├── Program.cs ├── WatchMovieHD.csproj ├── Form1.Designer.cs └── Form1.resx ├── WatchMovieHD.sln ├── .gitattributes └── .gitignore /WatchMovie/global_using.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | global using Core.Enum; 4 | global using Core.models; -------------------------------------------------------------------------------- /WatchMovie/Resources/dfdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/dfdf.png -------------------------------------------------------------------------------- /WatchMovie/Resources/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/logo2.png -------------------------------------------------------------------------------- /WatchMovie/Resources/sds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/sds.png -------------------------------------------------------------------------------- /WatchMovie/Resources/likepic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/likepic.jpg -------------------------------------------------------------------------------- /WatchMovie/Resources/xbutton.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/xbutton.jpg -------------------------------------------------------------------------------- /WatchMovie/Resources/Screenshot 2023-07-28 155531.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/Screenshot 2023-07-28 155531.png -------------------------------------------------------------------------------- /Core/global_using.cs: -------------------------------------------------------------------------------- 1 | global using Core.Interface; 2 | global using Core.models; 3 | global using Microsoft.EntityFrameworkCore; 4 | global using Npgsql; 5 | global using Core.data; 6 | 7 | -------------------------------------------------------------------------------- /WatchMovie/Resources/Web capture_26-7-2023_63958_watchmovieshd.ru.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/Web capture_26-7-2023_63958_watchmovieshd.ru.jpeg -------------------------------------------------------------------------------- /WatchMovieHD/Form1.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovieHD 2 | { 3 | public partial class Form1 : Form 4 | { 5 | public Form1() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Core/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Core 2 | { 3 | internal class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | Console.WriteLine("Hello, World!"); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /WatchMovie/Resources/93-938050_png-file-transparent-white-user-icon-png-download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FarxodbekMadrahimov/WatchMovieHD/HEAD/WatchMovie/Resources/93-938050_png-file-transparent-white-user-icon-png-download.png -------------------------------------------------------------------------------- /Core/Interface/ISaved.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface ISaved 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Interface/ILiked.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface ILiked 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Interface/IYear.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface IYear 10 | { 11 | public int Year { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Interface/ICountry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface ICountry 10 | { 11 | public string Name { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Interface/IProducer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface IProducer 10 | { 11 | public string Name { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Interface/IAchivements.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface IAchivements 10 | { 11 | public string name { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WatchMovie/AppDbcontext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.VisualBasic.ApplicationServices; 3 | 4 | 5 | //public class AppDbContext : DbContext 6 | //{ 7 | // public DbSet Users { get; set; } 8 | 9 | // public AppDbContext() : base("WatchMovieHD") 10 | // { 11 | // } 12 | //} -------------------------------------------------------------------------------- /Core/Enum/movies.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Enum 8 | { 9 | public enum movies 10 | { 11 | movie, 12 | series, 13 | Cartoon, 14 | anime 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Core/Enum/genre.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core.Enum 9 | { 10 | 11 | public enum genre 12 | 13 | { 14 | action, 15 | Drama, 16 | Fantastic, 17 | Horror, 18 | Detective, 19 | Crime, 20 | Comedy 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Core/Interface/IDuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface IDuration 10 | { 11 | public int minut { get; set; } 12 | public int minut_per_episode { get; set; } 13 | public int season { get; set; } 14 | public int episode { get; set; } 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Core/models/Achivements.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.models 8 | { 9 | public class Achivements 10 | { 11 | public int AchivementsId { get; set; } 12 | public int FilmId { get; set; } 13 | public int AchivementId { get; set; } 14 | public int year { get; set; } 15 | 16 | public Achivement Achivement { get; set; } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Core/Interface/IAnime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface IAnime 10 | { 11 | public string name { get; set; } 12 | public string genre { get; set; } 13 | public int year { get; set; } 14 | public string producer { get; set; } 15 | public string country { get; set; } 16 | public string duiration { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Interface/IFilm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface IFilm 10 | { 11 | public string name { get; set; } 12 | public string genre { get; set; } 13 | public int year { get; set; } 14 | public string producer { get; set; } 15 | public string country { get; set; } 16 | public string duiration { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Interface/ICartoon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface ICartoon 10 | { 11 | public string name { get; set; } 12 | public string genre { get; set; } 13 | public int year { get; set; } 14 | public string producer { get; set; } 15 | public string country { get; set; } 16 | public string duiration { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Interface/ISeries.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.Interface 8 | { 9 | public interface ISeries 10 | { 11 | public string name { get; set; } 12 | public string genre { get; set; } 13 | public int year { get; set; } 14 | public string producer { get; set; } 15 | public string country { get; set; } 16 | public string duiration { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/models/duration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Core.models 8 | { 9 | public class duration 10 | { 11 | public int durationId { get; set; } 12 | public int? minute { get; set; } 13 | public int? minut_per_episede { get; set; } 14 | public int? season { get; set; } 15 | public int? episode { get; set; } 16 | 17 | ICollection films { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /WatchMovieHD/Program.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovieHD 2 | { 3 | public static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new Form1()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /WatchMovie/Program.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | internal static class Program 4 | { 5 | /// 6 | /// The main entry point for the application. 7 | /// 8 | [STAThread] 9 | static void Main() 10 | { 11 | // To customize application configuration such as set high DPI settings or default font, 12 | // see https://aka.ms/applicationconfiguration. 13 | ApplicationConfiguration.Initialize(); 14 | Application.Run(new login()); 15 | } 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /Core/ExtencionMethod/Capital_Letter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.CompilerServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core.ExtencionMethod 9 | { 10 | public static class ExtensionMethod 11 | { 12 | public static string Capital_Latter(string name) 13 | { 14 | if (string.IsNullOrEmpty(name)) 15 | { 16 | return string.Empty; 17 | } 18 | return $"{name[0].ToString().ToUpper()}{name.Substring(1)}"; 19 | 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Core/models/Achivement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Core.models 10 | { 11 | public class Achivement 12 | { 13 | [Key] 14 | public int Id { get; set; } 15 | 16 | public string Name { get; set; } 17 | 18 | public string Description { get; set; } 19 | 20 | public int FilmId { get; set; } 21 | 22 | ICollection Film { get; set;} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.Enum.genre.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.Enum.genre, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.film.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.film, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.Users.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.Users, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.Migrations.hello.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.Migrations.hello, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.duration.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.duration, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.Inheritance.Movies.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.Inheritance.Movies, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.Achivement.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.Achivement, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.likedFilms.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.likedFilms, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.Achivements.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.Achivements, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /WatchMovie/Properties/DataSources/Core.models.Viewedfilms.datasource: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | Core.models.Viewedfilms, Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /Core/models/likedFilms.cs: -------------------------------------------------------------------------------- 1 | using Core.Enum; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Core.models 11 | { 12 | public class likedFilms 13 | { 14 | [Key] 15 | public int Id { get; set; } 16 | [ForeignKey(nameof(Film))] 17 | public int FilmId { get; set; } 18 | [ForeignKey(nameof(Users))] 19 | public int userid { get; set; } 20 | 21 | public Film Film { get; set; } 22 | 23 | public Users Users { get; set; } 24 | 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Core/models/users.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core.models 9 | { 10 | public class Users 11 | { 12 | 13 | [Key] 14 | public int Id { get; set; } 15 | public string FirstName { get; set; } 16 | public string LastName { get; set; } 17 | public string UserName { get; set; } 18 | public string email { get; set; } 19 | public string password { get; set; } 20 | 21 | 22 | public ICollection likedFilms { get; set;} 23 | 24 | public ICollection viewedFilms { get; set;} 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/models/ViewFilmes.cs: -------------------------------------------------------------------------------- 1 | using Core.Enum; 2 | using Microsoft.EntityFrameworkCore.Metadata.Internal; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Linq; 8 | using System.Reflection.Metadata; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace Core.models 13 | { 14 | public class Viewedfilms 15 | { 16 | [Key] 17 | public int Id { get; set; } 18 | [ForeignKey(nameof(Film))] 19 | public int FilmId { get; set; } 20 | [ForeignKey(nameof(Users))] 21 | public int userid { get; set; } 22 | 23 | 24 | public Film Film { get; set; } 25 | 26 | public Users Users { get; set; } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Core/models/film.cs: -------------------------------------------------------------------------------- 1 | using Core.Enum; 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Core.models 12 | { 13 | public class Film 14 | { 15 | [Key] 16 | public int Id { get; set; } 17 | 18 | public string Name { get; set; } 19 | 20 | public string Genre { get; set; } 21 | public string Year { get; set; } 22 | public string Producer { get; set; } 23 | public string Country { get; set; } 24 | public string Duration { get; set; } 25 | public string? Achivement { get; set; } 26 | public string Type { get; set; } 27 | 28 | 29 | 30 | public ICollection likedFilms { get; set; } 31 | 32 | public ICollection viewedFilms { get; set; } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /WatchMovieHD/WatchMovieHD.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net7.0-windows 6 | disable 7 | true 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | all 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | 17 | 18 | all 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Core/Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | disable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | all 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | 21 | 22 | all 23 | runtime; build; native; contentfiles; analyzers; buildtransitive 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /WatchMovieHD/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovieHD 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | this.ClientSize = new System.Drawing.Size(800, 450); 34 | this.Text = "Form1"; 35 | } 36 | 37 | #endregion 38 | } 39 | } -------------------------------------------------------------------------------- /WatchMovie/sortedmovies.cs: -------------------------------------------------------------------------------- 1 | using Core.data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace WatchMovie 13 | { 14 | public partial class sortedmovies : Form 15 | { 16 | public sortedmovies() 17 | { 18 | InitializeComponent(); 19 | comboBox1.DataSource = Enum.GetValues(typeof(genre)); 20 | } 21 | 22 | private void sortedmovies_Load(object sender, EventArgs e) 23 | { 24 | 25 | } 26 | 27 | private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) 28 | { 29 | 30 | } 31 | 32 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 33 | { 34 | 35 | 36 | } 37 | 38 | private void button1_Click(object sender, EventArgs e) 39 | { 40 | var db = new WatchMovieHD(); 41 | 42 | var AllRows = db.Films.Where(f => f.Genre == comboBox1.Text).ToList(); 43 | dataGridView1.DataSource = AllRows; 44 | } 45 | 46 | private void button2_Click(object sender, EventArgs e) 47 | { 48 | homepage homepage = new homepage(); 49 | Hide(); 50 | homepage.Show(); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Core/Migrations/20230803094241_addtablerrrrtr.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Core.Migrations 6 | { 7 | /// 8 | public partial class addtablerrrrtr : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Achivement", 15 | table: "Films", 16 | type: "text", 17 | nullable: true); 18 | 19 | migrationBuilder.UpdateData( 20 | table: "Films", 21 | keyColumn: "Id", 22 | keyValue: 1, 23 | column: "Achivement", 24 | value: null); 25 | 26 | migrationBuilder.UpdateData( 27 | table: "Films", 28 | keyColumn: "Id", 29 | keyValue: 2, 30 | column: "Achivement", 31 | value: null); 32 | 33 | migrationBuilder.UpdateData( 34 | table: "Films", 35 | keyColumn: "Id", 36 | keyValue: 3, 37 | column: "Achivement", 38 | value: null); 39 | } 40 | 41 | /// 42 | protected override void Down(MigrationBuilder migrationBuilder) 43 | { 44 | migrationBuilder.DropColumn( 45 | name: "Achivement", 46 | table: "Films"); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WatchMovie/likedMovies.cs: -------------------------------------------------------------------------------- 1 | using Core.data; 2 | using Microsoft.EntityFrameworkCore; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | using static System.Windows.Forms.VisualStyles.VisualStyleElement; 13 | 14 | namespace WatchMovie 15 | { 16 | public partial class likedMovies : Form 17 | { 18 | public likedMovies() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | private void likedMovies_Load(object sender, EventArgs e) 24 | { 25 | 26 | } 27 | 28 | private void pictureBox1_Click(object sender, EventArgs e) 29 | { 30 | 31 | } 32 | 33 | private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) 34 | { 35 | var db = new WatchMovieHD(); 36 | 37 | var AllRows = db.LikedFilms.Include(x => x.Film); 38 | dataGridView1.DataSource = AllRows; 39 | 40 | } 41 | 42 | private void button1_Click(object sender, EventArgs e) 43 | { 44 | homepage homepage = new homepage(); 45 | Hide(); 46 | homepage.Show(); 47 | } 48 | 49 | private void button2_Click(object sender, EventArgs e) 50 | { 51 | var db = new WatchMovieHD(); 52 | 53 | var AllRows = db.LikedFilms.Include(x => x.Film); 54 | dataGridView1.DataSource = AllRows; 55 | 56 | } 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /WatchMovie/SortedByType.cs: -------------------------------------------------------------------------------- 1 | using Core.data; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace WatchMovie 13 | { 14 | public partial class SortedByType : Form 15 | { 16 | public SortedByType() 17 | { 18 | InitializeComponent(); 19 | comboBox1.DataSource = Enum.GetValues(typeof(movies)); 20 | } 21 | 22 | private void pictureBox1_Click(object sender, EventArgs e) 23 | { 24 | 25 | } 26 | 27 | private void button1_Click(object sender, EventArgs e) 28 | { 29 | var db = new WatchMovieHD(); 30 | var AllRows = db.Films.Where(f => f.Type == comboBox1.Text).ToList(); 31 | dataGridView1.DataSource = AllRows; 32 | 33 | } 34 | 35 | private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) 36 | { 37 | var db = new WatchMovieHD(); 38 | 39 | var AllRows = db.Films.Where(f => f.Genre == comboBox1.Text).ToList(); 40 | dataGridView1.DataSource = AllRows; 41 | } 42 | 43 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 44 | { 45 | 46 | } 47 | 48 | private void button2_Click(object sender, EventArgs e) 49 | { 50 | homepage homepage = new homepage(); 51 | Hide(); 52 | homepage.Show(); 53 | } 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /WatchMovieHD.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.6.33815.320 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj", "{46DED99D-3C79-4882-A115-54676E1B03D9}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchMovie", "WatchMovie\WatchMovie.csproj", "{882CA39B-9EC2-4B9E-85E7-5DE9CC7698F6}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {46DED99D-3C79-4882-A115-54676E1B03D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {46DED99D-3C79-4882-A115-54676E1B03D9}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {46DED99D-3C79-4882-A115-54676E1B03D9}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {46DED99D-3C79-4882-A115-54676E1B03D9}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {882CA39B-9EC2-4B9E-85E7-5DE9CC7698F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {882CA39B-9EC2-4B9E-85E7-5DE9CC7698F6}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {882CA39B-9EC2-4B9E-85E7-5DE9CC7698F6}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {882CA39B-9EC2-4B9E-85E7-5DE9CC7698F6}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {AA267E8C-F820-4335-BCD8-B435B0536F0C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /WatchMovie/filmspage.cs: -------------------------------------------------------------------------------- 1 | using Core.data; 2 | using Microsoft.EntityFrameworkCore; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace WatchMovie 14 | { 15 | public partial class filmspage : Form 16 | { 17 | public filmspage() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | private void filmspage_Load(object sender, EventArgs e) 23 | { 24 | 25 | } 26 | 27 | private void pictureBox1_Click(object sender, EventArgs e) 28 | { 29 | 30 | } 31 | 32 | private void label3_Click(object sender, EventArgs e) 33 | { 34 | 35 | } 36 | 37 | private void label3_Click_1(object sender, EventArgs e) 38 | { 39 | 40 | } 41 | 42 | private void label3_Click_2(object sender, EventArgs e) 43 | { 44 | 45 | } 46 | 47 | private void pictureBox3_Click(object sender, EventArgs e) 48 | { 49 | login login = new login(); 50 | login.Show(); 51 | 52 | } 53 | 54 | private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) 55 | { 56 | var db = new WatchMovieHD(); 57 | 58 | 59 | var AllRows = db.Viewedfilms.Include(x => x.Film); 60 | dataGridView1.DataSource = AllRows; 61 | } 62 | 63 | private void button1_Click(object sender, EventArgs e) 64 | { 65 | homepage homepage = new homepage(); 66 | Hide(); 67 | homepage.Show(); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /WatchMovie/WatchMovie.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net7.0-windows 6 | enable 7 | true 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | all 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | 17 | 18 | all 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | True 31 | True 32 | Resources.resx 33 | 34 | 35 | 36 | 37 | 38 | ResXFileCodeGenerator 39 | Resources.Designer.cs 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Core/Migrations/20230803070858_addtable.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; 3 | 4 | #nullable disable 5 | 6 | namespace Core.Migrations 7 | { 8 | /// 9 | public partial class addtable : Migration 10 | { 11 | /// 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.CreateTable( 15 | name: "achivments", 16 | columns: table => new 17 | { 18 | AchivementsId = table.Column(type: "integer", nullable: false) 19 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 20 | FilmId = table.Column(type: "integer", nullable: false), 21 | AchivementId = table.Column(type: "integer", nullable: false), 22 | year = table.Column(type: "integer", nullable: false) 23 | }, 24 | constraints: table => 25 | { 26 | table.PrimaryKey("PK_achivments", x => x.AchivementsId); 27 | table.ForeignKey( 28 | name: "FK_achivments_achives_AchivementId", 29 | column: x => x.AchivementId, 30 | principalTable: "achives", 31 | principalColumn: "Id", 32 | onDelete: ReferentialAction.Cascade); 33 | }); 34 | 35 | migrationBuilder.CreateIndex( 36 | name: "IX_achivments_AchivementId", 37 | table: "achivments", 38 | column: "AchivementId"); 39 | } 40 | 41 | /// 42 | protected override void Down(MigrationBuilder migrationBuilder) 43 | { 44 | migrationBuilder.DropTable( 45 | name: "achivments"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /WatchMovie/login.cs: -------------------------------------------------------------------------------- 1 | using Core.data; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.VisualBasic.ApplicationServices; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.ComponentModel; 7 | using System.Data; 8 | using System.Drawing; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | using System.Windows.Forms; 13 | using static System.Windows.Forms.VisualStyles.VisualStyleElement; 14 | using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel; 15 | 16 | namespace WatchMovie 17 | { 18 | public partial class login : Form 19 | { 20 | private WatchMovieHD DbContext; 21 | public login() 22 | { 23 | InitializeComponent(); 24 | DbContext = new WatchMovieHD(); 25 | } 26 | 27 | private void label2_Click(object sender, EventArgs e) 28 | { 29 | 30 | } 31 | 32 | private void Form1_Load(object sender, EventArgs e) 33 | { 34 | 35 | } 36 | 37 | private void button2_Click(object sender, EventArgs e) 38 | { 39 | 40 | } 41 | 42 | private void button2_Click_1(object sender, EventArgs e) 43 | { 44 | register register = new register(); 45 | Hide(); 46 | register.Show(); 47 | } 48 | 49 | private void pictureBox1_Click(object sender, EventArgs e) 50 | { 51 | Close(); 52 | } 53 | 54 | private void button1_Click(object sender, EventArgs e) 55 | { 56 | if (textBox1.Text == "Farxodbek206" && textBox2.Text == "ing0077K") 57 | { 58 | adminpanel adminpanel = new adminpanel(); 59 | Hide(); 60 | adminpanel.Show(); 61 | } 62 | var db = new WatchMovieHD(); 63 | 64 | var res = db.User.SingleOrDefault(user => user.UserName == textBox1.Text && user.password == textBox2.Text); 65 | 66 | if (res == null) 67 | { 68 | label4.Visible = true; 69 | 70 | } 71 | else 72 | { 73 | homepage homepage = new homepage(textBox1.Text); 74 | Hide(); 75 | homepage.Show(); 76 | } 77 | //{ 78 | // var result = db.user 79 | // .include(x => x.password) 80 | // .firstordefault(x => x.password. == login && x.loginpassword.password == password); 81 | // if (result != null) 82 | // { 83 | // loganform.employee = result; 84 | // return result; 85 | // } 86 | // else return null; 87 | //} 88 | } 89 | 90 | private void textBox1_TextChanged(object sender, EventArgs e) 91 | { 92 | 93 | } 94 | 95 | private void textBox2_TextChanged(object sender, EventArgs e) 96 | { 97 | 98 | } 99 | 100 | private void login_Load(object sender, EventArgs e) 101 | { 102 | 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /WatchMovie/dapper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualBasic.ApplicationServices; 2 | using Npgsql; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace WatchMovie 10 | { 11 | //public class dapper 12 | // { 13 | // string connectionString = "Server=localhost;Port=5433;User Id=postgres;Password=1234;Database=YandexGo;"; 14 | 15 | // using (var connection = new NpgsqlConnection(connectionString)) 16 | // { 17 | // var user = new Users() 18 | // { 19 | // UserName = 20 | // }; 21 | // var sqlQuery = "delete from public.\"Users\" where \"PhoneNumber\" = @PhoneNumber"; 22 | 23 | // connection.Execute(sqlQuery, user); 24 | 25 | // MessageBox.Show("Sucesfully Deleted"); 26 | // LoginPage login = new LoginPage(); 27 | // login.Show(); 28 | // Hide(); 29 | //} 30 | 31 | 32 | //string connectionString = "Server=localhost;Port=5433;User Id=postgres;Password=1234;Database=YandexGo;"; 33 | 34 | //using (var connection = new NpgsqlConnection(connectionString)) 35 | //{ 36 | // var user = new User() 37 | // { 38 | // FullName = fullName, 39 | // PhoneNumber = phoneNumber, 40 | // Password = Password 41 | // }; 42 | 43 | // var sqlQuery = "INSERT INTO public.\"Users\"(\"FullName\", \"PhoneNumber\", \"Password\") values (@FullName,@PhoneNumber,@Password)"; 44 | 45 | 46 | // if (res1 == null && res2 == null) 47 | // { 48 | // connection.Execute(sqlQuery, user); 49 | // return false; 50 | // } 51 | // return true; 52 | //} 53 | 54 | 55 | //public bool CheckUserLogin2(int UserPhoneNumber, string Password) 56 | //{ 57 | // string connectionString = "Server=localhost;Port=5433;User Id=postgres;Password=1234;Database=YandexGo;"; 58 | 59 | // using (var connection = new NpgsqlConnection(connectionString)) 60 | // { 61 | // var user = new User() 62 | // { 63 | // PhoneNumber = UserPhoneNumber, 64 | // Password = Password 65 | // }; 66 | 67 | // var sqlQuery = "SELECT \"PhoneNumber\", \"Password\" FROm public.\"Users\" where \"PhoneNumber\" = @PhoneNumber and \"Password\" = @Password"; 68 | 69 | // var res = connection.Query(sqlQuery, user).ToList(); 70 | 71 | // foreach (var i in res) 72 | // { 73 | // if (i.PhoneNumber == UserPhoneNumber && i.Password == Password) 74 | // { 75 | // return true; 76 | // } 77 | // } 78 | // return false; 79 | // } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /WatchMovie/likedMovies.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class likedMovies 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | pictureBox1 = new PictureBox(); 32 | dataGridView1 = new DataGridView(); 33 | button1 = new Button(); 34 | button2 = new Button(); 35 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); 36 | ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); 37 | SuspendLayout(); 38 | // 39 | // pictureBox1 40 | // 41 | pictureBox1.Image = Properties.Resources.Screenshot_2023_07_28_155531; 42 | pictureBox1.Location = new Point(-522, -2); 43 | pictureBox1.Name = "pictureBox1"; 44 | pictureBox1.Size = new Size(1898, 95); 45 | pictureBox1.TabIndex = 1; 46 | pictureBox1.TabStop = false; 47 | pictureBox1.Click += pictureBox1_Click; 48 | // 49 | // dataGridView1 50 | // 51 | dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 52 | dataGridView1.Location = new Point(231, 149); 53 | dataGridView1.Name = "dataGridView1"; 54 | dataGridView1.RowHeadersWidth = 62; 55 | dataGridView1.RowTemplate.Height = 33; 56 | dataGridView1.Size = new Size(793, 370); 57 | dataGridView1.TabIndex = 2; 58 | dataGridView1.CellContentClick += dataGridView1_CellContentClick; 59 | // 60 | // button1 61 | // 62 | button1.Location = new Point(1066, 485); 63 | button1.Name = "button1"; 64 | button1.Size = new Size(112, 34); 65 | button1.TabIndex = 3; 66 | button1.Text = "button1"; 67 | button1.UseVisualStyleBackColor = true; 68 | button1.Click += button1_Click; 69 | // 70 | // button2 71 | // 72 | button2.Location = new Point(1066, 149); 73 | button2.Name = "button2"; 74 | button2.Size = new Size(112, 34); 75 | button2.TabIndex = 4; 76 | button2.Text = "show"; 77 | button2.UseVisualStyleBackColor = true; 78 | button2.Click += button2_Click; 79 | // 80 | // likedMovies 81 | // 82 | AutoScaleDimensions = new SizeF(10F, 25F); 83 | AutoScaleMode = AutoScaleMode.Font; 84 | BackColor = SystemColors.ActiveCaptionText; 85 | ClientSize = new Size(1362, 584); 86 | Controls.Add(button2); 87 | Controls.Add(button1); 88 | Controls.Add(dataGridView1); 89 | Controls.Add(pictureBox1); 90 | Name = "likedMovies"; 91 | Text = "likedMovies"; 92 | Load += likedMovies_Load; 93 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); 94 | ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); 95 | ResumeLayout(false); 96 | } 97 | 98 | #endregion 99 | 100 | private PictureBox pictureBox1; 101 | private DataGridView dataGridView1; 102 | private Button button1; 103 | private Button button2; 104 | } 105 | } -------------------------------------------------------------------------------- /Core/Data/WatchMovieDb.cs: -------------------------------------------------------------------------------- 1 | namespace Core.data 2 | { 3 | public class WatchMovieHD : DbContext 4 | { 5 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 6 | { 7 | optionsBuilder.UseNpgsql("Server=localhost; Port=5432; User Id=postgres; Password=ing0077K; Database=WatchMovieHD"); 8 | base.OnConfiguring(optionsBuilder); 9 | // 10 | } 11 | 12 | protected override void OnModelCreating(ModelBuilder modelBuilder) 13 | { 14 | base.OnModelCreating(modelBuilder); 15 | SeedData(modelBuilder); 16 | } 17 | public void SeedData(ModelBuilder modelBuilder) 18 | { 19 | modelBuilder.Entity().HasData( 20 | new Film() 21 | { 22 | Id = 1, 23 | Type = "movie", 24 | Name = "the shawshank redemption", 25 | Genre = "drama", 26 | Year = "1994", 27 | Duration = "142 min", 28 | Producer = "frank darabont", 29 | //Achivement = "academy", 30 | Country = "usa" 31 | }, 32 | new Film() 33 | { 34 | Id = 2, 35 | Type = "movie", 36 | Name = "The Godfather", 37 | Genre = "Crime", 38 | Year = "1972", 39 | Duration = "175 min ", 40 | Producer = "Francis Ford Coppola", 41 | //Achivement = "Academy", 42 | Country = "USA" 43 | }, 44 | new Film() 45 | { 46 | Id = 3, 47 | Type = "movie", 48 | Name = "Inception", 49 | Genre = "Fantastic", 50 | Year = "2010", 51 | Duration = "148 min", 52 | Producer = "Christopher Nolan", 53 | //Achivement = "Academy", 54 | Country = "USA" 55 | } 56 | 57 | ); 58 | modelBuilder.Entity().HasData( 59 | new Users 60 | { 61 | Id = 3, 62 | FirstName = "John", 63 | LastName = "Doe", 64 | UserName = "user123", 65 | email = "user123@email.com", 66 | password = "secure_password123" 67 | }, 68 | new Users 69 | { 70 | Id = 4, 71 | FirstName = "Jane", 72 | LastName = "Smith", 73 | UserName = "movie_lover", 74 | email = "movie_lover@email.com", 75 | password = "strong_pass_456" 76 | } 77 | 78 | ); 79 | modelBuilder.Entity().HasData( 80 | new Achivement 81 | { 82 | Id = 1, 83 | Name = "Academy", 84 | Description = "Awarded for outstanding achievements in the film industry." 85 | }, 86 | new Achivement 87 | { 88 | Id = 2, 89 | Name = "GoldenGlobe", 90 | Description = "Recognizes excellence in film and television." 91 | }, 92 | new Achivement 93 | { 94 | Id = 3, 95 | Name = "Oscar", 96 | Description = "Recognizes excellence in film and television." 97 | } 98 | 99 | ); 100 | } 101 | //protected override void OnModelCreating(ModelBuilder modelBuilder) 102 | //{ 103 | // base.OnModelCreating(modelBuilder); 104 | // SeedData(modelBuilder); 105 | //} 106 | public DbSet Films { get; set; } 107 | public DbSet achives { get; set; } 108 | public DbSet achivments { get; set; } 109 | public DbSet Viewedfilms { get; set; } 110 | public DbSet LikedFilms { get; set; } 111 | public DbSet User { get; set; } 112 | //public void SeedData() 113 | //{ 114 | // if (!Films.Any()) 115 | // { 116 | // Films.AddRange(FilmSeedData.Films); 117 | // } 118 | 119 | // if (!achives.Any()) 120 | // { 121 | // achives.AddRange(FilmAwardSeedData.FilmAwards); 122 | // } 123 | 124 | // if (!User.Any()) 125 | // { 126 | // User.AddRange(UserSeedData.Users); 127 | // } 128 | 129 | // SaveChanges(); 130 | //} 131 | //public void Adduser(string newusers) 132 | //{ 133 | // var db = new WatchMovieHD(); 134 | // var user = new Users(newusers); 135 | // db.Add(user); 136 | // db.SaveChanges(); 137 | 138 | //} 139 | } 140 | 141 | 142 | } -------------------------------------------------------------------------------- /WatchMovie/sortedmovies.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class sortedmovies 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | pictureBox1 = new PictureBox(); 32 | label1 = new Label(); 33 | dataGridView1 = new DataGridView(); 34 | comboBox1 = new ComboBox(); 35 | button1 = new Button(); 36 | button2 = new Button(); 37 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); 38 | ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); 39 | SuspendLayout(); 40 | // 41 | // pictureBox1 42 | // 43 | pictureBox1.Image = Properties.Resources.Screenshot_2023_07_28_155531; 44 | pictureBox1.Location = new Point(-2, -1); 45 | pictureBox1.Name = "pictureBox1"; 46 | pictureBox1.Size = new Size(1898, 95); 47 | pictureBox1.TabIndex = 1; 48 | pictureBox1.TabStop = false; 49 | // 50 | // label1 51 | // 52 | label1.Font = new Font("Segoe UI Black", 13F, FontStyle.Bold, GraphicsUnit.Point); 53 | label1.ForeColor = SystemColors.ButtonHighlight; 54 | label1.Location = new Point(31, 130); 55 | label1.Name = "label1"; 56 | label1.Size = new Size(117, 68); 57 | label1.TabIndex = 2; 58 | label1.Text = "Genre : "; 59 | // 60 | // dataGridView1 61 | // 62 | dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 63 | dataGridView1.Location = new Point(31, 324); 64 | dataGridView1.Name = "dataGridView1"; 65 | dataGridView1.RowHeadersWidth = 62; 66 | dataGridView1.RowTemplate.Height = 33; 67 | dataGridView1.Size = new Size(1433, 451); 68 | dataGridView1.TabIndex = 4; 69 | dataGridView1.CellContentClick += dataGridView1_CellContentClick; 70 | // 71 | // comboBox1 72 | // 73 | comboBox1.FormattingEnabled = true; 74 | comboBox1.Location = new Point(130, 136); 75 | comboBox1.Name = "comboBox1"; 76 | comboBox1.Size = new Size(182, 33); 77 | comboBox1.TabIndex = 5; 78 | comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; 79 | // 80 | // button1 81 | // 82 | button1.Location = new Point(335, 136); 83 | button1.Name = "button1"; 84 | button1.Size = new Size(112, 34); 85 | button1.TabIndex = 6; 86 | button1.Text = "search"; 87 | button1.UseVisualStyleBackColor = true; 88 | button1.Click += button1_Click; 89 | // 90 | // button2 91 | // 92 | button2.Location = new Point(232, 844); 93 | button2.Name = "button2"; 94 | button2.Size = new Size(112, 34); 95 | button2.TabIndex = 7; 96 | button2.Text = "button2"; 97 | button2.UseVisualStyleBackColor = true; 98 | button2.Click += button2_Click; 99 | // 100 | // sortedmovies 101 | // 102 | AutoScaleDimensions = new SizeF(10F, 25F); 103 | AutoScaleMode = AutoScaleMode.Font; 104 | BackColor = Color.Black; 105 | ClientSize = new Size(1892, 1044); 106 | Controls.Add(button2); 107 | Controls.Add(button1); 108 | Controls.Add(comboBox1); 109 | Controls.Add(dataGridView1); 110 | Controls.Add(label1); 111 | Controls.Add(pictureBox1); 112 | Name = "sortedmovies"; 113 | Text = "sortedmovies"; 114 | Load += sortedmovies_Load; 115 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); 116 | ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); 117 | ResumeLayout(false); 118 | } 119 | 120 | #endregion 121 | 122 | private PictureBox pictureBox1; 123 | private Label label1; 124 | private DataGridView dataGridView1; 125 | private ComboBox comboBox1; 126 | private Button button1; 127 | private Button button2; 128 | } 129 | } -------------------------------------------------------------------------------- /WatchMovie/homepage.cs: -------------------------------------------------------------------------------- 1 | using Core.Enum; 2 | using Core.models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel; 6 | using System.Data; 7 | using System.Drawing; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | using Core.data; 13 | 14 | 15 | 16 | namespace WatchMovie 17 | { 18 | public partial class homepage : Form 19 | { 20 | 21 | public homepage() 22 | { 23 | InitializeComponent(); 24 | 25 | } 26 | public string userName { get; set; } 27 | public homepage(string userName) 28 | { 29 | InitializeComponent(); 30 | this.userName = userName; 31 | 32 | } 33 | private void pictureBox1_Click(object sender, EventArgs e) 34 | { 35 | 36 | } 37 | 38 | private void label1_Click(object sender, EventArgs e) 39 | { 40 | 41 | } 42 | 43 | private void label3_Click(object sender, EventArgs e) 44 | { 45 | login login = new login(); 46 | 47 | login.Show(); 48 | } 49 | 50 | private void textBox1_TextChanged(object sender, EventArgs e) 51 | { 52 | 53 | } 54 | 55 | private void button1_Click(object sender, EventArgs e) 56 | { 57 | 58 | } 59 | 60 | private void button1_Click_1(object sender, EventArgs e) 61 | { 62 | filmspage filmspage = new filmspage(); 63 | Hide(); 64 | filmspage.Show(); 65 | } 66 | 67 | private void homepage_Load(object sender, EventArgs e) 68 | { 69 | 70 | 71 | } 72 | 73 | private void comboBox1_load(object sender, EventArgs e) 74 | { 75 | //comboBox1.Items.AddRange(Enum.GetNames(typeof(genre))); 76 | //comboBox1.Items.Add(movies); 77 | 78 | } 79 | 80 | private void genreBindingSource3_CurrentChanged(object sender, EventArgs e) 81 | { 82 | //foreach (string genres in Enum.GetNames(typeof(genre))) 83 | //{ 84 | // genreBindingSource3.Add(genres); 85 | //} 86 | 87 | } 88 | 89 | private void genreBindingSource_CurrentChanged(object sender, EventArgs e) 90 | { 91 | 92 | 93 | } 94 | 95 | private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) 96 | { 97 | 98 | } 99 | 100 | private void label4_Click(object sender, EventArgs e) 101 | { 102 | adminpanel adminpanel = new adminpanel(); 103 | Hide(); 104 | adminpanel.Show(); 105 | } 106 | 107 | private void label5_Click(object sender, EventArgs e) 108 | { 109 | likedMovies likedMovies = new likedMovies(); 110 | Hide(); 111 | likedMovies.Show(); 112 | } 113 | 114 | private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) 115 | { 116 | 117 | } 118 | 119 | private void button4_Click(object sender, EventArgs e) 120 | { 121 | var db = new WatchMovieHD(); 122 | 123 | var res = db.Films.FirstOrDefault(film => film.Name == textBox1.Text); 124 | 125 | if (res == null) 126 | { 127 | 128 | textBox1.Text = "movie not found"; 129 | 130 | } 131 | else 132 | { 133 | var AllRows = db.Films.Where(f => f.Name == textBox1.Text).ToList(); 134 | 135 | dataGridView1.DataSource = AllRows; 136 | 137 | using (WatchMovieHD contexts = new WatchMovieHD()) 138 | { 139 | Viewedfilms ViewFilms = new Viewedfilms(); 140 | 141 | var movie = textBox1.Text; 142 | 143 | var resultMovie = contexts.Films.FirstOrDefault(x => x.Name == movie); 144 | 145 | var resultUser = contexts.User.FirstOrDefault(x => x.UserName == userName); 146 | 147 | ViewFilms.userid = resultUser.Id; 148 | 149 | ViewFilms.FilmId = resultMovie.Id; 150 | 151 | contexts.Viewedfilms.Add(ViewFilms); 152 | contexts.SaveChanges(); 153 | } 154 | 155 | } 156 | } 157 | 158 | private void button2_Click(object sender, EventArgs e) 159 | { 160 | 161 | //var db = new WatchMovieHD(); 162 | //var AllRows = db.Films.Where(f => f.Genre == textBox1.Text).ToList(); 163 | 164 | 165 | sortedmovies sortedmovies = new sortedmovies(); 166 | Hide(); 167 | sortedmovies.Show(); 168 | 169 | 170 | } 171 | 172 | private void button3_Click(object sender, EventArgs e) 173 | { 174 | SortedByType sortedByType = new SortedByType(); 175 | Hide(); 176 | sortedByType.Show(); 177 | } 178 | 179 | private void pictureBox1_Click_1(object sender, EventArgs e) 180 | { 181 | try 182 | { 183 | using (WatchMovieHD contexts = new WatchMovieHD()) 184 | { 185 | likedFilms likedFilms = new likedFilms(); 186 | 187 | var movie = textBox1.Text; 188 | 189 | var resultMovie = contexts.Films.FirstOrDefault(x => x.Name == movie); 190 | 191 | var resultUser = contexts.User.FirstOrDefault(x => x.UserName == userName); 192 | 193 | likedFilms.userid = resultUser.Id; 194 | 195 | likedFilms.FilmId = resultMovie.Id; 196 | 197 | contexts.LikedFilms.Add(likedFilms); 198 | contexts.SaveChanges(); 199 | } 200 | } 201 | catch (Exception ex) 202 | { 203 | MessageBox.Show("you havent choosed movie"); 204 | } 205 | } 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /WatchMovie/filmspage.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WatchMovie/SortedByType.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WatchMovie/adminpanel.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WatchMovie/likedMovies.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WatchMovie/sortedmovies.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WatchMovieHD/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /WatchMovie/filmspage.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class filmspage 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | pictureBox1 = new PictureBox(); 32 | label1 = new Label(); 33 | label2 = new Label(); 34 | dataGridView1 = new DataGridView(); 35 | pictureBox3 = new PictureBox(); 36 | pictureBox4 = new PictureBox(); 37 | button1 = new Button(); 38 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); 39 | ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); 40 | ((System.ComponentModel.ISupportInitialize)pictureBox3).BeginInit(); 41 | ((System.ComponentModel.ISupportInitialize)pictureBox4).BeginInit(); 42 | SuspendLayout(); 43 | // 44 | // pictureBox1 45 | // 46 | pictureBox1.Image = Properties.Resources.Screenshot_2023_07_28_155531; 47 | pictureBox1.Location = new Point(2, 0); 48 | pictureBox1.Name = "pictureBox1"; 49 | pictureBox1.Size = new Size(1898, 95); 50 | pictureBox1.TabIndex = 0; 51 | pictureBox1.TabStop = false; 52 | pictureBox1.Click += pictureBox1_Click; 53 | // 54 | // label1 55 | // 56 | label1.Font = new Font("Segoe UI", 13F, FontStyle.Bold, GraphicsUnit.Point); 57 | label1.ForeColor = Color.WhiteSmoke; 58 | label1.Location = new Point(12, 189); 59 | label1.Name = "label1"; 60 | label1.Size = new Size(322, 72); 61 | label1.TabIndex = 1; 62 | label1.Text = "Viewed Films"; 63 | // 64 | // label2 65 | // 66 | label2.Font = new Font("Segoe UI", 13F, FontStyle.Bold, GraphicsUnit.Point); 67 | label2.ForeColor = Color.WhiteSmoke; 68 | label2.Location = new Point(12, 579); 69 | label2.Name = "label2"; 70 | label2.Size = new Size(322, 72); 71 | label2.TabIndex = 2; 72 | label2.Text = "Random films"; 73 | // 74 | // dataGridView1 75 | // 76 | dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 77 | dataGridView1.Location = new Point(33, 249); 78 | dataGridView1.Name = "dataGridView1"; 79 | dataGridView1.RowHeadersWidth = 62; 80 | dataGridView1.RowTemplate.Height = 33; 81 | dataGridView1.Size = new Size(843, 271); 82 | dataGridView1.TabIndex = 3; 83 | dataGridView1.CellContentClick += dataGridView1_CellContentClick; 84 | // 85 | // pictureBox3 86 | // 87 | pictureBox3.Image = Properties.Resources.dfdf; 88 | pictureBox3.Location = new Point(1766, 22); 89 | pictureBox3.Name = "pictureBox3"; 90 | pictureBox3.Size = new Size(47, 41); 91 | pictureBox3.TabIndex = 5; 92 | pictureBox3.TabStop = false; 93 | pictureBox3.Click += pictureBox3_Click; 94 | // 95 | // pictureBox4 96 | // 97 | pictureBox4.Image = Properties.Resources.sds; 98 | pictureBox4.Location = new Point(1819, 22); 99 | pictureBox4.Name = "pictureBox4"; 100 | pictureBox4.Size = new Size(49, 41); 101 | pictureBox4.TabIndex = 6; 102 | pictureBox4.TabStop = false; 103 | // 104 | // button1 105 | // 106 | button1.Location = new Point(907, 249); 107 | button1.Name = "button1"; 108 | button1.Size = new Size(112, 34); 109 | button1.TabIndex = 7; 110 | button1.Text = "button1"; 111 | button1.UseVisualStyleBackColor = true; 112 | button1.Click += button1_Click; 113 | // 114 | // filmspage 115 | // 116 | AutoScaleDimensions = new SizeF(10F, 25F); 117 | AutoScaleMode = AutoScaleMode.Font; 118 | BackColor = Color.Black; 119 | ClientSize = new Size(1895, 1050); 120 | Controls.Add(button1); 121 | Controls.Add(pictureBox4); 122 | Controls.Add(pictureBox3); 123 | Controls.Add(dataGridView1); 124 | Controls.Add(label2); 125 | Controls.Add(label1); 126 | Controls.Add(pictureBox1); 127 | Name = "filmspage"; 128 | Text = "filmspage"; 129 | Load += filmspage_Load; 130 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); 131 | ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); 132 | ((System.ComponentModel.ISupportInitialize)pictureBox3).EndInit(); 133 | ((System.ComponentModel.ISupportInitialize)pictureBox4).EndInit(); 134 | ResumeLayout(false); 135 | } 136 | 137 | #endregion 138 | 139 | private PictureBox pictureBox1; 140 | private Label label1; 141 | private Label label2; 142 | private DataGridView dataGridView1; 143 | private PictureBox pictureBox3; 144 | private PictureBox pictureBox4; 145 | private Button button1; 146 | } 147 | } -------------------------------------------------------------------------------- /Core/Seeddata/SeedData.cs: -------------------------------------------------------------------------------- 1 | 2 | //public void SeedData(ModelBuilder modelBuilder) 3 | //{ 4 | // modelBuilder.Entity().HasData( 5 | // new Film() 6 | // { 7 | // Id = 1, 8 | // Type = "Movie", 9 | // Name = "the shawshank redemption", 10 | // Genre = "drama", 11 | // Year = 1994, 12 | // Duration = "142 minut", 13 | // Producer = "frank darabont", 14 | // Achivement = "academy awards", 15 | // Country = "usa" 16 | // }, 17 | // new Film() 18 | // { 19 | // Id = 2, 20 | // Type = "Movie", 21 | // Name = "The Godfather", 22 | // Genre = "Crime", 23 | // Year = 1972, 24 | // Duration = "175", 25 | // Producer = "Francis Ford Coppola", 26 | // Achivement = "Academy Awards", 27 | // Country = "USA" 28 | // }, 29 | // new Film() 30 | // { 31 | // Id = 3, 32 | // Type = "Movie", 33 | // Name = "Inception", 34 | // Genre = "Fantastic", 35 | // Year = 2010, 36 | // Duration = "148", 37 | // Producer = "Christopher Nolan", 38 | // Achivement = "Academy Awards", 39 | // Country = "USA" 40 | // } 41 | 42 | // ); 43 | // modelBuilder.Entity().HasData( 44 | // new Users 45 | // { 46 | // Id = 3, 47 | // FirstName = "John", 48 | // LastName = "Doe", 49 | // UserName = "user123", 50 | // email = "user123@example.com", 51 | // password = "secure_password123" 52 | // }, 53 | // new Users 54 | // { 55 | // Id = 4, 56 | // FirstName = "Jane", 57 | // LastName = "Smith", 58 | // UserName = "movie_lover", 59 | // email = "movie_lover@example.com", 60 | // password = "strong_pass_456" 61 | // } 62 | 63 | // ); 64 | // modelBuilder.Entity().HasData( 65 | // new Achivement 66 | // { 67 | // Id = 1, 68 | // Name = "Academy Awards", 69 | // Description = "Awarded for outstanding achievements in the film industry." 70 | // }, 71 | // new Achivement 72 | // { 73 | // Id = 2, 74 | // Name = "Golden Globe Awards", 75 | // Description = "Recognizes excellence in film and television." 76 | // }, 77 | // new Achivement 78 | // { 79 | // Id = 3, 80 | // Name = "Oscar", 81 | // Description = "Recognizes excellence in film and television." 82 | // } 83 | 84 | // ); 85 | 86 | 87 | 88 | //public class SeedData 89 | //{ 90 | // public class UserSeedData 91 | // { 92 | // public List Users { get; } = new List 93 | // { 94 | // new Users 95 | // { 96 | // Id = 3, 97 | // FirstName = "John", 98 | // LastName = "Doe", 99 | // UserName = "user123", 100 | // email = "user123@example.com", 101 | // password = "secure_password123" 102 | // }, 103 | // new Users 104 | // { 105 | // Id = 4, 106 | // FirstName = "Jane", 107 | // LastName = "Smith", 108 | // UserName = "movie_lover", 109 | // email = "movie_lover@example.com", 110 | // password = "strong_pass_456" 111 | // } 112 | 113 | 114 | //}; 115 | // } 116 | // public class FilmAwardSeedData 117 | // { 118 | // public List FilmAwards { get; } = new List 119 | //{ 120 | // new Achivement 121 | // { 122 | //id = 1, 123 | // name = "academy awards", 124 | // description = "awarded for outstanding achievements in the film industry." 125 | // }, 126 | // new Achivement 127 | // { 128 | // Id = 2, 129 | // Name = "Golden Globe Awards", 130 | // Description = "Recognizes excellence in film and television." 131 | // }, 132 | // new Achivement 133 | // { 134 | // Id = 3, 135 | // Name = "Oscar", 136 | // Description = "Recognizes excellence in film and television." 137 | // } 138 | 139 | //}; 140 | // } 141 | // public class FilmSeedData 142 | // { 143 | // public List Films { get; } = new List 144 | //{ 145 | // new Film 146 | // { 147 | // Id = 1, 148 | // Type = "Feature Film", 149 | // Name = "The Shawshank Redemption", 150 | // Genre = "Drama", 151 | // Year = 1994, 152 | // Duration = "142 minut", 153 | // Producer = "Frank Darabont", 154 | // Achivement = "Academy Awards", 155 | // Country = "USA" 156 | // }, 157 | // new Film 158 | // { 159 | // Id = 2, 160 | // Type = "Feature Film", 161 | // Name = "The Godfather", 162 | // Genre = "Crime", 163 | // Year = 1972, 164 | // Duration = "175", 165 | // Producer = "Francis Ford Coppola", 166 | // Achivement = "Academy Awards", 167 | // Country = "USA" 168 | // }, 169 | // new Film 170 | // { 171 | // Id = 3, 172 | // Type = "Feature Film", 173 | // Name = "Inception", 174 | // Genre = "Sci-Fi", 175 | // Year = 2010, 176 | // Duration = "148", 177 | // Producer = "Christopher Nolan", 178 | // Achivement = "Academy Awards", 179 | // Country = "USA" 180 | // } 181 | 182 | //}; 183 | // } 184 | 185 | 186 | 187 | 188 | 189 | //} 190 | 191 | -------------------------------------------------------------------------------- /WatchMovie/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WatchMovie.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WatchMovie.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap _93_938050_png_file_transparent_white_user_icon_png_download { 67 | get { 68 | object obj = ResourceManager.GetObject("93-938050_png-file-transparent-white-user-icon-png-download", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap dfdf { 77 | get { 78 | object obj = ResourceManager.GetObject("dfdf", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap likepic { 87 | get { 88 | object obj = ResourceManager.GetObject("likepic", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap logo2 { 97 | get { 98 | object obj = ResourceManager.GetObject("logo2", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap Screenshot_2023_07_28_155531 { 107 | get { 108 | object obj = ResourceManager.GetObject("Screenshot 2023-07-28 155531", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap sds { 117 | get { 118 | object obj = ResourceManager.GetObject("sds", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap Web_capture_26_7_2023_63958_watchmovieshd_ru { 127 | get { 128 | object obj = ResourceManager.GetObject("Web capture_26-7-2023_63958_watchmovieshd.ru", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap xbutton { 137 | get { 138 | object obj = ResourceManager.GetObject("xbutton", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /WatchMovie/register.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using System; 3 | using Core.models; 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.Reflection.Emit; 7 | using Core.data; 8 | using Microsoft.VisualBasic.ApplicationServices; 9 | using static System.Windows.Forms.VisualStyles.VisualStyleElement.ListView; 10 | using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel; 11 | using System.Text.RegularExpressions; 12 | using System.Security.Cryptography.X509Certificates; 13 | using Core.ExtencionMethod; 14 | 15 | namespace WatchMovie 16 | { 17 | public partial class register : Form 18 | 19 | { 20 | private WatchMovieHD DbContext; 21 | public register() 22 | { 23 | InitializeComponent(); 24 | DbContext = new WatchMovieHD(); 25 | 26 | 27 | 28 | } 29 | 30 | private void register_Load(object sender, EventArgs e) 31 | { 32 | 33 | } 34 | 35 | private void textBox1_TextChanged(object sender, EventArgs e) 36 | { 37 | 38 | } 39 | 40 | private void label2_Click(object sender, EventArgs e) 41 | { 42 | 43 | } 44 | 45 | private void label3_Click(object sender, EventArgs e) 46 | { 47 | 48 | } 49 | 50 | private void label3_Click_1(object sender, EventArgs e) 51 | { 52 | 53 | } 54 | 55 | private void label1_Click(object sender, EventArgs e) 56 | { 57 | 58 | } 59 | 60 | private void pictureBox1_Click(object sender, EventArgs e) 61 | { 62 | Close(); 63 | 64 | } 65 | 66 | private void button2_Click(object sender, EventArgs e) 67 | { 68 | login login = new login(); 69 | Hide(); 70 | login.Show(); 71 | } 72 | public User user = new User(); 73 | 74 | private void button1_Click(object sender, EventArgs e) 75 | { 76 | 77 | int c = 0; 78 | if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text) || string.IsNullOrEmpty(textBox3.Text) || string.IsNullOrEmpty(textBox5.Text) || string.IsNullOrEmpty(textBox6.Text)) 79 | { 80 | 81 | label4.Visible = true; 82 | c++; 83 | } 84 | var db = new WatchMovieHD(); 85 | if (db.User.FirstOrDefault(user => user.email == textBox2.Text) == null) 86 | { 87 | 88 | label11.Text = label10.Text; 89 | 90 | } 91 | if (!IsValidEmail(textBox2.Text)) 92 | { 93 | label11.Visible = true; 94 | c++; 95 | 96 | } 97 | 98 | //else 99 | //{ 100 | // c++; 101 | // label11.Visible = true; 102 | //} 103 | 104 | if (db.User.FirstOrDefault(user => user.UserName == textBox1.Text) == null) 105 | { 106 | label10.Text = label11.Text; 107 | } 108 | if (textBox2.Text.Length < 8) 109 | { 110 | label5.Visible = true; 111 | c++; 112 | } 113 | 114 | if (textBox3.Text.Length < 8) 115 | { 116 | label12.Visible = true; 117 | c++; 118 | } 119 | if (textBox4.Text != textBox3.Text) 120 | { 121 | label9.Visible = true; 122 | c++; 123 | } 124 | 125 | else if (label4.Visible == false && label11.Visible == false && label10.Visible == false && label5.Visible == false && label12.Visible == false && label9.Visible == false) 126 | { 127 | Users user = new Users(); 128 | using (WatchMovieHD contexts = new WatchMovieHD()) 129 | { 130 | 131 | user.FirstName = textBox5.Text; 132 | user.LastName = textBox6.Text; 133 | user.UserName = textBox1.Text; 134 | user.email = textBox2.Text; 135 | user.password = textBox3.Text; 136 | contexts.User.Add(user); 137 | contexts.SaveChanges(); 138 | 139 | } 140 | homepage homepage = new homepage(textBox1.Text); 141 | Hide(); 142 | homepage.Show(); 143 | 144 | 145 | } 146 | 147 | } 148 | 149 | 150 | private void textBox5_TextChanged(object sender, EventArgs e) 151 | { 152 | 153 | } 154 | 155 | private void textBox4_TextChanged(object sender, EventArgs e) 156 | { 157 | 158 | } 159 | 160 | private void textBox2_TextChanged(object sender, EventArgs e) 161 | { 162 | 163 | } 164 | 165 | private void textBox6_TextChanged(object sender, EventArgs e) 166 | { 167 | 168 | } 169 | 170 | private void label4_Click(object sender, EventArgs e) 171 | { 172 | 173 | } 174 | private bool IsValidEmail(string email) 175 | { 176 | // Using a regular expression for email format validation 177 | string pattern = @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z"; 178 | return Regex.IsMatch(email, pattern); 179 | } 180 | private bool IsValidUsername(string username) 181 | { 182 | 183 | string pattern = "^[a-zA-Z][a-zA-Z0-9]{3,9}$"; 184 | return Regex.IsMatch(username, pattern); 185 | } 186 | 187 | private void label11_Click(object sender, EventArgs e) 188 | { 189 | 190 | } 191 | 192 | private void label10_Click(object sender, EventArgs e) 193 | { 194 | 195 | } 196 | 197 | private void label5_Click(object sender, EventArgs e) 198 | { 199 | 200 | } 201 | 202 | private void textBox3_TextChanged(object sender, EventArgs e) 203 | { 204 | 205 | } 206 | 207 | private void label12_Click(object sender, EventArgs e) 208 | { 209 | 210 | } 211 | 212 | private void label9_Click(object sender, EventArgs e) 213 | { 214 | 215 | } 216 | 217 | private void button3_Click(object sender, EventArgs e) 218 | { 219 | register register = new register(); 220 | Hide(); 221 | register.Show(); 222 | 223 | 224 | 225 | } 226 | } 227 | } -------------------------------------------------------------------------------- /WatchMovie/adminpanel.cs: -------------------------------------------------------------------------------- 1 | using Core.data; 2 | using Core.Enum; 3 | using Dapper; 4 | using Microsoft.VisualBasic.ApplicationServices; 5 | using Npgsql; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.ComponentModel; 9 | using System.Data; 10 | using System.Drawing; 11 | using System.Linq; 12 | using System.Reflection.Emit; 13 | using System.Text; 14 | using System.Threading.Tasks; 15 | using System.Windows.Forms; 16 | 17 | namespace WatchMovie 18 | { 19 | public partial class adminpanel : Form 20 | { 21 | public adminpanel() 22 | { 23 | InitializeComponent(); 24 | checkedListBox1.DataSource = Enum.GetValues(typeof(genre)); 25 | 26 | comboBox1.DataSource = Enum.GetValues(typeof(movies)); 27 | 28 | 29 | } 30 | 31 | private void adminpanel_Load(object sender, EventArgs e) 32 | { 33 | 34 | } 35 | 36 | private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e) 37 | { 38 | 39 | } 40 | 41 | private void checkedListBox2_SelectedIndexChanged(object sender, EventArgs e) 42 | { 43 | 44 | } 45 | 46 | private void button3_Click(object sender, EventArgs e) 47 | { 48 | 49 | } 50 | 51 | private void button4_Click(object sender, EventArgs e) 52 | { 53 | //homepage homepage = new homepage(); 54 | //Hide(); 55 | //homepage.Show(); 56 | } 57 | 58 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 59 | { 60 | 61 | } 62 | 63 | private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) 64 | { 65 | 66 | } 67 | 68 | private void button1_Click(object sender, EventArgs e) 69 | { 70 | using (WatchMovieHD context = new WatchMovieHD()) 71 | { 72 | Film film = new Film(); 73 | 74 | film.Name = textBox1.Text; 75 | film.Genre = checkedListBox1.Text; 76 | film.Year = textBox3.Text; 77 | film.Type = comboBox1.Text; 78 | film.Country = textBox17.Text; 79 | film.Duration = textBox5.Text; 80 | film.Producer = textBox4.Text; 81 | film.Achivement = textBox13.Text; 82 | 83 | context.Films.Add(film); 84 | context.SaveChanges(); 85 | } 86 | } 87 | 88 | private void textBox1_TextChanged(object sender, EventArgs e) 89 | { 90 | 91 | } 92 | 93 | private void textBox3_TextChanged(object sender, EventArgs e) 94 | { 95 | 96 | } 97 | 98 | private void textBox4_TextChanged(object sender, EventArgs e) 99 | { 100 | 101 | } 102 | 103 | private void textBox5_TextChanged(object sender, EventArgs e) 104 | { 105 | 106 | } 107 | 108 | private void textBox13_TextChanged(object sender, EventArgs e) 109 | { 110 | 111 | } 112 | 113 | private void button2_Click(object sender, EventArgs e) 114 | { 115 | 116 | //using (WatchMovieHD contexts = new WatchMovieHD()) 117 | //{ 118 | // Film user = new Film(); 119 | // user.Name = textBox12.Text; 120 | // user.Genre = checkedListBox3.Text; 121 | // user.Year = textBox11.Text; 122 | // user.Type = comboBox3.Text; 123 | // user.Duration = textBox2.Text; 124 | // user.Producer = textBox10.Text; 125 | // user.Achivement = textBox14.Text; 126 | // contexts.Films.Add(user); 127 | // contexts.SaveChanges(); 128 | 129 | //} 130 | } 131 | 132 | private void comboBox3_SelectedIndexChanged(object sender, EventArgs e) 133 | { 134 | 135 | 136 | } 137 | 138 | private void textBox12_TextChanged(object sender, EventArgs e) 139 | { 140 | 141 | } 142 | 143 | private void checkedListBox3_SelectedIndexChanged(object sender, EventArgs e) 144 | { 145 | 146 | } 147 | 148 | private void textBox11_TextChanged(object sender, EventArgs e) 149 | { 150 | 151 | } 152 | 153 | private void textBox10_TextChanged(object sender, EventArgs e) 154 | { 155 | 156 | } 157 | 158 | private void textBox2_TextChanged(object sender, EventArgs e) 159 | { 160 | 161 | } 162 | 163 | private void textBox14_TextChanged(object sender, EventArgs e) 164 | { 165 | 166 | } 167 | 168 | private void button3_Click_1(object sender, EventArgs e) 169 | { 170 | 171 | } 172 | 173 | private void button5_Click(object sender, EventArgs e) 174 | { 175 | string movie = textBox16.Text; 176 | 177 | using (WatchMovieHD contexts = new WatchMovieHD()) 178 | { 179 | var result = contexts.Films.FirstOrDefault(x => x.Name == movie); 180 | 181 | if (result != null) 182 | { 183 | contexts.Films.Remove(result); 184 | contexts.SaveChanges(); 185 | } 186 | } 187 | } 188 | 189 | private void textBox17_TextChanged(object sender, EventArgs e) 190 | { 191 | 192 | } 193 | 194 | private void textBox16_TextChanged(object sender, EventArgs e) 195 | { 196 | 197 | } 198 | 199 | private void button2_Click_1(object sender, EventArgs e) 200 | { 201 | string connectionString = "Server=localhost;Port=5432;User Id=postgres;Password=ing0077K;Database=WatchMovieHD;"; 202 | 203 | using (var connection = new NpgsqlConnection(connectionString)) 204 | { 205 | var user = new Users() 206 | { 207 | UserName = textBox2.Text, 208 | }; 209 | var sqlQuery = "delete from public.\"User\" where \"UserName\" = @UserName"; 210 | 211 | connection.Execute(sqlQuery, user); 212 | 213 | MessageBox.Show("Sucesfully Deleted"); 214 | } 215 | } 216 | 217 | private void textBox2_TextChanged_1(object sender, EventArgs e) 218 | { 219 | 220 | } 221 | 222 | private void button3_Click_2(object sender, EventArgs e) 223 | { 224 | homepage homepage = new homepage(); 225 | Hide(); 226 | homepage.Show(); 227 | } 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /WatchMovie/SortedByType.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class SortedByType 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle(); 32 | DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle(); 33 | pictureBox1 = new PictureBox(); 34 | label1 = new Label(); 35 | dataGridView1 = new DataGridView(); 36 | comboBox1 = new ComboBox(); 37 | button1 = new Button(); 38 | button2 = new Button(); 39 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); 40 | ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); 41 | SuspendLayout(); 42 | // 43 | // pictureBox1 44 | // 45 | pictureBox1.Image = Properties.Resources.Screenshot_2023_07_28_155531; 46 | pictureBox1.Location = new Point(-1, -4); 47 | pictureBox1.Name = "pictureBox1"; 48 | pictureBox1.Size = new Size(1900, 75); 49 | pictureBox1.TabIndex = 0; 50 | pictureBox1.TabStop = false; 51 | pictureBox1.Click += pictureBox1_Click; 52 | // 53 | // label1 54 | // 55 | label1.Font = new Font("Segoe UI Black", 13F, FontStyle.Bold, GraphicsUnit.Point); 56 | label1.ForeColor = SystemColors.ButtonHighlight; 57 | label1.Location = new Point(12, 89); 58 | label1.Name = "label1"; 59 | label1.Size = new Size(171, 68); 60 | label1.TabIndex = 4; 61 | label1.Text = "film Type :"; 62 | // 63 | // dataGridView1 64 | // 65 | dataGridView1.BackgroundColor = SystemColors.ActiveCaption; 66 | dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 67 | dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleLeft; 68 | dataGridViewCellStyle1.BackColor = SystemColors.InactiveCaptionText; 69 | dataGridViewCellStyle1.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); 70 | dataGridViewCellStyle1.ForeColor = SystemColors.ButtonHighlight; 71 | dataGridViewCellStyle1.SelectionBackColor = SystemColors.Highlight; 72 | dataGridViewCellStyle1.SelectionForeColor = SystemColors.HighlightText; 73 | dataGridViewCellStyle1.WrapMode = DataGridViewTriState.False; 74 | dataGridView1.DefaultCellStyle = dataGridViewCellStyle1; 75 | dataGridView1.GridColor = Color.Black; 76 | dataGridView1.Location = new Point(25, 275); 77 | dataGridView1.Name = "dataGridView1"; 78 | dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleLeft; 79 | dataGridViewCellStyle2.BackColor = SystemColors.Control; 80 | dataGridViewCellStyle2.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point); 81 | dataGridViewCellStyle2.ForeColor = Color.Blue; 82 | dataGridViewCellStyle2.SelectionBackColor = SystemColors.Highlight; 83 | dataGridViewCellStyle2.SelectionForeColor = SystemColors.WindowText; 84 | dataGridViewCellStyle2.WrapMode = DataGridViewTriState.True; 85 | dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2; 86 | dataGridView1.RowHeadersWidth = 62; 87 | dataGridView1.RowTemplate.Height = 33; 88 | dataGridView1.Size = new Size(1099, 374); 89 | dataGridView1.TabIndex = 6; 90 | dataGridView1.CellContentClick += dataGridView1_CellContentClick; 91 | // 92 | // comboBox1 93 | // 94 | comboBox1.FormattingEnabled = true; 95 | comboBox1.Location = new Point(175, 100); 96 | comboBox1.Name = "comboBox1"; 97 | comboBox1.Size = new Size(182, 33); 98 | comboBox1.TabIndex = 7; 99 | comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; 100 | // 101 | // button1 102 | // 103 | button1.ForeColor = SystemColors.ActiveCaptionText; 104 | button1.Location = new Point(385, 102); 105 | button1.Name = "button1"; 106 | button1.Size = new Size(112, 34); 107 | button1.TabIndex = 8; 108 | button1.Text = "search"; 109 | button1.UseVisualStyleBackColor = true; 110 | button1.Click += button1_Click; 111 | // 112 | // button2 113 | // 114 | button2.Location = new Point(806, 102); 115 | button2.Name = "button2"; 116 | button2.Size = new Size(112, 34); 117 | button2.TabIndex = 9; 118 | button2.Text = "button2"; 119 | button2.UseVisualStyleBackColor = true; 120 | button2.Click += button2_Click; 121 | // 122 | // SortedByType 123 | // 124 | AutoScaleDimensions = new SizeF(10F, 25F); 125 | AutoScaleMode = AutoScaleMode.Font; 126 | BackColor = SystemColors.ActiveCaptionText; 127 | ClientSize = new Size(1882, 742); 128 | Controls.Add(button2); 129 | Controls.Add(button1); 130 | Controls.Add(comboBox1); 131 | Controls.Add(dataGridView1); 132 | Controls.Add(label1); 133 | Controls.Add(pictureBox1); 134 | ForeColor = SystemColors.ButtonHighlight; 135 | Name = "SortedByType"; 136 | Text = "SortedByType"; 137 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); 138 | ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); 139 | ResumeLayout(false); 140 | } 141 | 142 | #endregion 143 | 144 | private PictureBox pictureBox1; 145 | private Label label1; 146 | private DataGridView dataGridView1; 147 | private ComboBox comboBox1; 148 | private Button button1; 149 | private Button button2; 150 | } 151 | } -------------------------------------------------------------------------------- /WatchMovie/homepage.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | 136 | True 137 | 138 | 139 | True 140 | 141 | -------------------------------------------------------------------------------- /WatchMovie/login.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class login 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(login)); 32 | label2 = new Label(); 33 | label1 = new Label(); 34 | textBox2 = new TextBox(); 35 | textBox1 = new TextBox(); 36 | button2 = new Button(); 37 | label3 = new Label(); 38 | button1 = new Button(); 39 | pictureBox1 = new PictureBox(); 40 | label4 = new Label(); 41 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); 42 | SuspendLayout(); 43 | // 44 | // label2 45 | // 46 | label2.AutoSize = true; 47 | label2.Font = new Font("Segoe UI", 16F, FontStyle.Bold, GraphicsUnit.Point); 48 | label2.ForeColor = Color.FromArgb(31, 208, 185); 49 | label2.Location = new Point(282, 30); 50 | label2.Name = "label2"; 51 | label2.Size = new Size(55, 45); 52 | label2.TabIndex = 8; 53 | label2.Text = "IN"; 54 | // 55 | // label1 56 | // 57 | label1.Font = new Font("Arial Black", 16F, FontStyle.Bold, GraphicsUnit.Point); 58 | label1.Location = new Point(175, 31); 59 | label1.Name = "label1"; 60 | label1.Size = new Size(112, 52); 61 | label1.TabIndex = 7; 62 | label1.Text = "SIGN\r\n\r\n"; 63 | // 64 | // textBox2 65 | // 66 | textBox2.BackColor = Color.FromArgb(19, 22, 21); 67 | textBox2.BorderStyle = BorderStyle.None; 68 | textBox2.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point); 69 | textBox2.ForeColor = SystemColors.InactiveBorder; 70 | textBox2.Location = new Point(62, 205); 71 | textBox2.Multiline = true; 72 | textBox2.Name = "textBox2"; 73 | textBox2.PlaceholderText = "email"; 74 | textBox2.Size = new Size(385, 53); 75 | textBox2.TabIndex = 6; 76 | textBox2.TextChanged += textBox2_TextChanged; 77 | // 78 | // textBox1 79 | // 80 | textBox1.BackColor = Color.FromArgb(19, 22, 21); 81 | textBox1.BorderStyle = BorderStyle.None; 82 | textBox1.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point); 83 | textBox1.ForeColor = SystemColors.InactiveCaption; 84 | textBox1.Location = new Point(62, 125); 85 | textBox1.Multiline = true; 86 | textBox1.Name = "textBox1"; 87 | textBox1.PlaceholderText = "UserName"; 88 | textBox1.Size = new Size(385, 53); 89 | textBox1.TabIndex = 5; 90 | textBox1.TextChanged += textBox1_TextChanged; 91 | // 92 | // button2 93 | // 94 | button2.BackColor = Color.DarkSlateGray; 95 | button2.ForeColor = SystemColors.ButtonFace; 96 | button2.Location = new Point(286, 364); 97 | button2.Name = "button2"; 98 | button2.Size = new Size(130, 38); 99 | button2.TabIndex = 11; 100 | button2.Text = "sign up now"; 101 | button2.UseVisualStyleBackColor = false; 102 | button2.Click += button2_Click_1; 103 | // 104 | // label3 105 | // 106 | label3.Font = new Font("Segoe UI Emoji", 9F, FontStyle.Regular, GraphicsUnit.Point); 107 | label3.Location = new Point(145, 370); 108 | label3.Name = "label3"; 109 | label3.Size = new Size(230, 32); 110 | label3.TabIndex = 10; 111 | label3.Text = "Not a member ?\r\n\r\n"; 112 | // 113 | // button1 114 | // 115 | button1.BackColor = Color.FromArgb(31, 208, 185); 116 | button1.Font = new Font("Segoe UI Emoji", 10F, FontStyle.Bold, GraphicsUnit.Point); 117 | button1.ForeColor = SystemColors.ActiveCaptionText; 118 | button1.Location = new Point(57, 310); 119 | button1.Name = "button1"; 120 | button1.Size = new Size(390, 46); 121 | button1.TabIndex = 9; 122 | button1.Text = "Log in"; 123 | button1.UseVisualStyleBackColor = false; 124 | button1.Click += button1_Click; 125 | // 126 | // pictureBox1 127 | // 128 | pictureBox1.Image = (Image)resources.GetObject("pictureBox1.Image"); 129 | pictureBox1.Location = new Point(449, 12); 130 | pictureBox1.Name = "pictureBox1"; 131 | pictureBox1.Size = new Size(38, 31); 132 | pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; 133 | pictureBox1.TabIndex = 12; 134 | pictureBox1.TabStop = false; 135 | pictureBox1.Click += pictureBox1_Click; 136 | // 137 | // label4 138 | // 139 | label4.AutoSize = true; 140 | label4.BackColor = Color.Red; 141 | label4.Location = new Point(112, 274); 142 | label4.Name = "label4"; 143 | label4.Size = new Size(267, 25); 144 | label4.TabIndex = 13; 145 | label4.Text = "username or password not valid"; 146 | label4.Visible = false; 147 | // 148 | // login 149 | // 150 | AutoScaleDimensions = new SizeF(10F, 25F); 151 | AutoScaleMode = AutoScaleMode.Font; 152 | BackColor = Color.DarkSlateGray; 153 | ClientSize = new Size(509, 450); 154 | Controls.Add(label4); 155 | Controls.Add(pictureBox1); 156 | Controls.Add(button2); 157 | Controls.Add(label3); 158 | Controls.Add(button1); 159 | Controls.Add(label2); 160 | Controls.Add(label1); 161 | Controls.Add(textBox2); 162 | Controls.Add(textBox1); 163 | FormBorderStyle = FormBorderStyle.None; 164 | Name = "login"; 165 | Text = "Form1"; 166 | Load += login_Load; 167 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); 168 | ResumeLayout(false); 169 | PerformLayout(); 170 | } 171 | 172 | #endregion 173 | 174 | private Label label2; 175 | private Label label1; 176 | private TextBox textBox2; 177 | private TextBox textBox1; 178 | private Button button2; 179 | private Label label3; 180 | private Button button1; 181 | private PictureBox pictureBox1; 182 | private Label label4; 183 | } 184 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /WatchMovie/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\xbutton.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\dfdf.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\Web capture_26-7-2023_63958_watchmovieshd.ru.jpeg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\93-938050_png-file-transparent-white-user-icon-png-download.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\Screenshot 2023-07-28 155531.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\sds.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\logo2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\likepic.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | -------------------------------------------------------------------------------- /Core/Migrations/20230803070507_initial.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; 3 | 4 | #nullable disable 5 | 6 | #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional 7 | 8 | namespace Core.Migrations 9 | { 10 | /// 11 | public partial class initial : Migration 12 | { 13 | /// 14 | protected override void Up(MigrationBuilder migrationBuilder) 15 | { 16 | migrationBuilder.CreateTable( 17 | name: "achives", 18 | columns: table => new 19 | { 20 | Id = table.Column(type: "integer", nullable: false) 21 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 22 | Name = table.Column(type: "text", nullable: false), 23 | Description = table.Column(type: "text", nullable: false), 24 | FilmId = table.Column(type: "integer", nullable: false) 25 | }, 26 | constraints: table => 27 | { 28 | table.PrimaryKey("PK_achives", x => x.Id); 29 | }); 30 | 31 | migrationBuilder.CreateTable( 32 | name: "Films", 33 | columns: table => new 34 | { 35 | Id = table.Column(type: "integer", nullable: false) 36 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 37 | Name = table.Column(type: "text", nullable: false), 38 | Genre = table.Column(type: "text", nullable: false), 39 | Year = table.Column(type: "text", nullable: false), 40 | Producer = table.Column(type: "text", nullable: false), 41 | Country = table.Column(type: "text", nullable: false), 42 | Duration = table.Column(type: "text", nullable: false), 43 | Type = table.Column(type: "text", nullable: false) 44 | }, 45 | constraints: table => 46 | { 47 | table.PrimaryKey("PK_Films", x => x.Id); 48 | }); 49 | 50 | migrationBuilder.CreateTable( 51 | name: "User", 52 | columns: table => new 53 | { 54 | Id = table.Column(type: "integer", nullable: false) 55 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 56 | FirstName = table.Column(type: "text", nullable: false), 57 | LastName = table.Column(type: "text", nullable: false), 58 | UserName = table.Column(type: "text", nullable: false), 59 | email = table.Column(type: "text", nullable: false), 60 | password = table.Column(type: "text", nullable: false) 61 | }, 62 | constraints: table => 63 | { 64 | table.PrimaryKey("PK_User", x => x.Id); 65 | }); 66 | 67 | migrationBuilder.CreateTable( 68 | name: "LikedFilms", 69 | columns: table => new 70 | { 71 | Id = table.Column(type: "integer", nullable: false) 72 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 73 | FilmId = table.Column(type: "integer", nullable: false), 74 | userid = table.Column(type: "integer", nullable: false) 75 | }, 76 | constraints: table => 77 | { 78 | table.PrimaryKey("PK_LikedFilms", x => x.Id); 79 | table.ForeignKey( 80 | name: "FK_LikedFilms_Films_FilmId", 81 | column: x => x.FilmId, 82 | principalTable: "Films", 83 | principalColumn: "Id", 84 | onDelete: ReferentialAction.Cascade); 85 | table.ForeignKey( 86 | name: "FK_LikedFilms_User_userid", 87 | column: x => x.userid, 88 | principalTable: "User", 89 | principalColumn: "Id", 90 | onDelete: ReferentialAction.Cascade); 91 | }); 92 | 93 | migrationBuilder.CreateTable( 94 | name: "Viewedfilms", 95 | columns: table => new 96 | { 97 | Id = table.Column(type: "integer", nullable: false) 98 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 99 | FilmId = table.Column(type: "integer", nullable: false), 100 | userid = table.Column(type: "integer", nullable: false), 101 | UsersId = table.Column(type: "integer", nullable: false) 102 | }, 103 | constraints: table => 104 | { 105 | table.PrimaryKey("PK_Viewedfilms", x => x.Id); 106 | table.ForeignKey( 107 | name: "FK_Viewedfilms_Films_FilmId", 108 | column: x => x.FilmId, 109 | principalTable: "Films", 110 | principalColumn: "Id", 111 | onDelete: ReferentialAction.Cascade); 112 | table.ForeignKey( 113 | name: "FK_Viewedfilms_User_UsersId", 114 | column: x => x.UsersId, 115 | principalTable: "User", 116 | principalColumn: "Id", 117 | onDelete: ReferentialAction.Cascade); 118 | }); 119 | 120 | migrationBuilder.InsertData( 121 | table: "Films", 122 | columns: new[] { "Id", "Country", "Duration", "Genre", "Name", "Producer", "Type", "Year" }, 123 | values: new object[,] 124 | { 125 | { 1, "usa", "142 min", "drama", "the shawshank redemption", "frank darabont", "movie", "1994" }, 126 | { 2, "USA", "175 min ", "Crime", "The Godfather", "Francis Ford Coppola", "movie", "1972" }, 127 | { 3, "USA", "148 min", "Fantastic", "Inception", "Christopher Nolan", "movie", "2010" } 128 | }); 129 | 130 | migrationBuilder.InsertData( 131 | table: "User", 132 | columns: new[] { "Id", "FirstName", "LastName", "UserName", "email", "password" }, 133 | values: new object[,] 134 | { 135 | { 3, "John", "Doe", "user123", "user123@email.com", "secure_password123" }, 136 | { 4, "Jane", "Smith", "movie_lover", "movie_lover@email.com", "strong_pass_456" } 137 | }); 138 | 139 | migrationBuilder.InsertData( 140 | table: "achives", 141 | columns: new[] { "Id", "Description", "FilmId", "Name" }, 142 | values: new object[,] 143 | { 144 | { 1, "Awarded for outstanding achievements in the film industry.", 0, "Academy" }, 145 | { 2, "Recognizes excellence in film and television.", 0, "GoldenGlobe" }, 146 | { 3, "Recognizes excellence in film and television.", 0, "Oscar" } 147 | }); 148 | 149 | migrationBuilder.CreateIndex( 150 | name: "IX_LikedFilms_FilmId", 151 | table: "LikedFilms", 152 | column: "FilmId"); 153 | 154 | migrationBuilder.CreateIndex( 155 | name: "IX_LikedFilms_userid", 156 | table: "LikedFilms", 157 | column: "userid"); 158 | 159 | migrationBuilder.CreateIndex( 160 | name: "IX_Viewedfilms_FilmId", 161 | table: "Viewedfilms", 162 | column: "FilmId"); 163 | 164 | migrationBuilder.CreateIndex( 165 | name: "IX_Viewedfilms_UsersId", 166 | table: "Viewedfilms", 167 | column: "UsersId"); 168 | } 169 | 170 | /// 171 | protected override void Down(MigrationBuilder migrationBuilder) 172 | { 173 | migrationBuilder.DropTable( 174 | name: "achives"); 175 | 176 | migrationBuilder.DropTable( 177 | name: "LikedFilms"); 178 | 179 | migrationBuilder.DropTable( 180 | name: "Viewedfilms"); 181 | 182 | migrationBuilder.DropTable( 183 | name: "Films"); 184 | 185 | migrationBuilder.DropTable( 186 | name: "User"); 187 | } 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /WatchMovie/adminpanel.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class adminpanel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | textBox1 = new TextBox(); 32 | textBox3 = new TextBox(); 33 | textBox4 = new TextBox(); 34 | textBox5 = new TextBox(); 35 | checkedListBox1 = new CheckedListBox(); 36 | button1 = new Button(); 37 | button4 = new Button(); 38 | comboBox1 = new ComboBox(); 39 | textBox13 = new TextBox(); 40 | textBox16 = new TextBox(); 41 | button5 = new Button(); 42 | textBox17 = new TextBox(); 43 | button2 = new Button(); 44 | textBox2 = new TextBox(); 45 | button3 = new Button(); 46 | SuspendLayout(); 47 | // 48 | // textBox1 49 | // 50 | textBox1.Location = new Point(190, 66); 51 | textBox1.Multiline = true; 52 | textBox1.Name = "textBox1"; 53 | textBox1.Size = new Size(294, 33); 54 | textBox1.TabIndex = 0; 55 | textBox1.TextChanged += textBox1_TextChanged; 56 | // 57 | // textBox3 58 | // 59 | textBox3.Location = new Point(190, 283); 60 | textBox3.Multiline = true; 61 | textBox3.Name = "textBox3"; 62 | textBox3.Size = new Size(131, 46); 63 | textBox3.TabIndex = 2; 64 | textBox3.TextChanged += textBox3_TextChanged; 65 | // 66 | // textBox4 67 | // 68 | textBox4.Location = new Point(190, 374); 69 | textBox4.Multiline = true; 70 | textBox4.Name = "textBox4"; 71 | textBox4.Size = new Size(294, 46); 72 | textBox4.TabIndex = 3; 73 | textBox4.TextChanged += textBox4_TextChanged; 74 | // 75 | // textBox5 76 | // 77 | textBox5.Location = new Point(190, 450); 78 | textBox5.Multiline = true; 79 | textBox5.Name = "textBox5"; 80 | textBox5.Size = new Size(294, 46); 81 | textBox5.TabIndex = 4; 82 | textBox5.TextChanged += textBox5_TextChanged; 83 | // 84 | // checkedListBox1 85 | // 86 | checkedListBox1.FormattingEnabled = true; 87 | checkedListBox1.Location = new Point(190, 114); 88 | checkedListBox1.Name = "checkedListBox1"; 89 | checkedListBox1.Size = new Size(294, 144); 90 | checkedListBox1.TabIndex = 5; 91 | checkedListBox1.SelectedIndexChanged += checkedListBox1_SelectedIndexChanged; 92 | // 93 | // button1 94 | // 95 | button1.ForeColor = Color.Black; 96 | button1.Location = new Point(190, 685); 97 | button1.Name = "button1"; 98 | button1.Size = new Size(294, 54); 99 | button1.TabIndex = 6; 100 | button1.Text = "Add movie"; 101 | button1.UseVisualStyleBackColor = true; 102 | button1.Click += button1_Click; 103 | // 104 | // button4 105 | // 106 | button4.ForeColor = Color.Black; 107 | button4.Location = new Point(12, 980); 108 | button4.Name = "button4"; 109 | button4.Size = new Size(147, 48); 110 | button4.TabIndex = 21; 111 | button4.Text = "home"; 112 | button4.UseVisualStyleBackColor = true; 113 | button4.Click += button4_Click; 114 | // 115 | // comboBox1 116 | // 117 | comboBox1.FormattingEnabled = true; 118 | comboBox1.Location = new Point(190, 27); 119 | comboBox1.Name = "comboBox1"; 120 | comboBox1.Size = new Size(294, 33); 121 | comboBox1.TabIndex = 22; 122 | comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; 123 | // 124 | // textBox13 125 | // 126 | textBox13.Location = new Point(190, 529); 127 | textBox13.Multiline = true; 128 | textBox13.Name = "textBox13"; 129 | textBox13.Size = new Size(294, 46); 130 | textBox13.TabIndex = 23; 131 | textBox13.TextChanged += textBox13_TextChanged; 132 | // 133 | // textBox16 134 | // 135 | textBox16.Location = new Point(571, 27); 136 | textBox16.Multiline = true; 137 | textBox16.Name = "textBox16"; 138 | textBox16.Size = new Size(228, 46); 139 | textBox16.TabIndex = 35; 140 | textBox16.TextChanged += textBox16_TextChanged; 141 | // 142 | // button5 143 | // 144 | button5.ForeColor = Color.Black; 145 | button5.Location = new Point(571, 107); 146 | button5.Name = "button5"; 147 | button5.Size = new Size(228, 44); 148 | button5.TabIndex = 36; 149 | button5.Text = "delete movie"; 150 | button5.UseVisualStyleBackColor = true; 151 | button5.Click += button5_Click; 152 | // 153 | // textBox17 154 | // 155 | textBox17.Location = new Point(190, 609); 156 | textBox17.Multiline = true; 157 | textBox17.Name = "textBox17"; 158 | textBox17.Size = new Size(294, 46); 159 | textBox17.TabIndex = 37; 160 | textBox17.TextChanged += textBox17_TextChanged; 161 | // 162 | // button2 163 | // 164 | button2.ForeColor = Color.Black; 165 | button2.Location = new Point(858, 107); 166 | button2.Name = "button2"; 167 | button2.Size = new Size(228, 44); 168 | button2.TabIndex = 39; 169 | button2.Text = "delete User"; 170 | button2.UseVisualStyleBackColor = true; 171 | button2.Click += button2_Click_1; 172 | // 173 | // textBox2 174 | // 175 | textBox2.Location = new Point(858, 27); 176 | textBox2.Multiline = true; 177 | textBox2.Name = "textBox2"; 178 | textBox2.Size = new Size(228, 46); 179 | textBox2.TabIndex = 38; 180 | textBox2.TextChanged += textBox2_TextChanged_1; 181 | // 182 | // button3 183 | // 184 | button3.ForeColor = Color.Black; 185 | button3.Location = new Point(858, 265); 186 | button3.Name = "button3"; 187 | button3.Size = new Size(112, 34); 188 | button3.TabIndex = 40; 189 | button3.Text = "homepage"; 190 | button3.UseVisualStyleBackColor = true; 191 | button3.Click += button3_Click_2; 192 | // 193 | // adminpanel 194 | // 195 | AutoScaleDimensions = new SizeF(10F, 25F); 196 | AutoScaleMode = AutoScaleMode.Font; 197 | BackColor = Color.Black; 198 | ClientSize = new Size(1456, 1050); 199 | Controls.Add(button3); 200 | Controls.Add(button2); 201 | Controls.Add(textBox2); 202 | Controls.Add(textBox17); 203 | Controls.Add(button5); 204 | Controls.Add(textBox16); 205 | Controls.Add(textBox13); 206 | Controls.Add(comboBox1); 207 | Controls.Add(button4); 208 | Controls.Add(button1); 209 | Controls.Add(checkedListBox1); 210 | Controls.Add(textBox5); 211 | Controls.Add(textBox4); 212 | Controls.Add(textBox3); 213 | Controls.Add(textBox1); 214 | ForeColor = Color.White; 215 | Name = "adminpanel"; 216 | Text = "adminpanel"; 217 | Load += adminpanel_Load; 218 | ResumeLayout(false); 219 | PerformLayout(); 220 | } 221 | 222 | #endregion 223 | 224 | private TextBox textBox1; 225 | private TextBox textBox3; 226 | private TextBox textBox4; 227 | private TextBox textBox5; 228 | private CheckedListBox checkedListBox1; 229 | private Button button1; 230 | private Button button4; 231 | private ComboBox comboBox1; 232 | private TextBox textBox13; 233 | private TextBox textBox16; 234 | private Button button5; 235 | private TextBox textBox17; 236 | private Button button2; 237 | private TextBox textBox2; 238 | public Button button3; 239 | } 240 | } -------------------------------------------------------------------------------- /WatchMovie/Migrations/20230801070249_ee.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; 3 | 4 | #nullable disable 5 | 6 | namespace WatchMovie.Migrations 7 | { 8 | /// 9 | public partial class ee : Migration 10 | { 11 | /// 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.CreateTable( 15 | name: "achives", 16 | columns: table => new 17 | { 18 | AchivementId = table.Column(type: "integer", nullable: false) 19 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 20 | Name = table.Column(type: "text", nullable: false), 21 | Description = table.Column(type: "text", nullable: false) 22 | }, 23 | constraints: table => 24 | { 25 | table.PrimaryKey("PK_achives", x => x.AchivementId); 26 | }); 27 | 28 | migrationBuilder.CreateTable( 29 | name: "durations", 30 | columns: table => new 31 | { 32 | durationId = table.Column(type: "integer", nullable: false) 33 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 34 | minute = table.Column(type: "integer", nullable: true), 35 | minut_per_episede = table.Column(type: "integer", nullable: true), 36 | season = table.Column(type: "integer", nullable: true), 37 | episode = table.Column(type: "integer", nullable: true) 38 | }, 39 | constraints: table => 40 | { 41 | table.PrimaryKey("PK_durations", x => x.durationId); 42 | }); 43 | 44 | migrationBuilder.CreateTable( 45 | name: "User", 46 | columns: table => new 47 | { 48 | Id = table.Column(type: "integer", nullable: false) 49 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 50 | FirstName = table.Column(type: "text", nullable: false), 51 | LastName = table.Column(type: "text", nullable: false), 52 | UserName = table.Column(type: "text", nullable: false), 53 | email = table.Column(type: "text", nullable: false), 54 | password = table.Column(type: "text", nullable: false) 55 | }, 56 | constraints: table => 57 | { 58 | table.PrimaryKey("PK_User", x => x.Id); 59 | }); 60 | 61 | migrationBuilder.CreateTable( 62 | name: "Achivements", 63 | columns: table => new 64 | { 65 | AchivementsId = table.Column(type: "integer", nullable: false) 66 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 67 | FilmId = table.Column(type: "integer", nullable: false), 68 | AchivementId = table.Column(type: "integer", nullable: false), 69 | year = table.Column(type: "integer", nullable: false) 70 | }, 71 | constraints: table => 72 | { 73 | table.PrimaryKey("PK_Achivements", x => x.AchivementsId); 74 | table.ForeignKey( 75 | name: "FK_Achivements_achives_AchivementId", 76 | column: x => x.AchivementId, 77 | principalTable: "achives", 78 | principalColumn: "AchivementId", 79 | onDelete: ReferentialAction.Cascade); 80 | }); 81 | 82 | migrationBuilder.CreateTable( 83 | name: "films", 84 | columns: table => new 85 | { 86 | FilmId = table.Column(type: "integer", nullable: false) 87 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 88 | name = table.Column(type: "text", nullable: false), 89 | year = table.Column(type: "integer", nullable: false), 90 | producer = table.Column(type: "text", nullable: false), 91 | country = table.Column(type: "text", nullable: false), 92 | durationId = table.Column(type: "integer", nullable: false), 93 | type = table.Column(type: "integer", nullable: false) 94 | }, 95 | constraints: table => 96 | { 97 | table.PrimaryKey("PK_films", x => x.FilmId); 98 | table.ForeignKey( 99 | name: "FK_films_durations_durationId", 100 | column: x => x.durationId, 101 | principalTable: "durations", 102 | principalColumn: "durationId", 103 | onDelete: ReferentialAction.Cascade); 104 | }); 105 | 106 | migrationBuilder.CreateTable( 107 | name: "LikedFilms", 108 | columns: table => new 109 | { 110 | Id = table.Column(type: "integer", nullable: false) 111 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 112 | FilmId = table.Column(type: "integer", nullable: false), 113 | userid = table.Column(type: "integer", nullable: false), 114 | usersId = table.Column(type: "integer", nullable: false) 115 | }, 116 | constraints: table => 117 | { 118 | table.PrimaryKey("PK_LikedFilms", x => x.Id); 119 | table.ForeignKey( 120 | name: "FK_LikedFilms_User_usersId", 121 | column: x => x.usersId, 122 | principalTable: "User", 123 | principalColumn: "Id", 124 | onDelete: ReferentialAction.Cascade); 125 | table.ForeignKey( 126 | name: "FK_LikedFilms_films_FilmId", 127 | column: x => x.FilmId, 128 | principalTable: "films", 129 | principalColumn: "FilmId", 130 | onDelete: ReferentialAction.Cascade); 131 | }); 132 | 133 | migrationBuilder.CreateTable( 134 | name: "Viewedfilms", 135 | columns: table => new 136 | { 137 | Id = table.Column(type: "integer", nullable: false) 138 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), 139 | FilmId = table.Column(type: "integer", nullable: false), 140 | userid = table.Column(type: "integer", nullable: false), 141 | usersId = table.Column(type: "integer", nullable: false) 142 | }, 143 | constraints: table => 144 | { 145 | table.PrimaryKey("PK_Viewedfilms", x => x.Id); 146 | table.ForeignKey( 147 | name: "FK_Viewedfilms_User_usersId", 148 | column: x => x.usersId, 149 | principalTable: "User", 150 | principalColumn: "Id", 151 | onDelete: ReferentialAction.Cascade); 152 | table.ForeignKey( 153 | name: "FK_Viewedfilms_films_FilmId", 154 | column: x => x.FilmId, 155 | principalTable: "films", 156 | principalColumn: "FilmId", 157 | onDelete: ReferentialAction.Cascade); 158 | }); 159 | 160 | migrationBuilder.CreateIndex( 161 | name: "IX_Achivements_AchivementId", 162 | table: "Achivements", 163 | column: "AchivementId"); 164 | 165 | migrationBuilder.CreateIndex( 166 | name: "IX_films_durationId", 167 | table: "films", 168 | column: "durationId"); 169 | 170 | migrationBuilder.CreateIndex( 171 | name: "IX_LikedFilms_FilmId", 172 | table: "LikedFilms", 173 | column: "FilmId"); 174 | 175 | migrationBuilder.CreateIndex( 176 | name: "IX_LikedFilms_usersId", 177 | table: "LikedFilms", 178 | column: "usersId"); 179 | 180 | migrationBuilder.CreateIndex( 181 | name: "IX_Viewedfilms_FilmId", 182 | table: "Viewedfilms", 183 | column: "FilmId"); 184 | 185 | migrationBuilder.CreateIndex( 186 | name: "IX_Viewedfilms_usersId", 187 | table: "Viewedfilms", 188 | column: "usersId"); 189 | } 190 | 191 | /// 192 | protected override void Down(MigrationBuilder migrationBuilder) 193 | { 194 | migrationBuilder.DropTable( 195 | name: "Achivements"); 196 | 197 | migrationBuilder.DropTable( 198 | name: "LikedFilms"); 199 | 200 | migrationBuilder.DropTable( 201 | name: "Viewedfilms"); 202 | 203 | migrationBuilder.DropTable( 204 | name: "achives"); 205 | 206 | migrationBuilder.DropTable( 207 | name: "User"); 208 | 209 | migrationBuilder.DropTable( 210 | name: "films"); 211 | 212 | migrationBuilder.DropTable( 213 | name: "durations"); 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /WatchMovie/homepage.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WatchMovie 2 | { 3 | partial class homepage 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | label1 = new Label(); 32 | label2 = new Label(); 33 | label3 = new Label(); 34 | textBox1 = new TextBox(); 35 | button1 = new Button(); 36 | flowLayoutPanel1 = new FlowLayoutPanel(); 37 | button2 = new Button(); 38 | button3 = new Button(); 39 | label4 = new Label(); 40 | label5 = new Label(); 41 | dataGridView1 = new DataGridView(); 42 | button4 = new Button(); 43 | label6 = new Label(); 44 | label9 = new Label(); 45 | pictureBox1 = new PictureBox(); 46 | ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); 47 | ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); 48 | SuspendLayout(); 49 | // 50 | // label1 51 | // 52 | label1.BackColor = Color.Transparent; 53 | label1.Font = new Font("Segoe UI Black", 12F, FontStyle.Bold, GraphicsUnit.Point); 54 | label1.Location = new Point(12, 9); 55 | label1.Name = "label1"; 56 | label1.Size = new Size(254, 69); 57 | label1.TabIndex = 0; 58 | label1.Text = " "; 59 | label1.Click += label1_Click; 60 | // 61 | // label2 62 | // 63 | label2.BackColor = Color.Transparent; 64 | label2.Font = new Font("Segoe UI Black", 12F, FontStyle.Bold, GraphicsUnit.Point); 65 | label2.Location = new Point(1656, 9); 66 | label2.Name = "label2"; 67 | label2.Size = new Size(254, 69); 68 | label2.TabIndex = 1; 69 | label2.Text = " "; 70 | // 71 | // label3 72 | // 73 | label3.BackColor = Color.Transparent; 74 | label3.Location = new Point(1532, 22); 75 | label3.Name = "label3"; 76 | label3.Size = new Size(45, 43); 77 | label3.TabIndex = 2; 78 | label3.Text = " "; 79 | label3.Click += label3_Click; 80 | // 81 | // textBox1 82 | // 83 | textBox1.Anchor = AnchorStyles.Bottom; 84 | textBox1.BackColor = Color.FromArgb(19, 22, 21); 85 | textBox1.BorderStyle = BorderStyle.None; 86 | textBox1.Font = new Font("Segoe UI", 12F, FontStyle.Bold, GraphicsUnit.Point); 87 | textBox1.ForeColor = SystemColors.Menu; 88 | textBox1.Location = new Point(282, 104); 89 | textBox1.Multiline = true; 90 | textBox1.Name = "textBox1"; 91 | textBox1.PlaceholderText = " Search movies ..."; 92 | textBox1.Size = new Size(1091, 44); 93 | textBox1.TabIndex = 4; 94 | textBox1.TextChanged += textBox1_TextChanged; 95 | // 96 | // button1 97 | // 98 | button1.BackColor = Color.FromArgb(31, 208, 185); 99 | button1.Location = new Point(390, 445); 100 | button1.Name = "button1"; 101 | button1.Size = new Size(877, 54); 102 | button1.TabIndex = 5; 103 | button1.Text = "go to the homepage"; 104 | button1.UseVisualStyleBackColor = false; 105 | button1.Click += button1_Click_1; 106 | // 107 | // flowLayoutPanel1 108 | // 109 | flowLayoutPanel1.Dock = DockStyle.Left; 110 | flowLayoutPanel1.Location = new Point(0, 0); 111 | flowLayoutPanel1.Name = "flowLayoutPanel1"; 112 | flowLayoutPanel1.Size = new Size(64, 839); 113 | flowLayoutPanel1.TabIndex = 6; 114 | // 115 | // button2 116 | // 117 | button2.Location = new Point(1504, 124); 118 | button2.Name = "button2"; 119 | button2.Size = new Size(112, 34); 120 | button2.TabIndex = 9; 121 | button2.Text = "search"; 122 | button2.UseVisualStyleBackColor = true; 123 | button2.Click += button2_Click; 124 | // 125 | // button3 126 | // 127 | button3.Location = new Point(1695, 124); 128 | button3.Name = "button3"; 129 | button3.Size = new Size(122, 34); 130 | button3.TabIndex = 10; 131 | button3.Text = "search"; 132 | button3.UseVisualStyleBackColor = true; 133 | button3.Click += button3_Click; 134 | // 135 | // label4 136 | // 137 | label4.BackColor = Color.Transparent; 138 | label4.Location = new Point(390, 795); 139 | label4.Name = "label4"; 140 | label4.Size = new Size(88, 38); 141 | label4.TabIndex = 11; 142 | label4.Click += label4_Click; 143 | // 144 | // label5 145 | // 146 | label5.BackColor = Color.Transparent; 147 | label5.Location = new Point(1583, 27); 148 | label5.Name = "label5"; 149 | label5.Size = new Size(52, 38); 150 | label5.TabIndex = 12; 151 | label5.Click += label5_Click; 152 | // 153 | // dataGridView1 154 | // 155 | dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; 156 | dataGridView1.Location = new Point(282, 205); 157 | dataGridView1.Name = "dataGridView1"; 158 | dataGridView1.RowHeadersWidth = 62; 159 | dataGridView1.RowTemplate.Height = 33; 160 | dataGridView1.Size = new Size(1091, 248); 161 | dataGridView1.TabIndex = 13; 162 | dataGridView1.CellContentClick += dataGridView1_CellContentClick; 163 | // 164 | // button4 165 | // 166 | button4.Location = new Point(697, 172); 167 | button4.Name = "button4"; 168 | button4.Size = new Size(193, 34); 169 | button4.TabIndex = 14; 170 | button4.Text = "search"; 171 | button4.UseVisualStyleBackColor = true; 172 | button4.Click += button4_Click; 173 | // 174 | // label6 175 | // 176 | label6.AutoSize = true; 177 | label6.BackColor = Color.Green; 178 | label6.Location = new Point(1498, 96); 179 | label6.Name = "label6"; 180 | label6.Size = new Size(137, 25); 181 | label6.TabIndex = 15; 182 | label6.Text = "search by genre"; 183 | // 184 | // label9 185 | // 186 | label9.AutoSize = true; 187 | label9.BackColor = Color.Green; 188 | label9.Location = new Point(1690, 96); 189 | label9.Name = "label9"; 190 | label9.Size = new Size(127, 25); 191 | label9.TabIndex = 16; 192 | label9.Text = "search by type"; 193 | // 194 | // pictureBox1 195 | // 196 | pictureBox1.BackColor = Color.Transparent; 197 | pictureBox1.Image = Properties.Resources.likepic; 198 | pictureBox1.Location = new Point(1379, 205); 199 | pictureBox1.Name = "pictureBox1"; 200 | pictureBox1.Size = new Size(47, 41); 201 | pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; 202 | pictureBox1.TabIndex = 17; 203 | pictureBox1.TabStop = false; 204 | pictureBox1.Click += pictureBox1_Click_1; 205 | // 206 | // homepage 207 | // 208 | AutoScaleDimensions = new SizeF(10F, 25F); 209 | AutoScaleMode = AutoScaleMode.Font; 210 | BackgroundImage = Properties.Resources.Web_capture_26_7_2023_63958_watchmovieshd_ru; 211 | ClientSize = new Size(1907, 839); 212 | Controls.Add(pictureBox1); 213 | Controls.Add(label9); 214 | Controls.Add(label6); 215 | Controls.Add(button4); 216 | Controls.Add(dataGridView1); 217 | Controls.Add(label5); 218 | Controls.Add(label4); 219 | Controls.Add(button3); 220 | Controls.Add(button2); 221 | Controls.Add(flowLayoutPanel1); 222 | Controls.Add(button1); 223 | Controls.Add(textBox1); 224 | Controls.Add(label3); 225 | Controls.Add(label2); 226 | Controls.Add(label1); 227 | Name = "homepage"; 228 | Load += homepage_Load; 229 | ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); 230 | ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); 231 | ResumeLayout(false); 232 | PerformLayout(); 233 | } 234 | 235 | #endregion 236 | 237 | private Label label1; 238 | private Label label2; 239 | private Label label3; 240 | private TextBox textBox1; 241 | private Button button1; 242 | private FlowLayoutPanel flowLayoutPanel1; 243 | private Button button2; 244 | private Button button3; 245 | private Label label4; 246 | private Label label5; 247 | private DataGridView dataGridView1; 248 | private Button button4; 249 | private Label label6; 250 | private Label label9; 251 | private PictureBox pictureBox1; 252 | } 253 | } --------------------------------------------------------------------------------