Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (this.PerformanceID != null)
                {
                    if (LoadData != null)
                    {
                        PerformanceDataArgs pda = new PerformanceDataArgs();
                        pda.PerformanceID = this.PerformanceID;
                        LoadData(pda);

                        lblMovie.Text       = Model.MovieTitle;
                        lblPerformance.Text = Model.PerformanceDetails;
                        lblTheater.Text     = Model.TheaterDetails;
                        txtPrice.Text       = Model.Price;
                    }
                }
            }
        }
        private void LoadData(PerformanceDataArgs pda)
        {
            String PerformanceID = pda.PerformanceID;
            IUser UserServices = new UserServices();
            int performanceID;
            bool isInt = int.TryParse(PerformanceID, out performanceID);
            if (isInt)
            {
                UserPerformanceDTO CurrentPerformance = new UserPerformanceDTO();
                CurrentPerformance = UserServices.GetPerformanceByID(performanceID);
                this.PaymentView.Model.MovieTitle = CurrentPerformance.MovieTitle;
                string theaterDetails = string.Format("{0}, {1}.", CurrentPerformance.TheaterName, CurrentPerformance.TheaterAddress);
                this.PaymentView.Model.TheaterDetails = theaterDetails;
                string performance = string.Format("Date: {0}, Starting Time: {1}, Duration: {2}, Hall: {3}.",
                    CurrentPerformance.Date,
                    CurrentPerformance.StartingTime,
                    CurrentPerformance.Duration,
                    CurrentPerformance.roomNumber);
                this.PaymentView.Model.PerformanceDetails = performance;
                this.PaymentView.Model.Price = CurrentPerformance.price.ToString();

            }
        }
Example #3
0
        private void LoadData(PerformanceDataArgs pda)
        {
            String PerformanceID = pda.PerformanceID;
            IUser  UserServices  = new UserServices();
            int    performanceID;
            bool   isInt = int.TryParse(PerformanceID, out performanceID);

            if (isInt)
            {
                UserPerformanceDTO CurrentPerformance = new UserPerformanceDTO();
                CurrentPerformance = UserServices.GetPerformanceByID(performanceID);
                this.PaymentView.Model.MovieTitle = CurrentPerformance.MovieTitle;
                string theaterDetails = string.Format("{0}, {1}.", CurrentPerformance.TheaterName, CurrentPerformance.TheaterAddress);
                this.PaymentView.Model.TheaterDetails = theaterDetails;
                string performance = string.Format("Date: {0}, Starting Time: {1}, Duration: {2}, Hall: {3}.",
                                                   CurrentPerformance.Date,
                                                   CurrentPerformance.StartingTime,
                                                   CurrentPerformance.Duration,
                                                   CurrentPerformance.roomNumber);
                this.PaymentView.Model.PerformanceDetails = performance;
                this.PaymentView.Model.Price = CurrentPerformance.price.ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (this.PerformanceID != null)
                {

                    if (LoadData != null)
                    {
                        PerformanceDataArgs pda = new PerformanceDataArgs();
                        pda.PerformanceID = this.PerformanceID;
                        LoadData(pda);

                        lblMovie.Text = Model.MovieTitle;
                        lblPerformance.Text = Model.PerformanceDetails;
                        lblTheater.Text = Model.TheaterDetails;
                        txtPrice.Text = Model.Price;

                    }
                }

            }
        }