Ejemplo n.º 1
0
 protected void btnAddCar_Click(object sender, EventArgs e)
 {
     VehicleData vehicleD = new VehicleData();
     UserData user = new UserData();
     User userInSession = user.getUserInSession("email");
     userInSession = user.getUserInSession((string)Session["user"]);
     int idUser = userInSession.Id;
     bool isActive = true;
     string type = ddlType.SelectedItem.Value;
     SiCAP_GrupoCARARA.App_Domain.Vehicle car = new SiCAP_GrupoCARARA.App_Domain.Vehicle(plate.Text, idUser, color.Text, type , false, isActive);
     vehicleD.InsertVehicle(car);
     plate.Text = string.Empty;
     color.Text = string.Empty;
     ddlType.SelectedIndex = -1;
 }
Ejemplo n.º 2
0
        public SiCAP_GrupoCARARA.App_Domain.Reservation FillReservation(int idTimeForReservation)
        {
            int id = 0;
            UserData userData = new UserData();
            DateTime thisDay = DateTime.Today;
            string date = thisDay.ToString("dd/MM/yyyy");
            User userInSession = userData.getUserInSession((string)Session["user"]);
            int idUser = userInSession.Id;
            int idParkingSpace = 3;  //   Aquí hay que meter lo que viene de los botones...!!!!!!!!!!!!!!!!!!!!!!!!!!
            int idVehicle = int.Parse(DropDownListVehiclesOfOneUser.SelectedItem.Value);
            bool hasBeenCanceled = false;

            SiCAP_GrupoCARARA.App_Domain.Reservation myReservation = new SiCAP_GrupoCARARA.App_Domain.Reservation(id, thisDay, idTimeForReservation, idUser, idParkingSpace, idVehicle, hasBeenCanceled);

            return myReservation;
        }