Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public PartsReturnController()
 {
     _partsReturnService = new PartsReturnService();
     _supplierService    = new SupplierService();
     _warehouseService   = new WarehouseService();
     _partsService       = new PartsService();
 }
Ejemplo n.º 3
0
 public PlayerController(IWaresService waresService, IPartsService partsService, IPlayersService playersService, IMapper mapper)
 {
     this.waresService   = waresService;
     this.partsService   = partsService;
     this.playersService = playersService;
     this.mapper         = mapper;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 public PartEditor(BadgerDataModel ctx)
 {
     InitializeComponent();
     dgPartsList.AutoGenerateColumns = false;
     _context     = ctx;
     partsService = new PartsService(_context);
     labelService = new LabelService();
     dgResources.AutoGenerateColumns = false;
 }
Ejemplo n.º 6
0
 public PartsController(
     IPartsService service,
     IHttpContextAccessor httpContextAccessor
     )
     : base(service)
 {
     _service             = service;
     _httpContextAccessor = httpContextAccessor;
 }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
 public CarsController(UserManager <User> userManager,
                       ICarsService cars,
                       IPartsService parts,
                       ILogService logs)
 {
     _userManager = userManager;
     this.cars    = cars;
     this.parts   = parts;
     this.logs    = logs;
 }
Ejemplo n.º 9
0
 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();
 }
Ejemplo n.º 10
0
 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);
 }
Ejemplo n.º 11
0
        /// <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;
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
 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();
 }
Ejemplo n.º 14
0
        // 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);
        }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
        /* 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;
        }
Ejemplo n.º 17
0
 public void Dispose()
 {
     this.pCCDbContext.Dispose();
     this.partService = null;
 }
Ejemplo n.º 18
0
 public PartsController(IPartsService parts, ISupplierService suppliers)
 {
     this.Parts     = parts;
     this.Suppliers = suppliers;
 }
Ejemplo n.º 19
0
 public InventoryController(IPartsService partsService, IMapper mapper, IPaginatedListMapper pListMapper)
 {
     _partsService = partsService;
     _mapper       = mapper;
     _pListMapper  = pListMapper;
 }
 public PartsController(IPartsService partsService)
 {
     _partsService = partsService;
 }
Ejemplo n.º 21
0
 public PartsController(IPartsService service)
 {
     this.service = service;
 }
Ejemplo n.º 22
0
 public PartsController(ICloudinaryService cloudinaryService, IPartsService partsService)
 {
     this.cloudinaryService = cloudinaryService;
     this.partsService      = partsService;
 }
Ejemplo n.º 23
0
 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;
 }
Ejemplo n.º 25
0
 public CarsController(ICarService cars, IPartsService parts)
 {
     this.Cars         = cars;
     this.partsService = parts;
 }
Ejemplo n.º 26
0
 public OrdersService(BadgerDataModel Context)
 {
     context      = Context;
     _partService = new PartsService(context);
 }
Ejemplo n.º 27
0
 public AccountsController(IAccountServices accountService, IPartsService partsService)
 {
     _accountService = accountService;
     _partsService   = partsService;
 }
Ejemplo n.º 28
0
 public PartMenuViewComponent(IPartsService partsService, IMapper mapper)
 {
     this.partsService = partsService;
     this.mapper       = mapper;
 }
Ejemplo n.º 29
0
 public PartsWarningController()
 {
     _partsService = new PartsService();
 }