Ejemplo n.º 1
0
        protected void btnCekor2_Click(object sender, EventArgs e)
        {
            if (ddlMovie.SelectedIndex > 0 && ddlDate.SelectedIndex > 0 && (List <string>)ViewState["seats"] != null)
            {
                SqlConnection conn = new SqlConnection();
                conn.ConnectionString = ConfigurationManager.ConnectionStrings["Konekcija"].ConnectionString;
                string sqlSelect = "UPDATE Program SET Seats+=@Seats " +
                                   " WHERE Name=@Name AND StartDate=@StartDate";
                SqlCommand command = new SqlCommand(sqlSelect, conn);
                command.Parameters.AddWithValue("@Seats", "," + String.Join(",", (List <string>)ViewState["seats"]));
                command.Parameters.AddWithValue("@Name", ddlMovie.SelectedItem.Text);
                command.Parameters.AddWithValue("@StartDate", ddlDate.SelectedItem.Text.Split(' ')[0]);

                int efekt = 0;
                try
                {
                    conn.Open();
                    efekt = command.ExecuteNonQuery();
                }
                catch (Exception err)
                {
                    lbSelected.Text = err.ToString();
                }
                finally
                {
                    conn.Close();
                }
                if (efekt > 0)
                {
                    List <string> tickets = (List <string>)ViewState["seats"];
                    for (int i = 0; i < tickets.Count; i++)
                    {
                        tickets[i] = tickets[i].Replace("btn", "");
                        tickets[i] = tickets[i].Replace("_", " ред, седиште ");
                    }
                    lbBrTiket.Text    = tickets.Count.ToString();
                    lbTotal.Text      = tickets.Count + " X 150 = " + tickets.Count * 150;
                    lbSeats.Text      = String.Join(", <br/> &nbsp;&nbsp;&nbsp;", tickets);
                    confirm.Visible   = true;
                    moviedate.Visible = false;
                    bookseats.Visible = false;

                    WebServiceKino servis = new WebServiceKino();
                    lblId.Text = servis.insertReservation((string)Session["user"], ddlMovie.SelectedItem.Text, ddlDate.SelectedItem.Text.Split(' ')[0],
                                                          ddlDate.SelectedItem.Text.Split(' ')[1], String.Join("/ ", tickets));
                }
                HttpCookie kolace = new HttpCookie("kolaceInfo");
                kolace["film"]    = lbFilm.Text;
                kolace["data"]    = lbDen.Text;
                kolace["cas"]     = lbCas.Text;
                kolace["sedista"] = lbSeats.Text.Replace("<br/> &nbsp;&nbsp;&nbsp;", "/");
                kolace["total"]   = lbTotal.Text;
                kolace.Expires    = DateTime.Now.AddHours(1);
                Response.Cookies.Add(kolace);
            }
        }
Ejemplo n.º 2
0
 protected void btnRegistration_Click(object sender, EventArgs e)
 {
     WebServiceKino service = new WebServiceKino();
     string rez = service.logIn(tbUserName.Text, tbPassword.Text);
     if(rez == "ok")
     {
         Session["user"] = tbUserName.Text;
         Response.Redirect("Home.aspx");
     }
     else
     {
         lblErrMessage.Text = rez;
     }
 }
Ejemplo n.º 3
0
        protected void btnRegistration_Click(object sender, EventArgs e)
        {
            WebServiceKino service = new WebServiceKino();
            string         rez     = service.logIn(tbUserName.Text, tbPassword.Text);

            if (rez == "ok")
            {
                Session["user"] = tbUserName.Text;
                Response.Redirect("Home.aspx");
            }
            else
            {
                lblErrMessage.Text = rez;
            }
        }
Ejemplo n.º 4
0
        public void FillList()
        {
            string         name   = Request.QueryString["name"];
            WebServiceKino servis = new WebServiceKino();

            WebServiceKino.Movie movie = servis.readMovie(name);
            if (movie != null)
            {
                lbName.Text        = movie.Name;
                lbName1.Text       = movie.NameMk;
                lbDescription.Text = movie.Desctiption;
                lbDirector.Text    = movie.Director;
                lbDuration.Text    = movie.Duration;
                lbGenre.Text       = movie.Genre;
                lbRating.Text      = movie.Rating;
                lbRelease.Text     = movie.Release;
                lbStars.Text       = movie.Stars;
                Image1.ImageUrl    = movie.Image;
                string url     = movie.Url;
                string videoID = url.Substring(url.IndexOf('=') + 1);
                iframe.Attributes.Add("src", "https://www.youtube.com/embed/" + videoID);
            }
        }
