Пример #1
0
        protected void movieddl_SelectedIndexChanged(object sender, EventArgs e)
        {
            m = Business_Logic.MovieLogic.getMovieByPK(Convert.ToInt32(movieddl.SelectedValue));
            Label7.Text = Convert.ToString(m.Movie_ID);
            Label9.Text = m.Movie_Name;
            Label11.Text = Convert.ToString(m.Duration);
            Label13.Text = m.Description;
            Label15.Text = Convert.ToString(m.Ratings);
            TimeSpan st = TimeSpan.Parse(starttimeddl.SelectedValue);
            int dur = Convert.ToInt32(Label11.Text);
            int hf = dur / 30;
            int left = hf / 2;
            int right = hf % 2 + 1;
            TimeSpan final = new TimeSpan(st.Hours + left, st.Minutes + right * 30, 0);

            addetlb.Text = final.ToString(@"hh\:mm");
        }
Пример #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (var context = new MovieTheaterEntities())
            {
                Movie mv = new Movie();
                mv.Movie_Name = tbxAddName.Text;
                mv.Duration = Convert.ToInt32(tbxAddDuration.Text);
                mv.PictureURL = null;
                mv.IMDB_Link = null;
                mv.Description = tbxAddDescription.Text;
                mv.Language = tbxAddLanguage.Text;
                mv.Subtitle = tbxAddSubtitle.Text;
                mv.Ratings = Convert.ToDouble(tbxAddRatings.Text);
                mv.Active_Indicator = true;
                mv.Update_Datetime = DateTime.Today;

                context.Movie.Add(mv);
                context.SaveChanges();
            }
        }
Пример #3
-1
        protected void addroommoviebtn_Click(object sender, EventArgs e)
        {
            Calendar2.Visible = false;
            pnlEdit.Visible = false;
            pnlAdd.Visible = true;
            movieddl.DataSource = Business_Logic.MovieLogic.getMovieList();
            movieddl.DataTextField = "Movie_Name";
            movieddl.DataValueField = "Movie_ID";
            movieddl.DataBind();
            m = Business_Logic.MovieLogic.getMovieByPK(Convert.ToInt32(movieddl.SelectedValue));
            Label7.Text = Convert.ToString(m.Movie_ID);
            Label9.Text = m.Movie_Name;
            Label11.Text = Convert.ToString(m.Duration);
            Label13.Text = m.Description;
            Label15.Text = Convert.ToString(m.Ratings);

            TimeSpan st = TimeSpan.Parse(starttimeddl.SelectedValue);
            int dur = Convert.ToInt32(Label11.Text);
            int hf = dur / 30;
            int left = hf / 2;
            int right = hf % 2 + 1;
            TimeSpan final = new TimeSpan(st.Hours + left, st.Minutes + right * 30, 0);

            addetlb.Text = final.ToString(@"hh\:mm");
        }