Ejemplo n.º 1
0
        public bool isExistingUser()
        {
            bool isAnExistinguser = false;
            UserData userData = new UserData();
            if (userData.isARegisteredUser(username))
            {
                isAnExistinguser = true;
            }

            return isAnExistinguser;
        }
Ejemplo n.º 2
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.º 3
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;
        }
Ejemplo n.º 4
0
 //Corregir dropdownlist
 protected void btnAddUser_Click(object sender, EventArgs e)
 {
     UserData data = new UserData();
     int idNumberC = Convert.ToInt32(idNumer.Text);
     int major = Convert.ToInt32(ddlMajor.SelectedItem.Value);
     int type = Convert.ToInt32(ddlUserType.SelectedItem.Value);
     User user = new User(email.Text, idNumberC, name.Text, secondName.Text, lastname.Text, secondLastname.Text, cellphone.Text, idNumer.Text, major, type, false, false);
     data.createUser(user);
     email.Text = String.Empty;
     name.Text = String.Empty;
     secondName.Text = String.Empty;
     lastname.Text = String.Empty;
     secondLastname.Text = String.Empty;
     cellphone.Text = String.Empty;
     idNumer.Text = String.Empty;
     ddlMajor.SelectedIndex = -1;
     ddlUserType.SelectedIndex = -1;
 }
Ejemplo n.º 5
0
        public string matchesUserName_and_Password()
        {
            string message = "";
            UserData userData = new UserData();
            if (userData.comparesPasswordComingFromUser_toPasswordInDataBase(username, password))
            {
                String userSession = userData.checksInDataBaseIfUsernameExists(username);
                Session["user"] = userSession;

            }
            else
            {
                message = Message03(); // Avisa que la contraseña ingresada es incorrecta......  Debe imprimirse este mensaje en algún lugar del formulario Web Correspondiente
            };

            return message;
        }