public bool SaveMSReviewerSuggestion(DTOs.MSReviewerSuggestionDTO msReviewerSuggestionDTO, IDictionary <string, string> dataErrors) { if (msReviewerSuggestionDTO.MSReviewersSuggestion.RoleID == 2)//todo: set constants for roles { msReviewerSuggestionDTO.MSReviewersSuggestion.QualityUserID = msReviewerSuggestionDTO.CurrentUserID; } ReviewerSuggestionUnitOfWork _reviewerSuggestionUnitOfWork = null; try { _reviewerSuggestionUnitOfWork = new ReviewerSuggestionUnitOfWork(_ConStringWrite); _reviewerSuggestionUnitOfWork.msReviewerSuggestionDTO = msReviewerSuggestionDTO; _reviewerSuggestionUnitOfWork.SaveMSReviewerSuggestion(); _reviewerSuggestionUnitOfWork.SaveChanges();//todo:change this function to update ids and save as seperate commit return(true); } //exception will be raised up in the call stack finally { if (_reviewerSuggestionUnitOfWork != null) { _reviewerSuggestionUnitOfWork.Dispose(); } } }
public DTOs.MSReviewerSuggestionDTO GetMSReviewerSuggestionDefaultDTO() { DTOs.MSReviewerSuggestionDTO reviewerSuggestionDTO = new DTOs.MSReviewerSuggestionDTO(); //reviewerSuggestionDTO.ErrorCategoriesList = _manuscriptDBRepositoryReadSide.GetErrorCategoryList(); reviewerSuggestionDTO.ErrorCategoriesList = msReviewerSuggestionDBRepositoryReadSide.GetReviewerErrorCategoryList(); return(reviewerSuggestionDTO); }
public DTOs.MSReviewerSuggestionDTO GetReviewerSuggetionDefaultDTO() { var reviewerSuggestionDTO = new DTOs.MSReviewerSuggestionDTO(); //reviewerSuggestionDTO.ErrorCategoriesList = _manuscriptDBRepositoryReadSide.GetErrorCategoryList(); reviewerSuggestionDTO.ErrorCategoriesList = msReviewerSuggestionDBRepositoryReadSide.GetReviewerErrorCategoryList(); //reviewerSuggestionDTO.UserName = _manuscriptDBRepositoryReadSide.EmployeeName(userID); return(reviewerSuggestionDTO); }
public DTOs.MSReviewerSuggestionDTO GetMSReviewerSuggestionDTO(int reviewerID) { DTOs.MSReviewerSuggestionDTO msReviewerSuggestionDTO = GetMSReviewerSuggestionDefaultDTO(); msReviewerSuggestionDTO.MSReviewersSuggestion = msReviewerSuggestionDBRepositoryReadSide.GetManuscriptByID(reviewerID); msReviewerSuggestionDTO.MSReviewerErrorCategory = msReviewerSuggestionDBRepositoryReadSide.GetErrorCategoryList(reviewerID); return(msReviewerSuggestionDTO); }
public DTOs.MSReviewerSuggestionDTO GetReviewerSuggestionDTO(int?reviewerID) { DTOs.MSReviewerSuggestionDTO reviewerDTO = GetMSReviewerSuggestionDefaultDTO(); List <DTOs.ReviewerDetailsDTO> reviewerDetailsList = new List <DTOs.ReviewerDetailsDTO>(); reviewerDTO.MSReviewersSuggestion = msReviewerSuggestionDBRepositoryReadSide.GetManuscriptByID(reviewerID); reviewerDTO.msReviewerInfo = msReviewerSuggestionDBRepositoryReadSide.GetMSReviewers(reviewerDTO.MSReviewersSuggestion.ID, reviewerDTO.MSReviewersSuggestion.MSID); foreach (var reviewerInfo in reviewerDTO.msReviewerInfo) { DTOs.ReviewerDetailsDTO reviewerDetailsDTO = new DTOs.ReviewerDetailsDTO(); reviewerDetailsDTO.ReviewerMaster = msReviewerSuggestionDBRepositoryReadSide.GetReviewerDetails(reviewerInfo.ReviewerMasterID); reviewerDetailsDTO.department = msReviewerSuggestionDBRepositoryReadSide.GetDepartmentDetails(reviewerInfo.DeptID); reviewerDetailsDTO.institude = msReviewerSuggestionDBRepositoryReadSide.GetInstituteDetails(reviewerInfo.InstitutionID); reviewerDetailsDTO.msReviewerInfoID = reviewerInfo.ID; List <pr_LocationInfo_Result> locationDetails = new List <pr_LocationInfo_Result>(); if (reviewerInfo.CityID != null) { locationDetails = msReviewerSuggestionDBRepositoryReadSide.GetLocationDetails(reviewerInfo.CityID); if (locationDetails.Count > 0) { reviewerDetailsDTO.country = locationDetails[0].CountryName; reviewerDetailsDTO.city = locationDetails[0].CityName; reviewerDetailsDTO.state = locationDetails[0].StateName; } }// added by Sambhaji Andhare. else { locationDetails = msReviewerSuggestionDBRepositoryReadSide.GetLocationDetailsForCleanData(reviewerInfo.ReviewerMasterID); if (locationDetails.Count > 0) { reviewerDetailsDTO.country = locationDetails[0].CountryName; reviewerDetailsDTO.city = locationDetails[0].CityName; reviewerDetailsDTO.state = locationDetails[0].StateName; } } reviewerDetailsDTO.msReviewerMails = msReviewerSuggestionDBRepositoryReadSide.GetMSSReviewerMails(reviewerInfo.ID); reviewerDetailsDTO.msReviewerLinks = msReviewerSuggestionDBRepositoryReadSide.GetMSReviewerLinks(reviewerInfo.ID); reviewerDetailsDTO.msAreaOfExpertises = msReviewerSuggestionDBRepositoryReadSide.GetMSSAreaOfExpertise(reviewerInfo.ID); reviewerDetailsList.Add(reviewerDetailsDTO); } reviewerDTO.reviewerDetailsDTO = reviewerDetailsList; reviewerDTO.MSReviewerErrorCategory = msReviewerSuggestionDBRepositoryReadSide.GetErrorCategoryList(reviewerID); return(reviewerDTO); }