public List<ClientRatingModel> GetClientRatingListByJobId(int JobId) { //unitOfWork.StartTransaction(); ClientRatingRepository repo = new ClientRatingRepository(unitOfWork); List<ClientRatingModel> ratingModel = new List<ClientRatingModel>(); List<ClientRating> rating = new List<ClientRating>(); AutoMapper.Mapper.Map(ratingModel, rating); rating = repo.GetAll().Where(x => x.JobId == JobId).ToList(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(rating, ratingModel); return ratingModel; }
public List<ClientRatingModel> GetAllClientRatings() { //unitOfWork.StartTransaction(); ClientRatingRepository repo = new ClientRatingRepository(unitOfWork); List<ClientRatingModel> clientRatingModelList = new List<ClientRatingModel>(); List<ClientRating> rating = new List<ClientRating>(); AutoMapper.Mapper.Map(clientRatingModelList, rating); rating = repo.GetAll().OrderByDescending(x=>x.ClientRatingId).ToList(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(rating, clientRatingModelList); return clientRatingModelList; }
public ClientRatingModel GetClientRatingByJobId(int JobId) { //unitOfWork.StartTransaction(); ClientRatingRepository repo = new ClientRatingRepository(unitOfWork); ClientRatingModel ratingModel = new ClientRatingModel(); ClientRating rating = new ClientRating(); AutoMapper.Mapper.Map(ratingModel, rating); rating = repo.GetAll().Where(x => x.JobId == JobId).FirstOrDefault(); //unitOfWork.Commit(); AutoMapper.Mapper.Map(rating, ratingModel); return ratingModel; }
public ClientRatingModel UpadteClientRating(ClientRatingModel model) { //unitOfWork.StartTransaction(); ClientRatingRepository repo = new ClientRatingRepository(unitOfWork); ClientRating rating = new ClientRating(); rating = repo.GetAll().Where(x => x.ClientRatingId == model.ClientRatingId).FirstOrDefault(); AutoMapper.Mapper.Map(model, rating); repo.Update(rating); //unitOfWork.Commit(); AutoMapper.Mapper.Map(rating, model); return model; }