Exemple #1
0
        public AracTakibi()
        {
            InitializeComponent();

            loginService    = new LoginServiceSoapClient();
            vehicleService  = new VehicleServiceServiceSoapClient();
            CustomerService = new CustomerServiceSoapClient();
            rentService     = new RentServiceSoapClient();
        }
Exemple #2
0
        public MusteriIstekleri()
        {
            InitializeComponent();

            loginService    = new LoginServiceSoapClient();
            vehicleService  = new VehicleServiceServiceSoapClient();
            CustomerService = new CustomerServiceSoapClient();
            rentService     = new RentServiceSoapClient();

            List <VehicleInformation> vehicles = vehicleService.GetAll().ToList();
            List <RentServiceReference.Rentalinformation> rents = rentService.GetAll().ToList();

            List <Models.RentRequestViewModel> requests = new List <Models.RentRequestViewModel>(); //musteriistekleri icin
            List <Models.RentRequestViewModel> renteds  = new List <Models.RentRequestViewModel>(); //kiralanan araclaricin

            foreach (var rent in rents)
            { //customer get eklemis
                MusteriServiceReference.Customer           cust    = CustomerService.Get(rent.CustomerID);
                VehicleServiceReference.VehicleInformation vehicle = vehicleService.Get(rent.VehicleID);

                Models.RentRequestViewModel req = new Models.RentRequestViewModel();
                req.Id           = rent.Id;
                req.CustomerName = cust.Name + " " + cust.Surname;
                req.TCNumber     = cust.TCNumber;
                req.HowManyDays  = rent.HowManyDays;
                req.VehicleName  = vehicle.Name + " " + vehicle.Model;

                if (rent.IsActive)
                {
                    renteds.Add(req);
                }
                else
                {
                    requests.Add(req);
                }
            }


            dataGridMusteri.DataSource = (object)requests;
        }