public OrderEditControl() { InitializeComponent(); _context = new BadgerDataModel(); _orderService = new OrdersService(_context); _partService = new PartsService(_context); //disable AutoGenerate Columns on grids dgOrderLineItem.AutoGenerateColumns = false; dgOrderFees.AutoGenerateColumns = false; dgAttachments.AutoGenerateColumns = false; // Event wiring ------------------------------------------------------------------- dgOrderLineItem.DataError += DgOrderLineItem_DataError; dgOrderLineItem.CellValidating += DgOrderLineItem_CellValidating; dgOrderLineItem.CellEndEdit += DgOrderLineItem_CellEndEdit; dgOrderLineItem.CellValueChanged += DgOrderLineItem_CellValueChanged; bslineItems.ListChanged += BslineItems_ListChanged; bsOrderFees.ListChanged += BsOrderFees_ListChanged; bsAttachments.ListChanged += BsAttachments_ListChanged; partFinderControl1.OnJobPartAdded += PartFinderControl1_OnJobPartAdded; partFinderControl1.OnPartAdded += PartFinderControl1_OnPartAdded; // Event Wiring ------------------------------------------------------------------- InitializeGrid(); btnSave.Enabled = _isDirty; }
public PartsReturnController() { _partsReturnService = new PartsReturnService(); _supplierService = new SupplierService(); _warehouseService = new WarehouseService(); _partsService = new PartsService(); }
public PlayerController(IWaresService waresService, IPartsService partsService, IPlayersService playersService, IMapper mapper) { this.waresService = waresService; this.partsService = partsService; this.playersService = playersService; this.mapper = mapper; }
public BikesController(IAttemptsService attemptsService, IPlayersService playersService, IBikesService bikesService, IPartsService partsService, IMapper mapper) { this.attemptsService = attemptsService; this.playersService = playersService; this.bikesService = bikesService; this.partsService = partsService; this.mapper = mapper; }
public PartEditor(BadgerDataModel ctx) { InitializeComponent(); dgPartsList.AutoGenerateColumns = false; _context = ctx; partsService = new PartsService(_context); labelService = new LabelService(); dgResources.AutoGenerateColumns = false; }
public PartsController( IPartsService service, IHttpContextAccessor httpContextAccessor ) : base(service) { _service = service; _httpContextAccessor = httpContextAccessor; }
public HomeController(IPartsService partsService, ITracksService tracksService, IWaresService waresService, IPlayersService playersService, IAttemptsService attemptsService, IMapper mapper) { this.partsService = partsService; this.tracksService = tracksService; this.waresService = waresService; this.playersService = playersService; this.attemptsService = attemptsService; this.mapper = mapper; }
public CarsController(UserManager <User> userManager, ICarsService cars, IPartsService parts, ILogService logs) { _userManager = userManager; this.cars = cars; this.parts = parts; this.logs = logs; }
public BookingManagementController() { _serviceBookingService = new ServiceBookingService(); _carService = new CarService(); _userService = new UserService(); _repairTypeService = new RepairTypeService(); _repairItemService = new RepairItemService(); _serviceAccountTypeService = new ServiceAccountTypeService(); _partsService = new PartsService(); _customerService = new CustomerService(); }
public DataForm() { InitializeComponent(); ctx = new BadgerDataModel(); _selectedMeasure = new UnitOfMeasure { UID = 1, Uom = "Each" }; _partService = new PartsService(ctx); _ordersService = new OrdersService(ctx); bsLineItems = new BindingSource(); this.Size = new Size(800, 450); }
/// <summary> /// TODO use PartID and DTO to hydrate the control /// </summary> /// <param name="part"></param> /// <param name="ctx"></param> public PartView(Part part, BadgerDataModel ctx) { InitializeComponent(); _context = ctx; ISuppliersService var = new SuppliersService(_context); inventoryService = new InventoryService(_context); partsService = new PartsService(_context); this.dataGridView1.AutoGenerateColumns = false; this.dgvTransactions.AutoGenerateColumns = false; if (part.PartID > 0) { _part = partsService.Find(part.PartID); } else { _part = partsService.New(); _part.AddedBy = Globals.CurrentUserName; _part.DateAdded = DateTime.Today; } cboSuppliers.DisplayMember = "SupplierName"; cboSuppliers.ValueMember = "SupplierID"; cboSuppliers.SelectedItem = _part.SupplierId; cboSuppliers.DataSource = var.GetAll(); cboUnits.DisplayMember = "UOM"; cboUnits.ValueMember = "UID"; cboUnits.SelectedItem = _part.UID; cboUnits.DataSource = partsService.Units(); cboManus.DisplayMember = "Manufacturer"; cboManus.ValueMember = "ManuID"; cboManus.SelectedItem = _part.ManuId; cboManus.DataSource = partsService.Manufacturers(); bsPart.DataSource = _part; // This triggers the Save Button On changed-- bsPart.CurrentItemChanged += BsPart_CurrentItemChanged; this.btnSave.Enabled = _isDirty; this.txtSupplierDesc.Enabled = false; _documents = _context.Document.Where(r => r.PartID == _part.PartID).ToList(); // _documents = _part.Document.ToList(); bsDocuments.DataSource = _documents; this.dataGridView1.DataSource = bsDocuments; LoadTransaction(); this.rbRecieved.Checked = true; }
public void Setup() { AutoMapperConfig.RegisterMappings( typeof(PCCUser).Assembly.GetTypes(), typeof(PartServiceModel).Assembly.GetTypes()); DbContextOptions <PCCDbContext> options = new DbContextOptionsBuilder <PCCDbContext>() .UseInMemoryDatabase($"TESTS-DB-{Guid.NewGuid().ToString()}") .Options; this.pCCDbContext = new PCCDbContext(options); this.partService = new PartsService(this.pCCDbContext); }
public RepairManagementController() { _serviceRepairService = new ServiceRepairService(); _carService = new CarService(); _serviceBookingService = new ServiceBookingService(); _customerService = new CustomerService(); _userService = new UserService(); _repairTypeService = new RepairTypeService(); _serviceAccountTypeService = new ServiceAccountTypeService(); _partsService = new PartsService(); _repairItemService = new RepairItemService(); _serviceTicketTypeService = new ServiceTicketTypeService(); _paymentTypeService = new PaymentTypeService(); _washItemService = new WashItemService(); _serviceRepairHistoryService = new ServiceRepairHistoryService(); }
// Hydrate a PO------------------------ public PurchaseOrderControl(BadgerDataModel context, PurchaseOrder purchaseOrder) { InitializeComponent(); _po = purchaseOrder; mapper = new Mappers.PurchaseOrderMapper(); mapper.Map(_po, orderHeader); _ctx = new BadgerDataModel(); // Load related children data _selectedMeasure = new UnitOfMeasure { UID = 1, Uom = "Each" }; _suppliersService = new SuppliersService(_ctx); _partService = new PartsService(_ctx); _ordersService = new OrdersService(_ctx); // ---------------------------------- bsLineItems = new BindingSource(); bsOrderHeader = new BindingSource(); _supplier = _suppliersService.Find(_po.SupplierId.Value); supplierLineItems = _ordersService.GetSupplierLineItems(_supplier.SupplierId); }
public void Init() { this.ConfigureMapper(); this._service = new PartsService(); this._controller = new PartsController(this._service); this._parts = new List <Part>() { new Part() { Id = 1, Name = "Capacitor", Model = "Texas Instruments", Price = 10.00m, Quantity = 1 }, new Part() { Id = 2, Name = "Motor", Model = "DC Motor", Price = 150.50m, Quantity = 1 } }; this._context = new FakeRefregeratorRepairSystemContext(); foreach (var part in _parts) { this._context.Parts.Add(part); } this._service = new PartsService(); this._controller = new PartsController(this._service); }
/* It's always good practice to code against the interface. It allows us to test our code properly because we can mock the interfaces. * I am proposing that we use Dependency Injection pattern. As already mentioned above, our code will be more testable. We also going to achieve a more readability * along side that, our code can also be reusable * With Dependency Injection, we don't have to instatiate the services on the constructors, the IoC takes car of that. we can pass everything as interface. * * I would also have a factory pattern to get the Parts for either Robot or Car. This would help us clean this class a little bit more because we'd remove the last two * methods GetRobotPartsFor and only use the service to get the parts */ public Factory(IRobotService robotService, IPartsService partsService, ICarService carService) { _robotService = robotService; _partsService = partsService; _carService = carService; }
public void Dispose() { this.pCCDbContext.Dispose(); this.partService = null; }
public PartsController(IPartsService parts, ISupplierService suppliers) { this.Parts = parts; this.Suppliers = suppliers; }
public InventoryController(IPartsService partsService, IMapper mapper, IPaginatedListMapper pListMapper) { _partsService = partsService; _mapper = mapper; _pListMapper = pListMapper; }
public PartsController(IPartsService partsService) { _partsService = partsService; }
public PartsController(IPartsService service) { this.service = service; }
public PartsController(ICloudinaryService cloudinaryService, IPartsService partsService) { this.cloudinaryService = cloudinaryService; this.partsService = partsService; }
public PartsController(IWebHostEnvironment environment, ILogger <PartsController> logger, IPartsService partService) { _hostingEnvironment = environment; _partService = partService; _logger = logger; }
public PartsController(IMapper mapper, IPartsService partsService) { _mapper = mapper; _partsService = partsService; }
public CarsController(ICarService cars, IPartsService parts) { this.Cars = cars; this.partsService = parts; }
public OrdersService(BadgerDataModel Context) { context = Context; _partService = new PartsService(context); }
public AccountsController(IAccountServices accountService, IPartsService partsService) { _accountService = accountService; _partsService = partsService; }
public PartMenuViewComponent(IPartsService partsService, IMapper mapper) { this.partsService = partsService; this.mapper = mapper; }
public PartsWarningController() { _partsService = new PartsService(); }