public SeasonalTicketStepTwoSingle(SeasonalTicketStepTwoViewModel viewModel)
        {
            InitializeComponent();
            this.viewModel = viewModel;
            string basePath      = System.IO.Path.GetFullPath(@"..\..\");
            Image  selectedImage = new Bitmap(basePath + "img\\background.png");

            this.BackgroundImage = selectedImage;

            label1.Text = "Linia: " + viewModel.LineType;
            label2.Text = "Okres: " + viewModel.TimeSpan;
            label3.Text = "Cena biletu: " + viewModel.TicketPrices.FirstOrDefault().ToString();

            var pos1 = this.PointToScreen(label1.Location);

            pos1             = pictureBox1.PointToClient(pos1);
            label1.Parent    = pictureBox1;
            label1.Location  = pos1;
            label1.BackColor = Color.Transparent;

            var pos2 = this.PointToScreen(label2.Location);

            pos2             = pictureBox1.PointToClient(pos2);
            label2.Parent    = pictureBox1;
            label2.Location  = pos2;
            label2.BackColor = Color.Transparent;

            var pos3 = this.PointToScreen(label3.Location);

            pos3             = pictureBox1.PointToClient(pos3);
            label3.Parent    = pictureBox1;
            label3.Location  = pos3;
            label3.BackColor = Color.Transparent;

            var pos4 = this.PointToScreen(label4.Location);

            pos4             = pictureBox1.PointToClient(pos4);
            label4.Parent    = pictureBox1;
            label4.Location  = pos4;
            label4.BackColor = Color.Transparent;
        }
        private void goToStep2()
        {
            var step2ViewModel = new SeasonalTicketStepTwoViewModel(lineTypeNumber, timeSpanNumber);

            Close();
            if (step2ViewModel.TicketPrices.Count == 1)
            {
                var step2 = new SeasonalTicketStepTwoSingle(step2ViewModel);
                step2.Show();
            }
            else if (timeSpanNumber == 0)
            {
                var step2 = new SeasonalTicketStepTwo30Days(step2ViewModel);
                step2.Show();
            }
            else
            {
                var step2 = new SeasonalTicketStepTwo1Month(step2ViewModel);
                step2.Show();
            }
        }
        public SeasonalTicketStepTwo1Month(SeasonalTicketStepTwoViewModel viewModel)
        {
            InitializeComponent();
            this.viewModel = viewModel;
            string basePath      = System.IO.Path.GetFullPath(@"..\..\");
            Image  selectedImage = new Bitmap(basePath + "img\\background.png");

            this.BackgroundImage = selectedImage;
            #region
            var pos1 = this.PointToScreen(label1.Location);
            pos1             = pictureBox1.PointToClient(pos1);
            label1.Parent    = pictureBox1;
            label1.Location  = pos1;
            label1.BackColor = Color.Transparent;
            label1.Text      = viewModel.TicketPrices[0].ToString() + " zł";

            var pos2 = this.PointToScreen(label2.Location);
            pos2             = pictureBox2.PointToClient(pos2);
            label2.Parent    = pictureBox2;
            label2.Location  = pos2;
            label2.BackColor = Color.Transparent;
            label2.Text      = viewModel.TicketPrices[1].ToString() + " zł";

            var pos3 = this.PointToScreen(label3.Location);
            pos3             = pictureBox3.PointToClient(pos3);
            label3.Parent    = pictureBox3;
            label3.Location  = pos3;
            label3.BackColor = Color.Transparent;
            label3.Text      = viewModel.TicketPrices[2].ToString() + " zł";

            var pos4 = this.PointToScreen(label4.Location);
            pos4             = pictureBox4.PointToClient(pos4);
            label4.Parent    = pictureBox4;
            label4.Location  = pos4;
            label4.BackColor = Color.Transparent;
            label4.Text      = viewModel.TicketPrices[3].ToString() + " zł";

            var pos5 = this.PointToScreen(label5.Location);
            pos5             = pictureBox5.PointToClient(pos5);
            label5.Parent    = pictureBox5;
            label5.Location  = pos5;
            label5.BackColor = Color.Transparent;
            label5.Text      = viewModel.TicketPrices[4].ToString() + " zł";

            var pos6 = this.PointToScreen(label6.Location);
            pos6             = pictureBox1.PointToClient(pos6);
            label6.Parent    = pictureBox1;
            label6.Location  = pos6;
            label6.BackColor = Color.Transparent;

            var pos7 = this.PointToScreen(label7.Location);
            pos7             = pictureBox2.PointToClient(pos7);
            label7.Parent    = pictureBox2;
            label7.Location  = pos7;
            label7.BackColor = Color.Transparent;

            var pos8 = this.PointToScreen(label8.Location);
            pos8             = pictureBox3.PointToClient(pos8);
            label8.Parent    = pictureBox3;
            label8.Location  = pos8;
            label8.BackColor = Color.Transparent;

            var pos9 = this.PointToScreen(label9.Location);
            pos9             = pictureBox4.PointToClient(pos9);
            label9.Parent    = pictureBox4;
            label9.Location  = pos9;
            label9.BackColor = Color.Transparent;

            var pos10 = this.PointToScreen(label10.Location);
            pos10             = pictureBox5.PointToClient(pos10);
            label10.Parent    = pictureBox5;
            label10.Location  = pos10;
            label10.BackColor = Color.Transparent;
        }
Ejemplo n.º 4
0
        public SeasonalTicketStepTwo30Days(SeasonalTicketStepTwoViewModel viewModel)
        {
            InitializeComponent();
            this.viewModel           = viewModel;
            expirationDate           = DateTime.Now;
            extensionDate            = expirationDate.AddDays(1);
            extensionDateLabel.Text  = extensionDate.ToString("dd-MM-yyyy");
            expirationDateLabel.Text = expirationDate.ToString("dd-MM-yyyy");
            string basePath      = System.IO.Path.GetFullPath(@"..\..\");
            Image  selectedImage = new Bitmap(basePath + "img\\background.png");

            this.BackgroundImage = selectedImage;

            var pos1 = this.PointToScreen(label2.Location);

            pos1             = lineType1.PointToClient(pos1);
            label2.Parent    = lineType1;
            label2.Location  = pos1;
            label2.BackColor = Color.Transparent;

            var pos2 = this.PointToScreen(extensionDateLabel.Location);

            pos2 = lineType1.PointToClient(pos2);
            extensionDateLabel.Parent    = lineType1;
            extensionDateLabel.Location  = pos2;
            extensionDateLabel.BackColor = Color.Transparent;

            var pos3 = this.PointToScreen(expirationDateLabel.Location);

            pos3 = pictureBox1.PointToClient(pos3);
            expirationDateLabel.Parent    = pictureBox1;
            expirationDateLabel.Location  = pos3;
            expirationDateLabel.BackColor = Color.Transparent;

            var pos4 = this.PointToScreen(label1.Location);

            pos4             = pictureBox1.PointToClient(pos4);
            label1.Parent    = pictureBox1;
            label1.Location  = pos4;
            label1.BackColor = Color.Transparent;

            var pos5 = this.PointToScreen(label6.Location);

            pos5             = pictureBox2.PointToClient(pos5);
            label6.Parent    = pictureBox2;
            label6.Location  = pos5;
            label6.BackColor = Color.Transparent;

            var pos6 = this.PointToScreen(label7.Location);

            pos6             = pictureBox3.PointToClient(pos6);
            label7.Parent    = pictureBox3;
            label7.Location  = pos6;
            label7.BackColor = Color.Transparent;

            var pos7 = this.PointToScreen(label8.Location);

            pos7             = pictureBox4.PointToClient(pos7);
            label8.Parent    = pictureBox4;
            label8.Location  = pos7;
            label8.BackColor = Color.Transparent;

            var pos8 = this.PointToScreen(label9.Location);

            pos8             = pictureBox5.PointToClient(pos8);
            label9.Parent    = pictureBox5;
            label9.Location  = pos8;
            label9.BackColor = Color.Transparent;

            var pos9 = this.PointToScreen(label10.Location);

            pos9              = pictureBox6.PointToClient(pos9);
            label10.Parent    = pictureBox6;
            label10.Location  = pos9;
            label10.BackColor = Color.Transparent;

            var pos11 = this.PointToScreen(label11.Location);

            pos11             = pictureBox2.PointToClient(pos11);
            label11.Parent    = pictureBox2;
            label11.Location  = pos11;
            label11.BackColor = Color.Transparent;
            label11.Text      = viewModel.TicketPrices[0].ToString() + " zł";

            var pos12 = this.PointToScreen(label12.Location);

            pos12             = pictureBox3.PointToClient(pos12);
            label12.Parent    = pictureBox3;
            label12.Location  = pos12;
            label12.BackColor = Color.Transparent;
            label12.Text      = viewModel.TicketPrices[1].ToString() + " zł";

            var pos13 = this.PointToScreen(label13.Location);

            pos13             = pictureBox4.PointToClient(pos13);
            label13.Parent    = pictureBox4;
            label13.Location  = pos13;
            label13.BackColor = Color.Transparent;
            label13.Text      = viewModel.TicketPrices[2].ToString() + " zł";

            var pos14 = this.PointToScreen(label14.Location);

            pos14             = pictureBox5.PointToClient(pos14);
            label14.Parent    = pictureBox5;
            label14.Location  = pos14;
            label14.BackColor = Color.Transparent;
            label14.Text      = viewModel.TicketPrices[3].ToString() + " zł";

            var pos15 = this.PointToScreen(label15.Location);

            pos15             = pictureBox6.PointToClient(pos15);
            label15.Parent    = pictureBox6;
            label15.Location  = pos15;
            label15.BackColor = Color.Transparent;
            label15.Text      = viewModel.TicketPrices[4].ToString() + " zł";
        }