Exemplo n.º 1
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;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
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;
 }