public void DeleteClientRating(int clientRatingId) { //unitOfWork.StartTransaction(); ClientRatingRepository repo = new ClientRatingRepository(unitOfWork); repo.Delete(x => x.ClientRatingId == clientRatingId); //unitOfWork.Commit(); }
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 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 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 SaveClientRating(ClientRatingModel model) { //unitOfWork.StartTransaction(); ClientRatingRepository repo = new ClientRatingRepository(unitOfWork); ClientRating rating = new ClientRating(); AutoMapper.Mapper.Map(model, rating); repo.Insert(rating); //unitOfWork.Commit(); AutoMapper.Mapper.Map(rating, model); return model; }
public List<ClientRatingModel> GetClientRatingListByJobIds(string[] JobIds) { //unitOfWork.StartTransaction(); ClientRatingRepository repoClient = new ClientRatingRepository(unitOfWork); List<ClientRatingModel> ratingModel = new List<ClientRatingModel>(); List<ClientRating> rating = new List<ClientRating>(); rating = repoClient.GetAllIncluding("Job.Employee").Where(x => JobIds.Contains(x.JobId.ToString())).ToList(); //unitOfWork.Commit(); //rating = repo.GetAll().Where(x => x.JobId == JobId).ToList(); 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; }