Exemple #1
0
        private void ButtonMainMenuOpen_Click(object sender, RoutedEventArgs e)
        {
            MainMenuxaml mainMenuxaml = new MainMenuxaml(win);

            win.Close();
            mainMenuxaml.Show();
        }
Exemple #2
0
        public CardItemExhibition(MainMenuxaml win, Exhibition exhibition)
        {
            this.win = win;
            InitializeComponent();
            Uri urislide1 = new Uri(exhibition.Image_Main, UriKind.RelativeOrAbsolute);

            this.MainImageExhibition.Source = BitmapFrame.Create(urislide1);
            this.EventNameExhibition.Text   = exhibition.Name ?? "";

            if (exhibition.Address != null)
            {
                if (!exhibition.Address.Equals(""))
                {
                    if (exhibition.Address[0] == ' ')
                    {
                        exhibition.Address = exhibition.Address.Remove(0, 1);
                    }
                }
                this.PlaceExhibition.Text = exhibition.Address + "\n";
            }
            if (exhibition.Event_Date != null && !exhibition.Event_Date.Equals(""))
            {
                this.TimetableExhibition.Text = exhibition.Event_Date;
            }
            this.exhibition = exhibition;
        }
Exemple #3
0
        public CardItemConcert(MainMenuxaml win, Concert concert)
        {
            this.win = win;
            InitializeComponent();
            Uri urislide1 = new Uri(concert.Image_Main, UriKind.RelativeOrAbsolute);

            this.MainImageConcert.Source = BitmapFrame.Create(urislide1);
            this.EventNameConcert.Text   = concert.Name ?? "";
            foreach (string s in FilmHandler.GetListOfGenres(concert.Genre))
            {
                if (s == FilmHandler.GetListOfGenres(concert.Genre).Last())
                {
                    this.GenreConcert.Text += s;
                    break;
                }
                this.GenreConcert.Text += s + ", ";
            }
            if (concert.Address != null)
            {
                if (!concert.Address.Equals(""))
                {
                    if (concert.Address[0] == ' ')
                    {
                        concert.Address = concert.Address.Remove(0, 1);
                    }
                }
                this.PlaceCocert.Text = concert.Address + "\n";
            }
            if (concert.Event_Date != null && !concert.Event_Date.Equals(""))
            {
                this.TimetableConcert.Text = concert.Event_Date;
            }
            this.concert = concert;
        }
        public CardItemCinema(MainMenuxaml win, Cinema cinema)
        {
            this.win = win;
            InitializeComponent();

            this.PlaceNameCinema.Text = cinema.Name ?? "";
            this.PlaceCinama.Text     = cinema.Address ?? "";
            this.cinema = cinema;
        }
        public CardItemMoreInfoCinema(MainMenuxaml win, Cinema cinema)
        {
            //this.win = win;
            //InitializeComponent();

            //Uri urislide1 = new Uri(film.Image_Main, UriKind.RelativeOrAbsolute);
            //this.CardInfoMainImg.Source = BitmapFrame.Create(urislide1);

            //if (film.Images != "")
            //{
            //    foreach (string s in FilmHandler.GetListOfImages(film.Images))
            //    {
            //        Uri urislide = new Uri(s, UriKind.RelativeOrAbsolute);
            //        Image image = new Image
            //        {

            //            Source = BitmapFrame.Create(urislide),
            //            Margin = new Thickness(0, 3, 7, 3),
            //            Height = 200,
            //            Focusable = true

            //        };
            //        this.Images.Children.Add(image);
            //    }
            //}
            //this.EventNameCardMoreInfo.Text = film.Name;
            //List<string> list = FilmHandler.GetListOfGenres(film.Genre);
            //foreach (string s in list)
            //{
            //    if (s == list.Last())
            //    {
            //        this.GenresCardMoreInfo.Text += s;
            //        break;
            //    }
            //    this.GenresCardMoreInfo.Text += s + ", ";
            //}
            //if (film.Country != null)
            //{
            //    if (!film.Country.Equals(""))
            //    {
            //        if (film.Country[0] == ' ')
            //        {
            //            film.Country = film.Country.Remove(0, 1);
            //        }
            //    }
            //    this.YearCardMoreInfo.Text = film.Year;
            //}
            //this.CountryCardMoreInfo.Text = film.Country;
            //this.DescriptionCardMoreInfo.Text = film.Info;
            //this.BoxOfficeCardMoreInfo.Text = film.Date;
            //this.RatingCardMoreInfo.Text = film.Rating;
            //this.TimeCardMoreInfo.Text = film.Duration;
        }
