Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConClass so = new SqlConClass();

        GridView1.DataSource = so.FilterDriverTrips(Session["E_Mail"].ToString());
        GridView1.DataBind();//ehe
    }
Exemple #2
0
    protected void Button8_Click(object sender, EventArgs e)
    {
        //Report that user started a trip
        SqlConClass so = new SqlConClass();

        so.updateMergedTripStartDate(Session["E_Mail"].ToString());
    }
Exemple #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass sq = new SqlConClass();

        Label2.Text = sq.deleteUsersActiveTripRequest(Session["E_Mail"].ToString());
        Page_Load(sender, e);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass so = new SqlConClass();

        GridView2.DataSource = so.FilterUsers(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text);
        GridView2.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConClass so = new SqlConClass();

        GridView2.DataSource = so.FilterDrivers(null, null, null);
        GridView2.DataBind();
    }
    //Edit function


    protected void save_button_Click(object sender, EventArgs e)
    {
        SqlConClass sql    = new SqlConClass();
        string      e_mail = Session["E_mail"].ToString();//= "*****@*****.**"

        sql.updateUserData(e_mail, first_name.Text, last_name.Text, language.Text, phone_no.Text);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConClass so = new SqlConClass();

        GridView1.DataSource = so.FilterMergeTripsForRider(Session["E_Mail"].ToString());//nooo this has to filter passengers
        GridView1.DataBind();
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConClass so = new SqlConClass();

        GridView1.DataSource = so.showAcceptedDrivers(Session["E_Mail"].ToString());
        GridView1.DataBind();
        GridView1.RowCommand += acceptRowCommand;
    }
Exemple #9
0
 protected void acceptRowCommand(Object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "mergeTrip")
     {
         int         index  = Convert.ToInt32(e.CommandArgument);
         SqlConClass sq     = new SqlConClass();
         string      tripID = sq.getActiveTripRequest(Session["E_Mail"].ToString());
         sq.chooseDriver(GridView1.Rows[index].Cells[2].Text, tripID);
         //buraya doğru parametreleri verin, driver id ile trip id
     }
 }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConClass so = new SqlConClass();

        GridView1.DataSource = so.FindMostBanal();
        GridView1.DataBind();


        GridView2.DataSource = so.displayMostTravellingFamily();
        GridView2.DataBind();
    }
Exemple #11
0
    //TODO login yapmis kullanıcının email'ini alması gerekiyor burda

    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass sql         = new SqlConClass();
        String      driver_id   = Session["E_Mail"].ToString();
        String      plateNumber = Text1.Value;
        String      color       = DropDownList1.SelectedValue;
        String      modelName   = DropDownList2.SelectedValue;

        sql.addCarToDriver(modelName, plateNumber, color, driver_id);
        Label4.Text = "New car is added to " + driver_id;
        Response.Redirect("SignIn.aspx");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass so     = new SqlConClass();
        int         rating = 10;

        if (!TextBox1.Text.Equals(""))
        {
            rating = Int32.Parse(TextBox1.Text);
        }

        so.RateDriver(mergedTripId, rating, TextBox3.Text);//This rating held on Passenger Table
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int capacity;

        Int32.TryParse(Text1.Value, out capacity);
        char   luxury    = (DropDownList1.SelectedItem.Value)[0];
        string modelName = Text3.Value;

        SqlConClass sql = new SqlConClass();

        sql.addModel(capacity, luxury, modelName);
        Label4.Text = "New model is added.";
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConClass sq = new SqlConClass();
        ButtonField bf = new ButtonField();

        bf.ButtonType  = ButtonType.Button;
        bf.Text        = "Drive";
        bf.CommandName = "drive";
        GridView1.Columns.Clear();
        GridView1.Columns.Add(bf);
        sq.getNearbyTripsForDriver(GridView1, Session["E_Mail"].ToString());
        GridView1.RowCommand += driveRowCommand;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        System.Diagnostics.Debug.WriteLine(month);
        System.Diagnostics.Debug.WriteLine(year);
        SqlConClass sql = new SqlConClass();
        //string e_mail = "*****@*****.**";
        string e_mail = Session["E_mail"].ToString();

        Label1.Text = e_mail;
        sql.addCreditCard(holder_name.Text, card_no.Text, exp_date.SelectedDate.Month, (exp_date.SelectedDate.Year) % 1000, Int32.Parse(cvc.Text));
        holder_name.Text = "";
        card_no.Text     = "";
        cvc.Text         = "";
    }
Exemple #16
0
    protected void save_button_Click(object sender, EventArgs e)
    {
        SqlConClass sql    = new SqlConClass();
        string      e_mail = Session["E_mail"].ToString();//= "*****@*****.**"
        bool        yes    = sql.updateDriverData(e_mail, first_name.Text, last_name.Text, language.Text, phone_no.Text, Int32.Parse(location.Text));

        if (yes)
        {
            Label2.Text = "Changes Saved";
        }
        else
        {
            Label2.Text = "Failed to save changes";
        }
    }
Exemple #17
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        //sign in as a driver
        SqlConClass sql      = new SqlConClass();
        string      email    = Text1.Value;
        string      password = Password1.Value;
        DataTable   dt       = sql.loginDriver(email, password);

        foreach (DataRow dr in dt.Rows)
        {
            Session["E_Mail"]    = dr["E_Mail"].ToString();
            Session["User_Type"] = "driver";
            Response.Redirect("DriverHome.aspx");
        }
    }
    //The button that filters all the complaints given information from textboxes
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass so       = new SqlConClass();
        int?        Issue_id = null;
        int?        trip_ID  = null;

        if (!TextBox6.Text.Equals(""))
        {
            Issue_id = Int32.Parse(TextBox6.Text);
        }
        if (!TextBox7.Text.Equals(""))
        {
            trip_ID = Int32.Parse(TextBox7.Text);
        }
        GridView2.DataSource = so.FilterComplaints(Issue_id, TextBox4.Text, TextBox5.Text, trip_ID);
        GridView2.DataBind();
    }
