コード例 #1
0
 public void DeleteClientRating(int clientRatingId)
 {
     //unitOfWork.StartTransaction();
     ClientRatingRepository repo = new ClientRatingRepository(unitOfWork);
     repo.Delete(x => x.ClientRatingId == clientRatingId);
     //unitOfWork.Commit();
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 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;
 }