public RegionService(ICountryService countryService, ICodeGeneratorService codeGenService, IRegionRepository regionRepository, IBaseEntityRepository <Region> baseEntityRepository) : base(baseEntityRepository) { _baseEntityRepository = baseEntityRepository; _regionRepository = regionRepository; _codeGenService = codeGenService; _countryService = countryService; }
public EleDuplicateController(ApplicationDbContext context, UserManager <UserInfo> userManager, IAppSession Session, ICodeGeneratorService codeGeneratorService) { this.context = context; this.userManager = userManager; this.Session = Session; this.codeGeneratorService = codeGeneratorService; }
public AnchorService(ICodeGeneratorService codeGeneratorService, UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager, IPasswordGeneratorService codeGenerator, IAnchorRepository anchorRepository, IBaseEntityRepository <Anchor> baseEntityRepository) : base(baseEntityRepository) { _userManager = userManager; _roleManager = roleManager; _anchorRepository = anchorRepository; _baseEntityRepository = baseEntityRepository; _codeGenerator = codeGenerator; _codeGeneratorService = codeGeneratorService; }
public LcdaController(ILcdaService lcdaService, ICodeGeneratorService codeGeneratorService, IUserService userService, IUserLcdaService userLcdaService) { _lcdaService = lcdaService; _codeGenerationService = codeGeneratorService; _userService = userService; _userLcdaService = userLcdaService; }
public override void GenerateCode(ICodeGeneratorService codeGenSvc) { codeGenSvc.BeginIf(Code); TrueInstructions.GenerateCode(codeGenSvc); if (FalseInstructions.HasInstructions) { codeGenSvc.Else(); FalseInstructions.GenerateCode(codeGenSvc); } codeGenSvc.EndIf(); }
public void SetUp() { _connectionString = "Data Source=ky1-vrt-msqld1.ky.cafepress.com;" + "Initial Catalog=transit;User ID=cpdba;Password=ithinkgreen"; _modelPropertyControllerMock = new Mock <IModelPropertyController>(MockBehavior.Strict); _dbSysUtilsMock = new Mock <IDbSysUtils>(MockBehavior.Strict); _target = new TableModelGenerator(_connectionString, _modelPropertyControllerMock.Object, _dbSysUtilsMock.Object); _testTables = new List <string>( new[] { "RATE_GROUP_DEF" } ); _testModelProperties = new List <ModelProperty> { new ModelProperty { PropertyDataType = "int", PropertyName = "RATE_GROUP_CODE", IsNullable = false }, new ModelProperty { PropertyDataType = "int", PropertyName = "SERVICE_LEVEL_NO", IsNullable = false }, new ModelProperty { PropertyDataType = "string", PropertyName = "RATE_GROUP_DESCRIPTION", IsNullable = false }, new ModelProperty { PropertyDataType = "string", PropertyName = "USER_ID", IsNullable = false }, new ModelProperty { PropertyDataType = "DateTimeOffset", PropertyName = "RECORD_INSERT_TIMESTAMP", IsNullable = false } }; _dbObjectName = "GET_RATE_GROUP_BY_GROUP_CODE"; }
public UserController(IUserService userService, ITemplateService templateService, IConfiguration configuration, IVerificationService verificationService, ICodeGeneratorService codeGeneratorService, IEmailService emailService) { _userService = userService; _configuration = configuration; _verificationService = verificationService; _codeGenerationService = codeGeneratorService; _templateService = templateService; _emailService = emailService; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ICodeGeneratorService codeGenerator, ICodeAccessService accessService, IOptions <ProjectOptions> options) { _codeGenerator = codeGenerator; _accessService = accessService; _options = options.Value; loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.Use(async(context, next) => { if (!_accessService.IsGeneratedCodeExists()) { var codes = _codeGenerator.GenerateMany(_options.CodesCount); _accessService.Write(codes); } await next.Invoke(); }); //app.UseCodeGeneratorMiddleware(); //app.UseMvc(); app.Run(async(context) => { string path = context.Request.Path; if (path.Contains("/api/code/")) { int id; if (int.TryParse(path.Substring(path.LastIndexOf('/') + 1), out id)) { await context.Response.WriteAsync(_accessService.Get(id)); } } else { await context.Response.WriteAsync("Error"); } }); //app.Run(async (context) => //{ // await context.Response.WriteAsync("Hey hey/!"); //}); }
/// <summary> /// 点击生成按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGenerator_Click(object sender, EventArgs e) { IList <TableInfo> tables = new List <TableInfo>(); foreach (DataGridViewRow row in dgvTable.Rows) { DataGridViewCheckBoxCell checkCell = row.Cells[2] as DataGridViewCheckBoxCell; if (checkCell.Value != null && Convert.ToBoolean(checkCell.Value)) { tables.Add(row.DataBoundItem as TableInfo); } } if (tables.Count == 0) { MessageBox.Show("请勾选要生成的表"); return; } FunctionType[] functionTypes = GetFunctionTypes(); if (functionTypes.Length == 0) { MessageBox.Show("请勾选要生成的功能项"); return; } if (string.IsNullOrWhiteSpace(txtNamespacePfx.Text)) { MessageBox.Show("命名空间前辍不能为空"); return; } Cursor.Current = Cursors.WaitCursor; ICodeGeneratorService generatorService = AutofacTool.Resolve <ICodeGeneratorService>(); ReturnInfo <bool> returnInfo = generatorService.Generator(tables, functionTypes, txtNamespacePfx.Text, dgvTable.Tag.ToString()); Cursor.Current = Cursors.Default; if (returnInfo.Success()) { MessageBox.Show("生成成功"); } else { MessageBox.Show(returnInfo.Msg); } }
public AuthController(IUserService userService, IEncryptionService encryptionService, ITemplateService templateService, IJwtService jwtService, IAuthService authService, IVerificationService verificationService, IConfiguration configuration, IEmailService emailService, ICodeGeneratorService codeGenerationService) { _userService = userService; _encryptionService = encryptionService; _jwtService = jwtService; _authService = authService; _templateService = templateService; _verificationService = verificationService; _configuration = configuration; _emailService = emailService; _codeGenerationService = codeGenerationService; }
public override void GenerateCode(ICodeGeneratorService codeGenSvc) { codeGenSvc.Statement(Code); }
public ControllersConvention(ICodeGeneratorService codeGeneratorService, IModelFactory factory) { this.codeGeneratorService = codeGeneratorService; this.factory = factory; }
public UnitTestsConvention(ICodeGeneratorService codeGeneratorService, IModelFactory factory) { this.codeGeneratorService = codeGeneratorService; this.factory = factory; }
public ViewsConvention(ICodeGeneratorService codeGeneratorService, IModelFactory factory) { this.factory = factory; this.codeGeneratorService = codeGeneratorService; }
public CodeGeneratorController(Destiny.Core.Flow.CodeGenerator.ICodeGenerator codeGenerator, ICodeGeneratorService codeGeneratorService) { _codeGenerator = codeGenerator; _codeGeneratorService = codeGeneratorService; }
public GeneratedViewModelsConvention(ICodeGeneratorService codeGeneratorService) { this.codeGeneratorService = codeGeneratorService; }
public EntityTypeService(ICodeGeneratorService codeGen, IBaseEntityRepository <EntityType> baseRepository) : base(baseRepository) { _baseRepository = baseRepository; _codeGen = codeGen; }
public ViewsConvention(ICodeGeneratorService codeGeneratorService, IModelFactory factory) { this.factory = factory; this.codeGeneratorService = codeGeneratorService; }
/// <summary> /// handles the flow of user selection for code generator/reader /// </summary> /// <param name="codeReaderService"></param> /// <param name="codeGeneratorService"></param> /// <param name="configuration"></param> /// <param name="userSelection"></param> public static void ProcessUserSelection(ICodeReaderService codeReaderService, ICodeGeneratorService codeGeneratorService, IConfigurationRoot configuration, ConsoleKeyInfo userSelection, ILogger logger) { switch (userSelection.KeyChar) { case '1': codeReaderService.ReadCode(configuration, logger); break; case '2': codeGeneratorService.GenerateCode(configuration, logger); break; default: break; } }
public CountryService(ICodeGeneratorService codeGenerator, ICountryRepository countryRepository, IBaseEntityRepository <Country> baseEntityRepository) : base(baseEntityRepository) { _baseEntityRepository = baseEntityRepository; _countryRepository = countryRepository; _codeGenerator = codeGenerator; }
public CatalogService(IAnchorService anchorService, ICodeGeneratorService codeGeneratorService, IBaseRepository <Catalog> baseRepository) : base(baseRepository) { _baseRepository = baseRepository; _codeGeneratorService = codeGeneratorService; _anchorService = anchorService; }
public OrderList(IMapper mapper, ICodeGeneratorService codeGeneratorService, IOrdersDbContext orderDbContext) { _mapper = mapper; _orderDbContext = orderDbContext; _codeGeneratorService = codeGeneratorService; }
public void GenerateCode(ICodeGeneratorService codeGenSvc) { instructions.ForEach(inst => inst.GenerateCode(codeGenSvc)); }
/// <summary> /// 点击生成按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGenerator_Click(object sender, EventArgs e) { var param = new CodeGeneratorParamInfo(); try { param.Tables = new List <TableInfo>(); foreach (DataGridViewRow row in dgvTable.Rows) { DataGridViewCheckBoxCell checkCell = row.Cells[2] as DataGridViewCheckBoxCell; if (checkCell.Value != null && Convert.ToBoolean(checkCell.Value)) { param.Tables.Add(row.DataBoundItem as TableInfo); } } if (param.Tables.Count == 0) { MessageBox.Show("请勾选要生成的表"); return; } param.FunctionTypes = GetFunctionTypes(); if (param.FunctionTypes.Length == 0) { MessageBox.Show("请勾选要生成的功能项"); return; } if (string.IsNullOrWhiteSpace(txtNamespacePfx.Text)) { MessageBox.Show("命名空间前辍不能为空"); return; } param.NamespacePfx = txtNamespacePfx.Text; switch (cbxPKType.SelectedItem.ToString()) { case "字符串": param.PkType = PrimaryKeyType.STRING; break; case "Guid": param.PkType = PrimaryKeyType.GUID; break; case "雪花算法": param.PkType = PrimaryKeyType.SNOWFLAKE; break; } param.Type = dgvTable.Tag.ToString(); param.IsTenant = cbxIsTenant.Checked; Cursor.Current = Cursors.WaitCursor; ICodeGeneratorService generatorService = AutofacTool.Resolve <ICodeGeneratorService>(); ReturnInfo <bool> returnInfo = generatorService.Generator(param); Cursor.Current = Cursors.Default; if (returnInfo.Success()) { MessageBox.Show("生成成功"); } else { MessageBox.Show(returnInfo.Msg); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public SupplierService(ICodeGeneratorService codeGeneratorService, IBaseEntityRepository <Supplier> baseEntityRepository, ISupplierRepository supplierRepository) : base(baseEntityRepository) { _supplierRepository = supplierRepository; _baseEntityRepository = baseEntityRepository; _codeGeneratorService = codeGeneratorService; }
public PartialViewModelsConvention(ICodeGeneratorService codeGeneratorService) { this.codeGeneratorService = codeGeneratorService; }
public abstract void GenerateCode(ICodeGeneratorService codeGenSvc);
public CodeGeneratorController(ICodeGeneratorService codeGeneratorService, ILogger <LookupController> logger) { this.codeGeneratorService = codeGeneratorService; _logger = logger; }
public override void GenerateCode(ICodeGeneratorService codeGenSvc) { codeGenSvc.BeginFor(Code); LoopInstructions.GenerateCode(codeGenSvc); codeGenSvc.EndFor(); }
public UnitTestsConvention(ICodeGeneratorService codeGeneratorService, IModelFactory factory) { this.codeGeneratorService = codeGeneratorService; this.factory = factory; }
public ProductManager(IProductDal productDal, ICodeGeneratorService codeGeneratorService) { _productDal = productDal; _codeGeneratorService = codeGeneratorService; }
public ControllersConvention(ICodeGeneratorService codeGeneratorService, IModelFactory factory) { this.codeGeneratorService = codeGeneratorService; this.factory = factory; }