Exemple #6
0
        public CardItemMoreInfo(MainMenuxaml win, Film film)
        {
            this.win = win;
            InitializeComponent();

            Uri urislide1 = new Uri(film.Image_Main, UriKind.RelativeOrAbsolute);

            this.CardInfoMainImg.Source = BitmapFrame.Create(urislide1);

            if (film.Images != "")
            {
                foreach (string s in FilmHandler.GetListOfImages(film.Images))
                {
                    Uri   urislide = new Uri(s, UriKind.RelativeOrAbsolute);
                    Image image    = new Image
                    {
                        Source    = BitmapFrame.Create(urislide),
                        Margin    = new Thickness(0, 3, 7, 3),
                        Height    = 200,
                        Focusable = true
                    };
                    this.Images.Children.Add(image);
                }
            }
            this.EventNameCardMoreInfo.Text = film.Name;
            List <string> list = FilmHandler.GetListOfGenres(film.Genre);

            foreach (string s in list)
            {
                if (s == list.Last())
                {
                    this.GenresCardMoreInfo.Text += s;
                    break;
                }
                this.GenresCardMoreInfo.Text += s + ", ";
            }
            if (film.Country != null)
            {
                if (!film.Country.Equals(""))
                {
                    if (film.Country[0] == ' ')
                    {
                        film.Country = film.Country.Remove(0, 1);
                    }
                }
                this.YearCardMoreInfo.Text = film.Year;
            }
            this.CountryCardMoreInfo.Text     = film.Country;
            this.DescriptionCardMoreInfo.Text = film.Info;
            this.BoxOfficeCardMoreInfo.Text   = film.Date;
            this.RatingCardMoreInfo.Text      = film.Rating;
            this.TimeCardMoreInfo.Text        = film.Duration;
        }
Exemple #7
0
        public CardItem(MainWindow mwin, MainMenuxaml win, Film film)
        {
            this.mainWindow = mwin;
            this.win        = win;
            InitializeComponent();
            Uri urislide1 = new Uri(film.Image_Main, UriKind.RelativeOrAbsolute);

            this.MainImage.Source = BitmapFrame.Create(urislide1);
            this.EventName.Text   = film.Name;
            if (!film.Genre.Equals(""))
            {
                foreach (string s in FilmHandler.GetListOfGenres(film.Genre))
                {
                    if (s == FilmHandler.GetListOfGenres(film.Genre).Last())
                    {
                        this.Genre.Text += s;
                        break;
                    }
                    this.Genre.Text += s + ", ";
                }
            }
            else
            {
                this.Genre.Visibility = Visibility.Collapsed;
            }

            if (!film.Country.Equals(""))
            {
                if (film.Country[0] == ' ')
                {
                    film.Country = film.Country.Remove(0, 1);
                }
                this.CountryAndYear.Text = film.Country + " " + film.Year;
            }
            else
            {
                this.CountryAndYear.Visibility = Visibility.Collapsed;
            }

            if (!film.Date.Equals(""))
            {
                this.BoxOffice.Text = film.Date;
            }
            else
            {
                this.BoxOffice.Visibility = Visibility.Collapsed;
            }
            this.film = film;
        }
Exemple #8
0
 public CommentReviewView(MainMenuxaml win, Comment comment)
 {
     this.win = win;
     InitializeComponent();
     //TextRange range = new TextRange(this.RichTextComment.Document.ContentStart, this.RichTextComment.Document.ContentEnd);
     if (comment.UserName.Length > 0 && comment.Text.Length > 0)
     {
         AuthorNameView.Text = comment.UserName;
         ThemeView.Text      = comment.Theme;
         PlaceView.Text      = comment.Place;
         TimeView.Text       = comment.Date;
         TextComment.Text    = comment.Text;
     }
     this.comment = comment;
 }
Exemple #9
0
        private void LogInBtn_Click(object sender, RoutedEventArgs e)
        {
            bool isLoginCorrect    = Model.MainWindow.CheckUserName(Username, Alert_Login);
            bool isPasswordCorrect = Model.MainWindow.CheckUserPassword(Password, Alert_Password);

            //List<User> users = new List<User>();
            this.mainMenuxaml = new MainMenuxaml(this.win);
            if (isLoginCorrect && isPasswordCorrect)
            {
                try
                {
                    User user = new User
                    {
                        UserName = Username.Text,
                        Password = Model.Validation.GetHashString(Password.Password)
                    };
                    Model.CurrentUser.user = user;

                    bool isUserFind = false;

                    foreach (User u in AsyncClient.users)
                    {
                        if (user.Password == u.Password && user.UserName == u.UserName)
                        {
                            isUserFind = true;
                            mainMenuxaml.UserNameMain.Content = user.UserName;
                            AsyncClient.SetUser(user);
                            win.flagautoriz = true;
                            win.Close();
                            mainMenuxaml.Show();
                        }
                    }
                    if (isUserFind == false)
                    {
                        MessageBox.Show("Проверьте корректность введённых данных");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemple #10
0
 public CommentReviewCreator(MainMenuxaml win)
 {
     this.win = win;
     InitializeComponent();
     AuthorName.Text = (string)win.UserNameMain.Content;
 }
Exemple #11
0
 public Search(MainMenuxaml win)
 {
     this.win = win;
     InitializeComponent();
 }
 public SignUpControl(MainWindow win)
 {
     this.win          = win;
     this.mainMenuxaml = new MainMenuxaml(win);
     InitializeComponent();
 }
Exemple #13
0
 public NotFound(MainMenuxaml win)
 {
     this.win = win;
     InitializeComponent();
 }