private void TryToLogin()
        {
            MembersDao    membersDao = new MembersDaoImpl();
            MembersEntity member     = membersDao.getMemberByEmail(Email);

            if (member == null || !member.Password.Equals(Password))
            {
                FeedbackMessage = "Hibás e-mail cím vagy jelszó!";
                ServiceStatus   = Status.Error;
            }
            else
            {
                if (member.Permission == 0)
                {
                    ResponseMessage.Add("permission", "admin");
                }
                else
                {
                    ResponseMessage.Add("permission", "user");
                }

                FeedbackMessage = "Sikeres belépés!";
                ServiceStatus   = Status.OK;
            }

            // it must be a method
            if (!string.IsNullOrEmpty(FeedbackMessage) && !string.IsNullOrWhiteSpace(FeedbackMessage))
            {
                new PrintMessageBox(FeedbackMessage, ServiceStatus);
            }
        }
Exemple #2
0
        private void TransportDataCount()
        {
            TransportDevicesDao           transportDevicesDao = new TransportDevicesDaoImpl();
            MembersDao                    membersDao          = new MembersDaoImpl();
            MembersEntity                 member       = membersDao.getMemberByEmail(email);
            List <TransportDevicesEntity> myTransports = transportDevicesDao.GetAllTransportDevicesByOwner(member);

            ResponseMessage.Add("TransportsCount", Convert.ToString(myTransports.Count));
        }
        private void BoatDataCount()
        {
            BoatsDao           boatsDao   = new BoatsDaoImpl();
            MembersDao         membersDao = new MembersDaoImpl();
            MembersEntity      member     = membersDao.getMemberByEmail(email);
            List <BoatsEntity> myBoats    = boatsDao.GetAllBoatsByOwner(member);

            ResponseMessage.Add("BoatsCount", Convert.ToString(myBoats.Count));
        }
        private void LoadSelectedBoat()
        {
            BoatsDao      boatsDao   = new BoatsDaoImpl();
            BoatsEntity   boat       = boatsDao.GetBoatsById(Convert.ToInt32(id));
            MembersDao    membersDao = new MembersDaoImpl();
            MembersEntity member     = membersDao.getMemberByBoat(boat);


            ResponseMessage.Add("BoatName", boat.BoatName);
            ResponseMessage.Add("BoatImage", boat.BoatImage);
            ResponseMessage.Add("BoatType", boat.BoatType);
            ResponseMessage.Add("DailyPrice", Convert.ToString(boat.DailyPrice));
            ResponseMessage.Add("WhereIsNowTheBoat", boat.WhereIsNowTheBoat);
            ResponseMessage.Add("IsLoan", Convert.ToString(boat.IsLoan));
            ResponseMessage.Add("MaxPerson", Convert.ToString(boat.MaxPerson));
            ResponseMessage.Add("MaxSpeed", Convert.ToString(boat.MaxSpeed));
            ResponseMessage.Add("DiveDepth", Convert.ToString(boat.DiveDepth));
            ResponseMessage.Add("Consumption", Convert.ToString(boat.Consumption));
            ResponseMessage.Add("YearOfManufacture", Convert.ToString(boat.YearOfManufacture));
            ResponseMessage.Add("BoatLength", Convert.ToString(boat.BoatLength));
            ResponseMessage.Add("BoatWidth", Convert.ToString(boat.BoatWidth));



            /*Member Adatok, ha az is kellene, például a foglalásnál*/

            ResponseMessage.Add("email", member.Email);
            ResponseMessage.Add("password", member.Password);
            ResponseMessage.Add("permission", member.Permission.ToString());

            char[]   delimiter       = { ' ' };
            string[] memberName      = member.MemberName.Split(delimiter);
            string[] firstnameaArray = memberName.Take(memberName.Count() - 1).ToArray();
            string   firstname       = string.Join(" ", firstnameaArray);
            string   lastname        = memberName.Last();

            ResponseMessage.Add("firstname", firstname);
            ResponseMessage.Add("lastname", lastname);

            ResponseMessage.Add("country", member.Country);
            ResponseMessage.Add("city", member.City);
            ResponseMessage.Add("street", member.Street);
            ResponseMessage.Add("houseNumber", member.HouseNumber);
            ResponseMessage.Add("MemberImage", member.MemberImage);

            /* ^^Member Adatok, ha az is kellene, például a foglalásnál*/
        }
