private static List <string> GetTemplates(IRepository2 <HtmlBlock> blockService, int blockId) { return(blockService.GetValues(blockId, x => x.Description).Split(new [] { "</p>" }, StringSplitOptions.RemoveEmptyEntries) .Select(x => x.Remove("<p>").Remove("\n").Remove("\r")) .Where(x => x.Contains("[Date]")).ToList()); }
public static void DeleteAndSubmit <T>(this IRepository2 <T> repository, IEnumerable <T> objList) where T : class { foreach (var obj in objList) { repository.Delete(obj); } repository.SubmitChanges(); }
public TestService(IRepository1 repository1, IRepository2 repository2, IRepository3 repository3, IRepository4 repository4, IRepository5 repository5 ) { this.repository1 = repository1; this.repository2 = repository2; this.repository3 = repository3; this.repository4 = repository4; this.repository5 = repository5; }
public ResearchController( IRepository2 <Research> researchRepository, IRepository <ResearchCategory> researchCategoryRepository, IConfigurationRepository configurationRepository, IDateTimeRepository datetimeRepository, IResearchService researchService) { this._researchRepository = researchRepository; this._researchCategoryRepository = researchCategoryRepository; this._configurationRepository = configurationRepository; this._datetimeRepository = datetimeRepository; this._researchService = researchService; }
public YandexMarketProductService( ICacheManager cacheManager, IRepository2 <YandexMarketProductRecord> productRepository, IYandexMarketCategoryService yandexMarketCategoryService, IProductService productService, IYugCatalogPriceParserService yugCatalogPriceParserService) { this._cacheManager = cacheManager; this._productRepository = productRepository; this._yandexMarketCategoryService = yandexMarketCategoryService; this._productService = productService; _yugCatalogPriceParserService = yugCatalogPriceParserService; }
/// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="specificationAttributeRepository">Specification attribute repository</param> /// <param name="specificationAttributeOptionRepository">Specification attribute option repository</param> /// <param name="productSpecificationAttributeRepository">Product specification attribute repository</param> /// <param name="eventPublisher">Event published</param> /// <param name="dataProvider">data Provider</param> public SpecificationAttributeService(ICacheManager cacheManager, IRepository <SpecificationAttribute> specificationAttributeRepository, IRepository2 <SpecificationAttributeOption> specificationAttributeOptionRepository, IRepository2 <ProductSpecificationAttribute> productSpecificationAttributeRepository, IEventPublisher eventPublisher, IDataProvider dataProvider, IDbContext2 dbContext) { _cacheManager = cacheManager; _specificationAttributeRepository = specificationAttributeRepository; _specificationAttributeOptionRepository = specificationAttributeOptionRepository; _productSpecificationAttributeRepository = productSpecificationAttributeRepository; _eventPublisher = eventPublisher; _dataProvider = dataProvider; _dbContext = dbContext; }
public ForumController( IRepository2 <Forum> forumRepository, IRepository <ForumCategory> forumCategoryRepository, IRepository <Comment> commentRepository, IConfigurationRepository configurationRepository, ICommentService commentService, IDateTimeRepository datetimeRepository, IForumService forumService) { this._forumRepository = forumRepository; this._forumCategoryRepository = forumCategoryRepository; this._commentRepository = commentRepository; this._configurationRepository = configurationRepository; this._commentService = commentService; this._datetimeRepository = datetimeRepository; this._forumService = forumService; }
public CourseController( IDateTimeRepository datetimeRepository, IRepository2 <Course> courseRepository, IRepository2 <PhotoAlbum> photoAlbumRepository, IRepository <CourseCategory> courseCategoryRepository, ICourseService courseService, ICurriculumRepository curriculumRepository, IStudentCourseRepository studentCourseRepository, IRepository <StudentScore> studentScoreRepository, IConfigurationRepository configurationRepository, IPhotoAlbumService photoAlbumService, IRepository <Photo> photoRepository, ICurriculumService curriculumService, IStudentCourseService studentCourseService, IStudentScoreService studentScoreService, IBannerService bannerService, IRepository <Banner> bannerRepository, IRepository <Handout> handoutRepository, IHandoutService handoutService) { this._datetimeRepository = datetimeRepository; this._courseRepository = courseRepository; this._photoAlbumRepository = photoAlbumRepository; this._courseCategoryRepository = courseCategoryRepository; this._courseService = courseService; this._curriculumRepository = curriculumRepository; this._studentCourseRepository = studentCourseRepository; this._studentScoreRepository = studentScoreRepository; this._configurationRepository = configurationRepository; this._photoAlbumService = photoAlbumService; this._photoRepository = photoRepository; this._curriculumService = curriculumService; this._studentCourseService = studentCourseService; this._studentScoreService = studentScoreService; this._bannerService = bannerService; this._bannerRepository = bannerRepository; this._handoutRepository = handoutRepository; this._handoutService = handoutService; }
public SharedController( IEmailSender emailSender, IRepository <Photo> photoRepository, IRepository2 <PhotoAlbum> photoAlbumRepository, IDateTimeRepository datetimeRepository, IConfigurationRepository configRepository, IPhotoAlbumService photoAlbumService, IRepository <Banner> bannerRepository, IBannerService bannerService, IAlumniService alumniService, IRepository <Alumni> alumniRepository) { this._emailSender = emailSender; this._photoRepository = photoRepository; this._photoAlbumRepository = photoAlbumRepository; this._datetimeRepository = datetimeRepository; this._configRepository = configRepository; this._photoAlbumService = photoAlbumService; this._bannerRepository = bannerRepository; this._bannerService = bannerService; this._alumniService = alumniService; this._alumniRepository = alumniRepository; }
public static void InsertAndSubmit <T>(this IRepository2 <T> repository, T obj) where T : class { repository.Insert(obj); repository.SubmitChanges(); }
public void Cleanup() { _service1 = null; _repository1 = null; _repository2 = null; }
public static void DeleteAndSubmit <T>(this IRepository2 <T> repository, T obj) where T : class { repository.Delete(obj); repository.SubmitChanges(); }
public static K FirstOrDefault <T, K>(this IRepository2 <T> repository, Expression <Func <T, bool> > predicate, Expression <Func <T, K> > selector) where T : class { return(repository.GetAll(predicate).Select(selector).FirstOrDefault()); }
public Service1(IRepository1 repository1, IRepository2 repository2) { _repository1 = repository1; _repository2 = repository2; }
public UnitOfWork(RepositoryPtrnContext context) { _context = context; Repo1 = new Repository1(context); Repo2 = new Repository2(context); }
public Service3(IRepository1 repo1, IRepository2 repo2, ITransactionProvider transactionProvider) { _repo1 = repo1; _repo2 = repo2; _transactionProvider = transactionProvider; }
public CourseService(IRepository2 <Course> courseRepository, IStudentCourseRepository studentCourseRepository) { this._userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new SwuDBContext())); this._courseRepository = courseRepository; this._studentCourseRepository = studentCourseRepository; }
private void Button2_Click(object sender, EventArgs e) { //trnglRepository = new StlTriangularRepository<string>(); tetrahedralRepository = new StlTetrahedralRepository <string>(); trinagleRepository = new StlTriangularRepository2 <string>(); List <List <Triangle> > vertebras = new List <List <Triangle> >(); List <Triangle> myvertebra = new List <Triangle>(); myvertebra = ReadVertebra(1, "Vertebras/st1/"); vertebras.Add(myvertebra); //vertebras.Add(ReadVertebra(1, "Vertebras/st2/")); //int countVertebras = 5; //for (int i = 2; i <= countVertebras; i++) //{ // vertebras.Add(ReadVertebra(i, "Vertebras/st2/")); //} List <Triangle> allVertebras = new List <Triangle>(); vertebras.ForEach(trngls => allVertebras.AddRange(trngls)); double shiftX = Math.Abs(allVertebras.Min(tngl => tngl.Center.X)); double shiftY = Math.Abs(allVertebras.Min(tngl => tngl.Center.Y)); double shiftZ = Math.Abs(allVertebras.Min(tngl => tngl.Center.Z)); double minX = allVertebras.Min(tngl => tngl.Center.X); double minY = allVertebras.Min(tngl => tngl.Center.Y); double minZ = allVertebras.Min(tngl => tngl.Center.Z); double maxX = allVertebras.Max(tngl => tngl.Center.X); double maxY = allVertebras.Max(tngl => tngl.Center.Y); double maxZ = allVertebras.Max(tngl => tngl.Center.Z); double avX = (minX + maxX) / 2.0; double avY = (minY + maxY) / 2.0; double lenght = maxX - minX; double width = maxY - minY; width = (lenght > width) ? lenght : width; double height = maxZ - minZ; ShiftModel(ref vertebras, shiftX, shiftY, shiftZ); //ShiftModel(ref disks, shiftX, shiftY, shiftZ); toolStripStatusLabel1.Text = $"Генерация конечно-элементной сетки..."; this.Refresh(); FeModel scene = GenerateTetrahedralModel(width, height + STEP_HEIGHT, STEP_WIDTH, STEP_HEIGHT, VERTEBRA_MATERIAL_ID); model = GetGeneralModelFromScene(scene, vertebras); var aaaaaa = model.Triangles; var bbbbbb = model.Tetrahedrons; //load = new Force(SelectedSide.TOP, new Node((int)avX, (int)avY, maxZ - 10), forceValue, true, model.Triangles); toolStripStatusLabel1.Text = $"Учет граничных условий и внешних нагрузок..."; this.Refresh(); //load = new Force(SelectedSide.TOP, new Node((int)avY, (int)avX, maxZ - 10), forceValue, true, model.Triangles); //load = new Pressure(SelectedSide.TOP, new Node((int)avX, (int)avY, maxZ - 10), forceValue, true, model.Triangles); //load = new ConcentratedForce(SelectedSide.TOP, forceValue, true, model.Nodes, height / 10.0); load = new Force(SelectedSide.TOP, forceValue, true, model.Nodes, height / 18.0); conditions = new VolumeBoundaryCondition(SelectedSide.BOTTOM, model.Nodes, height / 20.0); //conditions = new VolumeBoundaryCondition(SelectedSide.BOTTOM, new Node((int)avX, (int)avY, minZ), model.Triangles); tetrahedralRepository.Create(model.Id + "in", model.Tetrahedrons); int concentratedIndex = load.LoadVectors.FirstOrDefault().Key; int step = (int)(STEP_HEIGHT / 4.0); Node tmpNode = model.Nodes.FirstOrDefault(nd => nd.GlobalIndex == concentratedIndex); List <Node> nearNodes = new List <Node>(model.Nodes.Where(nd => (nd.X > model.Nodes[concentratedIndex].X - step && nd.X < model.Nodes[concentratedIndex].X + step) && (nd.Y > model.Nodes[concentratedIndex].Y - step && nd.Y < model.Nodes[concentratedIndex].Y + step) && (nd.Z > model.Nodes[concentratedIndex].Z - step && nd.Z < model.Nodes[concentratedIndex].Z + step)) .ToList()); nearNodes.Remove(tmpNode); concentratedIndex = TrueIndexOfCenter(concentratedIndex, nearNodes, 0); if (concentratedIndex != load.LoadVectors.FirstOrDefault().Key) { LoadVector vector = new LoadVector(load.LoadVectors.FirstOrDefault().Value.Value, VectorDirection.Z); load.LoadVectors.Clear(); load.LoadVectors.Add(concentratedIndex, vector); } //trnglRepository.Create(model.Id + "in", model.Triangles); //trnglRepository.Create(model.Id + "load", ((Force)load).LoadedTriangles); //trnglRepository.Create(model.Id + "fix", ((VolumeBoundaryCondition)conditions).FixedTriangles); solver = new StressStrainSparseMatrix(model); solution = new StaticMechanicSparseSolution(solver, model); var begin = DateTime.Now; solution.Solve(TypeOfFixation.RIGID, conditions, load); TimeSpan endSolve = DateTime.Now - begin; double[] results = solution.Results; toolStripStatusLabel1.Text = $"Расчет завершен."; this.Refresh(); using (StreamWriter writer = new StreamWriter("results.txt")) { writer.WriteLine($"Total time solving SLAE: {endSolve.TotalSeconds} sec."); writer.WriteLine(); double max = solution.Results[2]; for (int i = 2; i < solution.Results.Length; i += 3) { if (Math.Abs(solution.Results[i]) > Math.Abs(max)) { max = solution.Results[i]; } } writer.WriteLine($"Max deformation: {max} mm."); writer.WriteLine(); for (int i = 0; i < solution.Results.Length; i++) { writer.WriteLine(solution.Results[i]); } } TotalEpure(model.Nodes, solution.Results, "TotalEpureSpine"); List <Tetrahedron> outList = ApplyResultsToTetrahedrons(results); List <Node> nodlist = ApplyResultsToGenList(results); tetrahedralRepository.Create(model.Id + "out", outList); tetrahedralRepository.Create2(model.Id + "out2", outList); trinagleRepository.Create2(model.Id + "out3", myvertebra, nodlist); lastname = model.Id + "out3.stl"; lastname_fullpath = Environment.CurrentDirectory + "\\" + lastname; MessageBox.Show($"Total time solving SLAE: {endSolve.TotalSeconds} sec."); //Process.Start("notepad.exe", "results.txt"); }
public Service2(IRepository2 repository) { _repository = repository; }
public CompanyController(IRepository2 repo) { this.repo = repo; }
public PhotoAlbumService(IRepository2 <PhotoAlbum> photoAlbumRepository) { this._userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new SwuDBContext())); this._photoAlbumRepository = photoAlbumRepository; }
public static IQueryable <CoursePrerequisite> GetCoursePreCourses(IRepository2 <CoursePrerequisite> coursePrerequisiteService, string courseTC) { return(coursePrerequisiteService.GetAll(x => x.Course_TC == courseTC && x.RequiredCourse_TC != null)); }
public TestServices(IUnitOfWork2 unitOfWork, IRepository2 <Test> imeiReponsitory) { _unitOfWork = unitOfWork; _imeiReponsitory = imeiReponsitory; }
public void Setup() { _repository1 = new Repository1TestImplementation(); _repository2 = new Repository2TestImplementation(); _service1 = new Service1(_repository1, _repository2); }
public IPOController(IRepository2 repo) { this.repo = repo; }
public static IQueryable <T> GetAll <T>(this IRepository2 <T> repository, Expression <Func <T, bool> > predicate) where T : class { return(repository.GetAll().Where(predicate)); }
public static T FirstOrDefault <T>(this IRepository2 <T> repository, Expression <Func <T, bool> > predicate) where T : class { return(repository.GetAll().FirstOrDefault(predicate)); }
public HomeController(IApplicationUserServices applicationUserServices, IRepository2 <Course> courseRepository) { }
public Stuff2(IRepository2 repository2) { _repository2 = repository2; }