Exemplo n.º 1
0
    protected void Unnamed_Click1(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(((Button)sender).CommandArgument);

        var lst = new user_parking_view().MyCarsParked(Convert.ToInt32(Session["ttid"]));
        user_parking_view parking = lst.Find(m => m.carid == id);

        if (parking.username != "Public lane")
        {
            int logid = new User().RemoveParkedCar(Convert.ToInt32(Session["ttid"]), id);
        }
        else
        {
            new User().pick_from_public(Convert.ToInt32(Session["ttid"]), parking.parking_id);
        }

        grid_previous.DataSource = new ParkingLog().GetLogs(Convert.ToInt32(Session["ttid"]));
        grid_previous.DataBind();
        money.InnerText = "";
        money.InnerText = money.InnerText + new User().GetCashWithUser(Convert.ToInt32(Session["ttid"]));
        grid_view_parked_cars.DataSource = new user_parking_view().MyCarsParked(Convert.ToInt32(Session["ttid"]));
        grid_view_parked_cars.DataBind();
        var i = new Cars().GetCarsOwnedByUser(Convert.ToInt32(Session["ttid"]));

        d.DataSource = i;
        d.DataBind();
        a.DataSource = i;
        a.DataBind();

        GridView2.DataSource = new user_parking_view().GetUsersOnMyParking(Convert.ToInt32(Session["ttid"]));
        GridView2.DataBind();
    }
Exemplo n.º 2
0
    protected void Unnamed_Click1(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(((Button)sender).CommandArgument);

        var lst = new user_parking_view().MyCarsParked(Convert.ToInt32(Session["ttid"]));

        if (lst.Count == 0)
        {
            return;
        }
        user_parking_view parking = lst.Find(m => m.carid == id);

        if (parking.username != "Public lane")
        {
            int logid = new User().RemoveParkedCar(Convert.ToInt32(Session["ttid"]), id);
        }
        else
        {
            new User().pick_from_public(Convert.ToInt32(Session["ttid"]), parking.parking_id);
        }

        money.InnerText = "";
        money.InnerText = money.InnerText + new User().GetCashWithUser(Convert.ToInt32(Session["ttid"]));
        grid_view_parked_cars.DataSource = new user_parking_view().MyCarsParked(Convert.ToInt32(Session["ttid"]));
        grid_view_parked_cars.DataBind();
    }
Exemplo n.º 3
0
    protected void btn_fine_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(((ImageButton)sender).CommandArgument);

        var i = new user_parking_view().GetUsersOnMyParking(Convert.ToInt32(Session["ttid"]));

        var u = i.Find(l => l.parking_id == id);

        new fine().Finebyuser(Convert.ToInt32(Session["ttid"]), id, u.userid);
        money.InnerText      = "";
        money.InnerText      = money.InnerText + new User().GetCashWithUser(Convert.ToInt32(Session["ttid"]));
        GridView2.DataSource = new user_parking_view().GetUsersOnMyParking(Convert.ToInt32(Session["ttid"]));
        GridView2.DataBind();
    }
Exemplo n.º 4
0
    protected void btn_fine_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(((Button)sender).CommandArgument);
        // GridViewRow row = GridView2.SelectedRow;
        //Label l = (Label)row.FindControl("lbl_car_owner_id");
        var i = new user_parking_view().GetUsersOnMyParking(Convert.ToInt32(Session["ttid"]));
        var u = i.Find(l => l.parking_id == id);

        new fine().Finebyuser(Convert.ToInt32(Session["ttid"]), id, u.userid);
        money.InnerText      = "";
        money.InnerText      = money.InnerText + new User().GetCashWithUser(Convert.ToInt32(Session["ttid"]));
        GridView2.DataSource = new user_parking_view().GetUsersOnMyParking(Convert.ToInt32(Session["ttid"]));
        GridView2.DataBind();
    }