Exemple #1
0
        public void EditVehicule(VehiculeModel Vehi, string lat, string lon)
        {
            ProductCoordinateModel coor = dbb.ProductCoordinates.Find(Vehi.Coordinate.id);

            coor.Lat = lat;
            coor.Lon = lon;

            CategoryModel cate = dbb.Categories.FirstOrDefault(s => s.CategoryName == Vehi.Category.CategoryName);

            VehiculeModel model = dbb.Vehicules.FirstOrDefault(s => s.id == Vehi.id);

            model.id                   = Vehi.id;
            model.Title                = Vehi.Title;
            model.Description          = Vehi.Description;
            model.TypeVehicule         = Vehi.TypeVehicule;
            model.Town                 = Vehi.Town;
            model.Price                = Vehi.Price;
            model.Street               = Vehi.Street;
            model.BrandVehicule        = Vehi.BrandVehicule;
            model.ModelVehicule        = Vehi.ModelVehicule;
            model.RubriqueVehicule     = Vehi.RubriqueVehicule;
            model.PetrolVehicule       = Vehi.PetrolVehicule;
            model.FirstYearVehicule    = Vehi.FirstYearVehicule;
            model.YearVehicule         = Vehi.YearVehicule;
            model.MileageVehicule      = Vehi.MileageVehicule;
            model.NumberOfDoorVehicule = Vehi.NumberOfDoorVehicule;
            model.ColorVehicule        = Vehi.ColorVehicule;
            model.GearBoxVehicule      = Vehi.GearBoxVehicule;
            //model.ModelAccessoryAutoVehicule = Vehi.ModelAccessoryAutoVehicule;
            //model.ModelAccessoryBikeVehicule = Vehi.ModelAccessoryBikeVehicule;
            model.DateAdd        = DateTime.Now;
            model.SearchOrAskJob = Vehi.SearchOrAskJob;

            dbb.SaveChanges();
        }
Exemple #2
0
        public void EditMultimedia(MultimediaModel multi, string lat, string lon)
        {
            ProductCoordinateModel coor = dbb.ProductCoordinates.Find(multi.id);

            coor.Lat = lat;
            coor.Lon = lon;

            CategoryModel cate = dbb.Categories.FirstOrDefault(s => s.CategoryName == multi.Category.CategoryName);

            MultimediaModel model = dbb.Multimedia.FirstOrDefault(s => s.id == multi.id);

            model.Title          = multi.Title;
            model.SearchOrAskJob = multi.SearchOrAskJob;
            model.Price          = multi.Price;
            model.Street         = multi.Street;
            model.Town           = multi.Town;
            model.Coordinate     = coor;
            model.User           = multi.User;
            model.Type           = multi.Type;
            model.Brand          = multi.Brand;
            model.Model          = multi.Model;
            model.Capacity       = multi.Capacity;
            model.DateAdd        = multi.DateAdd;
            model.Category       = cate;
            model.Images         = multi.Images;
            model.Description    = multi.Description;

            dbb.SaveChanges();
        }
Exemple #3
0
        public void EditApartment(ApartmentRentalModel apart, string lat, string lon)
        {
            ProductCoordinateModel coor = dbb.ProductCoordinates.Find(apart.Coordinate.id);

            coor.Lat = lat;
            coor.Lon = lon;

            CategoryModel cate = dbb.Categories.FirstOrDefault(s => s.CategoryName == apart.Category.CategoryName);

            ApartmentRentalModel model = dbb.ApartmentRentals.FirstOrDefault(s => s.id == apart.id);

            model.Title          = apart.Title;
            model.SearchOrAskJob = apart.SearchOrAskJob;
            model.Price          = apart.Price;
            model.Street         = apart.Street;
            model.Town           = apart.Town;
            model.Coordinate     = coor;
            model.User           = apart.User;
            model.FurnitureOrNot = apart.FurnitureOrNot;
            model.RoomNumber     = apart.RoomNumber;
            model.ApartSurface   = apart.ApartSurface;
            model.DateAdd        = apart.DateAdd;
            model.Category       = cate;
            model.Images         = apart.Images;
            model.Description    = apart.Description;

            dbb.SaveChanges();
        }
Exemple #4
0
        public void EditJob(JobModel job, string lat, string lon)
        {
            //foreach (var image in job.Images)
            //{
            //    var img = dbb.Images.Where(s => s.ProductId == job.id);
            //    foreach (var im in img)
            //    {
            //        im.Image = image.Image;
            //    }

            //}
            ProductCoordinateModel coor = dbb.ProductCoordinates.Find(job.Coordinate.id);

            coor.Lat = lat;
            coor.Lon = lon;

            CategoryModel cate = dbb.Categories.FirstOrDefault(s => s.CategoryName == job.Category.CategoryName);

            JobModel model = dbb.Jobs.FirstOrDefault(s => s.id == job.id);

            model.Title          = job.Title;
            model.SearchOrAskJob = job.SearchOrAskJob;
            model.Price          = job.Price;
            model.Street         = job.Street;
            model.Town           = job.Town;
            model.Coordinate     = coor;
            model.User           = job.User;
            model.TypeContract   = job.TypeContract;
            model.ActivitySector = job.ActivitySector;
            model.DateAdd        = job.DateAdd;
            model.Category       = cate;
            model.Images         = job.Images;
            model.Description    = job.Description;
            dbb.SaveChanges();
        }
Exemple #5
0
        public void AddHouse(HouseModel model, string lat, string lon)
        {
            CategoryModel category = new CategoryModel
            {
                CategoryName = model.Category.CategoryName,
            };

            // dbb.Categories.Add(category);
            model.Category = category;

            ProductCoordinateModel coordinate = new ProductCoordinateModel
            {
                Lat = lat,
                Lon = lon
            };

            // dbb.ProductCoordinates.Add(coordinate);
            model.Coordinate = coordinate;

            dbb.Houses.Add(model);
            dbb.SaveChanges();
        }
Exemple #6
0
        public void AddJob(JobModel job, string lat, string lon)
        {
            CategoryModel category = new CategoryModel
            {
                CategoryName = job.Category.CategoryName,
            };

            // dbb.Categories.Add(category);
            job.Category = category;

            ProductCoordinateModel coordinate = new ProductCoordinateModel
            {
                Lat = lat,
                Lon = lon
            };

            // dbb.ProductCoordinates.Add(coordinate);
            job.Coordinate = coordinate;

            dbb.Jobs.Add(job);
            dbb.SaveChanges();
        }
Exemple #7
0
        public void AddAppartment(ApartmentRentalModel apart, string lat, string lon)
        {
            CategoryModel category = new CategoryModel
            {
                CategoryName = apart.Category.CategoryName,
            };

            // dbb.Categories.Add(category);
            apart.Category = category;

            ProductCoordinateModel coordinate = new ProductCoordinateModel
            {
                Lat = lat,
                Lon = lon
            };

            // dbb.ProductCoordinates.Add(coordinate);
            apart.Coordinate = coordinate;

            dbb.ApartmentRentals.Add(apart);
            dbb.SaveChanges();
        }