Exemplo n.º 1
0
 public void DeleteUserLocation(int id)
 {
     //unitOfWork.StartTransaction();
     UserLocationRepository repo = new UserLocationRepository(unitOfWork);
     //UserLocationModel userLocationModel = new UserLocationModel();
     UserLocation userLocation = new UserLocation();
     repo.Delete(x=>x.UserLocationId==id);
     //unitOfWork.Commit();
 }
Exemplo n.º 2
0
 public UserLocationModel FindLocationByUserAndCityId(string userId,int cityId)
 {
     //unitOfWork.StartTransaction();
     UserLocationModel locationModel = new UserLocationModel();
     UserLocationRepository repo = new UserLocationRepository(unitOfWork);
     UserLocation userLocation = new UserLocation();
     userLocation = repo.GetAll(x => x.UserId == userId && x.CityId==cityId).FirstOrDefault();
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(userLocation, locationModel);
     return locationModel;
 }
Exemplo n.º 3
0
 public bool CheckExistance(string userId)
 {
     //unitOfWork.StartTransaction();
     UserLocationRepository repo = new UserLocationRepository(unitOfWork);
     UserLocation userLocation = new UserLocation();
     userLocation = repo.GetAll(x => x.UserId == userId).FirstOrDefault();
     //unitOfWork.Commit();
     if (userLocation !=null)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Exemplo n.º 4
0
 public UserLocationModel UpadteUserLocation(UserLocationModel model)
 {
     //unitOfWork.StartTransaction();
     UserLocationRepository repo = new UserLocationRepository(unitOfWork);
     UserLocation userLocation = new UserLocation();
     userLocation = repo.GetAll().Where(x => x.UserLocationId == model.UserLocationId).FirstOrDefault();
     AutoMapper.Mapper.Map(model, userLocation);
     repo.Update(userLocation);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(userLocation, model);
     return model;
 }
Exemplo n.º 5
0
 public UserLocationModel InsertUserLocation(UserLocationModel locationModel)
 {
     //unitOfWork.StartTransaction();
     UserLocationRepository repo = new UserLocationRepository(unitOfWork);
     //UserLocationModel userLocationModel = new UserLocationModel();
     UserLocation userLocation = new UserLocation();
     AutoMapper.Mapper.Map(locationModel, userLocation);
     userLocation = repo.Insert(userLocation);
     //unitOfWork.Commit();
     AutoMapper.Mapper.Map(userLocation, locationModel);
     return locationModel;
 }