Exemple #19
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass sqlConClass   = new SqlConClass();
        string      mail          = Text1.Value;
        string      phone         = Text2.Value;
        string      fname         = Text3.Value;
        string      lname         = Text4.Value;
        string      personal_info = Text6.Value;
        string      pass          = Password1.Value;
        string      age           = Text7.Value;


        bool res = sqlConClass.registerDriver(mail, phone, fname, lname, personal_info, pass, age);

        Session["E_Mail"] = mail;
        Response.Redirect("addCarToUser.aspx");
    }
Exemple #20
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass sqlConClass = new SqlConClass();

        string mail          = Text1.Value;
        string phone         = Text2.Value;
        string fname         = Text3.Value;
        string lname         = Text4.Value;
        string personal_info = Text6.Value;
        string pass          = Password1.Value;
        string age           = Text7.Value;


        bool res = sqlConClass.registerCustomer(mail, phone, fname, lname, personal_info, pass, age);

        Name.Text = mail;
        Response.Redirect("SignIn.aspx");
    }
Exemple #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlConClass sql = new SqlConClass();
            //string e_mail = "*****@*****.**";
            DataTable dt = sql.GetDriverProfile(Session["E_mail"].ToString());

            foreach (DataRow dr in dt.Rows)
            {
                first_name.Text = dr["FirstName"].ToString();
                last_name.Text  = dr["LastName"].ToString();
                language.Text   = dr["Language"].ToString();
                phone_no.Text   = dr["Phone_Number"].ToString();
                location.Text   = dr["Current_Location"].ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlConClass sql    = new SqlConClass();
            string      e_mail = "*****@*****.**";
            DataTable   dt     = sql.GetUserProfile(Session["E_mail"].ToString());
            //DataTable dt = sql.GetUserProfile(e_mail);

            foreach (DataRow dr in dt.Rows)
            {
                first_name.Text = dr["FirstName"].ToString();
                last_name.Text  = dr["LastName"].ToString();
                language.Text   = dr["Language"].ToString();
                phone_no.Text   = dr["Phone_Number"].ToString();
            }
        }
    }
 protected void FutureTrips_RowCommand(object sender,
                                       GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Select")
     {
         // Retrieve the row index stored in the
         // CommandArgument property.
         int         index = Convert.ToInt32(e.CommandArgument);
         SqlConClass so    = new SqlConClass();
         // Retrieve the row that contains the button
         // from the Rows collection.
         GridViewRow row = GridView1.Rows[index];
         so.updateMergedTripEndDate(Session["E_Mail"].ToString());
         int mId = Int32.Parse(row.Cells[1].Text);
         Session["RatedMTID"] = mId;
         Response.Redirect("RateDriver.aspx");
     }
 }
Exemple #24
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //sign in as a customer
        SqlConClass sql      = new SqlConClass();
        string      email    = Text1.Value;
        string      password = Password1.Value;
        DataTable   dt       = sql.loginCustomer(email, password);

        foreach (DataRow dr in dt.Rows)
        {
            Session["E_Mail"] = dr["E_Mail"].ToString();
            if (Session["E_Mail"].ToString().Length == 17)
            {
                Response.Redirect("CustServiceHome.aspx");
            }
            Session["User_Type"] = "customer";
            Response.Redirect("create_trip.aspx");
        }
    }
Exemple #25
0
    void driveRowCommand(Object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "drive")
        {
            int         index = Convert.ToInt32(e.CommandArgument);
            SqlConClass sq    = new SqlConClass();

            if (sq.checkRouteMatches(Session["E_Mail"].ToString(),
                                     GridView1.Rows[index].Cells[1].Text))
            {
                Label1.Text = sq.driverAccepts(Session["E_Mail"].ToString(),
                                               GridView1.Rows[index].Cells[1].Text);
                Page_Load(sender, e);
            }
            else
            {
                Label2.Text = "Current route conflicts with the accepted route";
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConClass so        = new SqlConClass();
        int?        available = null;

        if (CheckBox1.Checked)
        {
            available = 1;
        }
        int?Loc = null;

        if (!TextBox8.Text.Equals(""))
        {
            Loc = Int32.Parse(TextBox8.Text);
        }

        string email = TextBox7.Text;

        GridView2.DataSource = so.FilterDrivers(available, Loc, email);
        GridView2.DataBind();
    }
Exemple #27
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string[]    destinationPoints = TextBox2.Text.Replace("\r", "").Split(new char[] { '\n' });
        SqlConClass s   = new SqlConClass();
        int         min = 0;

        if (RadioButtonList1.SelectedIndex == 1)
        {
            min = Int32.Parse(TextBox4.Text);
        }
        //min += 1;
        Char l = 'M';

        if (DropDownList1.Text.Equals(DropDownList1.Items[1]))
        {
            l = 'Q';
        }
        else if (DropDownList1.Text.Equals(DropDownList1.Items[2]))
        {
            l = 'L';
        }

        string val = s.createTrip(
            DropDownList2.Text,
            CheckBox2.Checked,
            CheckBox1.Checked,
            min,
            l,
            TextBox3.Text,
            TextBox1.Text,
            destinationPoints,
            Session["E_Mail"].ToString()
            );

        Label5.Text = val;
    }