Ejemplo n.º 5
0
        public void FillList()
        {
            string name = Request.QueryString["name"];
            WebServiceKino servis = new WebServiceKino();
            WebServiceKino.Movie movie = servis.readMovie(name);
            if (movie != null)
            {

                lbName.Text = movie.Name;
                lbName1.Text = movie.NameMk;
                lbDescription.Text = movie.Desctiption;
                lbDirector.Text = movie.Director;
                lbDuration.Text = movie.Duration;
                lbGenre.Text = movie.Genre;
                lbRating.Text = movie.Rating;
                lbRelease.Text = movie.Release;
                lbStars.Text = movie.Stars;
                Image1.ImageUrl = movie.Image;
                string url = movie.Url;
                string videoID = url.Substring(url.IndexOf('=') + 1);
                iframe.Attributes.Add("src", "https://www.youtube.com/embed/" + videoID);
            }
          
        }
Ejemplo n.º 6
0
        protected void btnCekor2_Click(object sender, EventArgs e)
        {
            if (ddlMovie.SelectedIndex > 0 && ddlDate.SelectedIndex > 0 && (List<string>)ViewState["seats"] != null )
                {
                    SqlConnection conn = new SqlConnection();
                    conn.ConnectionString = ConfigurationManager.ConnectionStrings["Konekcija"].ConnectionString;
                    string sqlSelect = "UPDATE Program SET Seats+=@Seats " +
                        " WHERE Name=@Name AND StartDate=@StartDate";
                    SqlCommand command = new SqlCommand(sqlSelect, conn);
                    command.Parameters.AddWithValue("@Seats", "," + String.Join(",", (List<string>)ViewState["seats"]));
                    command.Parameters.AddWithValue("@Name", ddlMovie.SelectedItem.Text);
                    command.Parameters.AddWithValue("@StartDate", ddlDate.SelectedItem.Text.Split(' ')[0]);

                    int efekt = 0;
                    try
                    {
                        conn.Open();
                        efekt = command.ExecuteNonQuery();

                    }
                    catch (Exception err)
                    {
                        lbSelected.Text = err.ToString();
                    }
                    finally
                    {
                        conn.Close();
                    }
                    if (efekt > 0)
                    {
                        List<string> tickets = (List<string>)ViewState["seats"];
                        for (int i = 0; i < tickets.Count; i++)
                        {
                            tickets[i] = tickets[i].Replace("btn", "");
                            tickets[i] = tickets[i].Replace("_", " ред, седиште ");
                        }
                        lbBrTiket.Text = tickets.Count.ToString();
                        lbTotal.Text = tickets.Count + " X 150 = " + tickets.Count * 150;
                        lbSeats.Text = String.Join(", <br/> &nbsp;&nbsp;&nbsp;", tickets);
                        confirm.Visible = true;
                        moviedate.Visible = false;
                        bookseats.Visible = false;

                        WebServiceKino servis = new WebServiceKino();
                        lblId.Text = servis.insertReservation((string)Session["user"], ddlMovie.SelectedItem.Text, ddlDate.SelectedItem.Text.Split(' ')[0],
                            ddlDate.SelectedItem.Text.Split(' ')[1], String.Join("/ ", tickets));
                    }
                    HttpCookie kolace = new HttpCookie("kolaceInfo");
                    kolace["film"] = lbFilm.Text;
                    kolace["data"] = lbDen.Text;
                    kolace["cas"] = lbCas.Text;
                    kolace["sedista"] = lbSeats.Text.Replace("<br/> &nbsp;&nbsp;&nbsp;", "/");
                    kolace["total"] = lbTotal.Text;
                    kolace.Expires = DateTime.Now.AddHours(1);
                    Response.Cookies.Add(kolace);
                    
                }
            

        }
Ejemplo n.º 7
0
 protected void mkName(string name)
 {
     WebServiceKino service = new WebServiceKino();
     lbFilm.Text = service.mkName(name);
 }
Ejemplo n.º 8
0
        protected void mkName(string name)
        {
            WebServiceKino service = new WebServiceKino();

            lbFilm.Text = service.mkName(name);
        }