Exemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string movName     = txtMovie.Text;
        string sesName     = txtSession.Text;
        int    sesDuration = Convert.ToInt32(txtDuration.Text);
        CineKalyoncuDatabaseDataContext db = new CineKalyoncuDatabaseDataContext();
        MOVIE d             = new MOVIE();
        MOVIE existingMovie = (from x in db.MOVIEs where x.Name == movName && x.Session_1 == sesName && x.Duration == sesDuration && x.Approve == true select x).SingleOrDefault();

        if (existingMovie == null)
        {
            d.Name      = movName;
            d.Session_1 = sesName;
            d.Duration  = sesDuration;
            d.Approve   = true;
            db.MOVIEs.InsertOnSubmit(d);
            db.SubmitChanges();
            lblMsg.Visible = true;
            lblMsg.Text    = "Movie Has Added Successfully";
        }
        else
        {
            lblMsg.Visible = true;
            lblMsg.Text    = "Movie Already Exist";
            txtMovie.Text  = "";
        }

        Session["MovieName"] = txtMovie.Text;
        Session["Sesname"]   = txtSession.Text;
        Session["Duration"]  = txtDuration.Text;
    }
Exemplo n.º 2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        CineKalyoncuDatabaseDataContext db = new CineKalyoncuDatabaseDataContext();

        string emailText = txtEmail.Text;

        CUSTOMER existingUSER = (from x in db.CUSTOMERs where x.Email == emailText select x).SingleOrDefault();

        if (existingUSER == null)
        {
            CUSTOMER us = new CUSTOMER();
            us.Name     = txtName.Text;
            us.Surname  = txtSurname.Text;
            us.Email    = txtEmail.Text;
            us.Password = txtPassword.Text;
            us.Approve  = true;

            db.CUSTOMERs.InsertOnSubmit(us);
            db.SubmitChanges();
            ErrorLabel.Visible = true;
            ErrorLabel.Text    = "Your Registered is Succesfully Created!";
            ClearTextBoxes();
        }
        else
        {
            ErrorLabel.Visible = true;
            ErrorLabel.Text    = "Email already used!";
        }
    }
Exemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        CineKalyoncuDatabaseDataContext db = new CineKalyoncuDatabaseDataContext();

        // ddlMovie.Items.Clear();
        // ddlSession.Items.Clear();
        if (ddlMovie.SelectedIndex == 0 || ddlSession.SelectedIndex == 0)
        {
            lblMessage.Visible = true;
            lblMessage.Text    = "please choose";
        }
        else
        {
            CUSTOMER c = new CUSTOMER();
            TICKET   t = new TICKET();
            t.Name    = ddlMovie.SelectedValue;
            t.Session = ddlSession.SelectedValue;
            t.Person  = txtTicket.Text;
            t.Room    = ddlRoom.SelectedValue;
            t.Chair   = ddlChair.SelectedValue;
            int prc;
            prc = Convert.ToInt32(txtTicket.Text) * 13;



            db.TICKETs.InsertOnSubmit(t);
            db.SubmitChanges();


            lblMessage.Visible      = true;
            lblMessage.Text         = "You take it successfully!";
            lblMessagePrice.Visible = true;
            lblMessagePrice.Text    = prc.ToString() + "TL";
            lblmessage1.Visible     = true;
        }

        Session["Movie"]   = ddlMovie.SelectedValue;
        Session["Session"] = ddlSession.SelectedValue;
        Session["Person"]  = txtTicket.Text;
        Session["Room"]    = ddlRoom.SelectedValue;
        Session["Chair"]   = ddlChair.SelectedValue;
    }
Exemplo n.º 4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        CineKalyoncuDatabaseDataContext db = new CineKalyoncuDatabaseDataContext();

        // ddlMovie.Items.Clear();
        // ddlSession.Items.Clear();
        if (ddlMovieName.SelectedIndex == 0 || ddlSession.SelectedIndex == 0 || ddlUsername.SelectedIndex == 0 || ddlUserSurname.SelectedIndex == 0)
        {
            lblMessage.Visible = true;
            lblMessage.Text    = "Please Check!";
        }
        else
        {
            TICKET t = new TICKET();
            t.Name    = ddlMovieName.SelectedValue;
            t.Session = ddlSession.SelectedValue;
            t.Room    = ddlRoom.SelectedValue;
            t.Chair   = ddlChair.SelectedValue;
            t.Person  = txtPrice.Text;
            int prc;
            prc = Convert.ToInt32(txtPrice.Text) * 13;



            db.TICKETs.InsertOnSubmit(t);
            db.SubmitChanges();


            lblMessage.Visible = true;
            lblMessage.Text    = "You sell it successfully!";
        }

        Session["MOVIENAME"]   = ddlMovieName.SelectedValue;
        Session["SESSION"]     = ddlSession.SelectedValue;
        Session["PERSON"]      = txtPrice.Text;
        Session["USERNAME"]    = ddlUsername.SelectedValue;
        Session["USERSURNAME"] = ddlUserSurname.SelectedValue;
        Session["ROOM"]        = ddlRoom.SelectedValue;
        Session["CHAIR"]       = ddlChair.SelectedValue;
    }