private void createWord(int id) { //int level = judgeLevel(id); int level = CompanyManager.getSingleton().GetCompanyLevel(id) + 1; CreateCompany createCompany = null; if (level == 1) //省级公司 { createCompany = DocFactory.createcompany(DocCompanyType.Provice, docCompilationListener); } else if (level == 2) //市级公司 { createCompany = DocFactory.createcompany(DocCompanyType.City, docCompilationListener); } else if (level == 3) //县级公司 { createCompany = DocFactory.createcompany(DocCompanyType.Country, docCompilationListener); } if (createCompany == null) { return; } createCompany.CompanyID = id; createCompany.CompanyName = CompanyName; createCompany.Childcompany = DBhelper.GetChildcompany(id); createCompany.createword(WordPath); }
public MainWindow() { InitializeComponent(); var carFactory = new CarFactory(WIDTH, HEIGHT); var cars = carFactory.Create(5); var docFactory = new DocFactory(WIDTH, HEIGHT); var docs = docFactory.Create(500); var calculator = new Calculator(); var routes = calculator.CalcRoutes(docs, cars); var imageFactory = new ImageFactory(WIDTH, HEIGHT); var mainWindowViewModel = new MainWindowViewModel(routes, imageFactory); this.DataContext = mainWindowViewModel; }
private static void Main(string[] args) { IConfiguration config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); var directoryPath = config.GetValue <string>("DirectoryPath"); var client = new ElasticClientFactory(config).CreateElasticClient(); var queryCreator = new QueryCreator(); var searcher = new Searcher(client, queryCreator, Index); var consoleView = new ConsoleView(); var controller = new Controller(consoleView, searcher); if (!IsIndexExisting(Index, client)) { var indexCreator = new IndexCreator(client); indexCreator.CreateIndex(Index); var fileReader = new DocFileReader(); var docCreator = new DocFactory(fileReader); var importer = new Importer <Doc>(client); importer.Import(docCreator.GetAllDocuments(directoryPath), Index); } controller.Run(); }
static void Main(string[] args) { var carFactory = new CarFactory(WIDTH, HEIGHT); var cars = carFactory.Create(5); var docFactory = new DocFactory(WIDTH, HEIGHT); var docs = docFactory.Create(500); var calculator = new Calculator(); var routes = calculator.CalcRoutes(docs, cars); var array = new int[WIDTH, HEIGHT]; int index = 1; foreach (var route in routes) { foreach (var doc in route.Docs) { array[(int)doc.Lon, (int)doc.Lat] = index; } index++; } for (int i = 0; i < WIDTH; i++) { for (int j = 0; j < HEIGHT; j++) { Console.Write($"{array[i,j]} "); } Console.WriteLine(); } Console.ReadLine(); }
public DocService(string numeroDoDocumento) { this.documento = DocFactory.Gerar(typeof(DocType), numeroDoDocumento); }
public DocFactoryTest() { _fileReader = Substitute.For <IFileReader>(); _sut = new DocFactory(_fileReader); }