Exemple #5
0
        private void LoadMainTransportData()
        {
            TransportDevicesDao           transportDevicesDao = new TransportDevicesDaoImpl();
            MembersDao                    membersDao          = new MembersDaoImpl();
            MembersEntity                 member       = membersDao.getMemberByEmail(email);
            List <TransportDevicesEntity> myTransports = transportDevicesDao.GetAllTransportDevicesByOwner(member);

            for (int i = 0; i < myTransports.Count; i++)
            {
                ResponseMessage.Add("TransportName" + Convert.ToString(i), myTransports[i].TransportDeviceName);
            }
            for (int i = 0; i < myTransports.Count; i++)
            {
                ResponseMessage.Add("TransportImage" + Convert.ToString(i), myTransports[i].TransportDeviceImage);
            }
            for (int i = 0; i < myTransports.Count; i++)
            {
                ResponseMessage.Add("TransportId" + Convert.ToString(i), Convert.ToString(myTransports[i].TransportDeviceId));
            }
        }
        private void LoadMainBoatData()
        {
            BoatsDao           boatsDao   = new BoatsDaoImpl();
            MembersDao         membersDao = new MembersDaoImpl();
            MembersEntity      member     = membersDao.getMemberByEmail(email);
            List <BoatsEntity> myBoats    = boatsDao.GetAllBoatsByOwner(member);

            for (int i = 0; i < myBoats.Count; i++)
            {
                ResponseMessage.Add("boatName" + Convert.ToString(i), myBoats[i].BoatName);
            }
            for (int i = 0; i < myBoats.Count; i++)
            {
                ResponseMessage.Add("boatImage" + Convert.ToString(i), myBoats[i].BoatImage);
            }
            for (int i = 0; i < myBoats.Count; i++)
            {
                ResponseMessage.Add("boatId" + Convert.ToString(i), Convert.ToString(myBoats[i].BoatId));
            }
        }
        private void LoadSelectedTransportDevice()
        {
            TransportDevicesDao    transportDevicesDao = new TransportDevicesDaoImpl();
            TransportDevicesEntity transportDevice     = transportDevicesDao.GetTransportDevicesById(Convert.ToInt32(id));
            MembersDao             membersDao          = new MembersDaoImpl();
            MembersEntity          member = membersDao.getMemberBTransportDevice(transportDevice);


            ResponseMessage.Add("TransportDeviceName", transportDevice.TransportDeviceName);
            ResponseMessage.Add("CarryingCapacity", Convert.ToString(transportDevice.CarryingCapacity));
            ResponseMessage.Add("TransportDeviceType", Convert.ToString(transportDevice.TransportDeviceType));
            ResponseMessage.Add("TransportDeviceLength", Convert.ToString(transportDevice.TransportDeviceLength));
            ResponseMessage.Add("TransportDeviceWidth", Convert.ToString(transportDevice.TransportDeviceWidth));
            ResponseMessage.Add("TransportDeviceImage", Convert.ToString(transportDevice.TransportDeviceImage));



            /*Member Adatok, ha az is kellene, például a foglalásnál*/

            ResponseMessage.Add("email", member.Email);
            ResponseMessage.Add("password", member.Password);
            ResponseMessage.Add("permission", member.Permission.ToString());

            char[]   delimiter       = { ' ' };
            string[] memberName      = member.MemberName.Split(delimiter);
            string[] firstnameaArray = memberName.Take(memberName.Count() - 1).ToArray();
            string   firstname       = string.Join(" ", firstnameaArray);
            string   lastname        = memberName.Last();

            ResponseMessage.Add("firstname", firstname);
            ResponseMessage.Add("lastname", lastname);

            ResponseMessage.Add("country", member.Country);
            ResponseMessage.Add("city", member.City);
            ResponseMessage.Add("street", member.Street);
            ResponseMessage.Add("houseNumber", member.HouseNumber);
            ResponseMessage.Add("MemberImage", member.MemberImage);

            /* ^^Member Adatok, ha az is kellene, például a foglalásnál*/
        }
Exemple #8
0
        private void LoadUserData()
        {
            MembersDao    membersDao = new MembersDaoImpl();
            MembersEntity member     = membersDao.getMemberByEmail(email);

            ResponseMessage.Add("email", member.Email);
            ResponseMessage.Add("password", member.Password);
            ResponseMessage.Add("permission", member.Permission.ToString());

            char[]   delimiter       = { ' ' };
            string[] memberName      = member.MemberName.Split(delimiter);
            string[] firstnameaArray = memberName.Take(memberName.Count() - 1).ToArray();
            string   firstname       = string.Join(" ", firstnameaArray);
            string   lastname        = memberName.Last();

            ResponseMessage.Add("firstname", firstname);
            ResponseMessage.Add("lastname", lastname);

            ResponseMessage.Add("country", member.Country);
            ResponseMessage.Add("city", member.City);
            ResponseMessage.Add("street", member.Street);
            ResponseMessage.Add("houseNumber", member.HouseNumber);
            ResponseMessage.Add("MemberImage", member.MemberImage);
        }