示例#1
0
 public GameServiceTest()
 {
     _unitService    = new UnitService();
     _platoonService = new PlatoonService(_unitService);
     _armyService    = new ArmyService(_platoonService);
     _gameService    = new GameService(_armyService, _platoonService);
 }
示例#2
0
        public void SetUp()
        {
            ConstantProviderMock = new Mock <IConstantProvider <S, T> >();

            var unitPrefixNone  = GetNewUnitPrefix("", "", false, 1f);
            var unitPrefixKilo  = GetNewUnitPrefix("kilo", "k", false, 1000);
            var unitPrefixMilli = GetNewUnitPrefix("milli", "m", true, 1000);

            var unitBaseNameMetre  = GetNewUnitBaseName("metre", "m", 1, UnitDimension.Length);
            var unitBaseNameSecond = GetNewUnitBaseName("second", "s", 1, UnitDimension.Time);
            var unitBaseNameKelvin = GetNewUnitBaseName("kelvin", "K", 1, UnitDimension.Temperature);
            var unitBaseNameHour   = GetNewUnitBaseName("hour", "h", 60 * 60, UnitDimension.Time);

            ConstantProviderMock.Setup(constantProvider => constantProvider.GetPrefixBySymbol("")).Returns(unitPrefixNone);
            ConstantProviderMock.Setup(constantProvider => constantProvider.GetPrefixBySymbol("k")).Returns(unitPrefixKilo);
            ConstantProviderMock.Setup(constantProvider => constantProvider.GetPrefixBySymbol("m")).Returns(unitPrefixMilli);

            ConstantProviderMock.Setup(constantProvider => constantProvider.GetUnitBySymbol("m")).Returns(unitBaseNameMetre);
            ConstantProviderMock.Setup(constantProvider => constantProvider.GetUnitBySymbol("s")).Returns(unitBaseNameSecond);
            ConstantProviderMock.Setup(constantProvider => constantProvider.GetUnitBySymbol("K")).Returns(unitBaseNameKelvin);
            ConstantProviderMock.Setup(constantProvider => constantProvider.GetUnitBySymbol("h")).Returns(unitBaseNameHour);
            ConstantProviderMock.Setup(constantProvider => constantProvider.GetUnitBySymbol("km")).Throws <UnitNotFoundException>();

            UnitService = new UnitService <S, T>(ConstantProviderMock.Object);
        }
示例#3
0
 public ProductService(CashierArmContext context) : base(context)
 {
     _storageRemainderService = new StorageRemainderService(context);
     _unitService             = new UnitService(context);
     _storageService          = new StorageService(context);
     _ruleSaleService         = new RuleSaleService(context);
 }
 public LossesAndAdjustmentsController(IUserProfileService userProfileService,
                                         ICommodityService commodityService,
                                         IStoreService storeService,
                                         IProgramService programService,
                                         IHubService hubService,
                                         IUnitService unitService,
                                         IAdjustmentReasonService adjustmentReasonService,
                                         IAdjustmentService adjustmentService,
                                         ITransactionService transactionService,
                                         IProjectCodeService projectCodeService,
                                         IShippingInstructionService shippingInstructionService)
     : base(userProfileService)
 {
     _userProfileService = userProfileService;
     _commodityService = commodityService;
     _storeService = storeService;
     _programService = programService;
     _hubService = hubService;
     _unitService = unitService;
     _adjustmentReasonService = adjustmentReasonService;
     _adjustmentService = adjustmentService;
     _TransactionService = transactionService;
     _projectCodeService = projectCodeService;
     _shippingInstructionService = shippingInstructionService;
 }
示例#5
0
 public ProductsController(IProductService productService, IUnitService unitService, IMapper mapper, ICountriesService countriesService)
 {
     _productService   = productService;
     _mapper           = mapper;
     _unitService      = unitService;
     _countriesService = countriesService;
 }
示例#6
0
 public ReportController(IContractService contractService,
                         ICustomerService customerService,
                         IUnitService unitService,
                         IProcuringAgencyService procuringAgencyService,
                         IConstructionModelFactory constructionModelFactory,
                         IReportService reportService,
                         IExportManager exportManager,
                         IConstructionService constructionService,
                         IPermissionService permissionService,
                         IContractFormService contractFormService,
                         IContractTypeService contractTypeService,
                         IConstructionTypeService constructionTypeService
                         )
 {
     this._customerService          = customerService;
     this._constructionTypeService  = constructionTypeService;
     this._contractTypeService      = contractTypeService;
     this._procuringAgencyService   = procuringAgencyService;
     this._unitService              = unitService;
     this._exportManager            = exportManager;
     this._contractService          = contractService;
     this._permissionService        = permissionService;
     this._reportService            = reportService;
     this._constructionModelFactory = constructionModelFactory;
     this._constructionService      = constructionService;
     this._contractFormService      = contractFormService;
 }
        public virtual async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);
            var        client     = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            IUnitService service = testServer.Host.Services.GetService(typeof(IUnitService)) as IUnitService;
            var          model   = new ApiUnitServerRequestModel();

            model.SetProperties("B");
            CreateResponse <ApiUnitServerResponseModel> createdResponse = await service.Create(model);

            createdResponse.Success.Should().BeTrue();

            ActionResponse deleteResult = await client.UnitDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();
            ApiUnitServerResponseModel verifyResponse = await service.Get(2);

            verifyResponse.Should().BeNull();
        }
        public virtual async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            var mapper = new ApiUnitServerModelMapper();
            ApplicationDbContext       context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
            IUnitService               service = testServer.Host.Services.GetService(typeof(IUnitService)) as IUnitService;
            ApiUnitServerResponseModel model   = await service.Get(1);

            ApiUnitClientRequestModel request = mapper.MapServerResponseToClientRequest(model);

            request.SetProperties("B");

            UpdateResponse <ApiUnitClientResponseModel> updateResponse = await client.UnitUpdateAsync(model.Id, request);

            context.Entry(context.Set <Unit>().ToList()[0]).Reload();
            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
            updateResponse.Record.Id.Should().Be(1);
            context.Set <Unit>().ToList()[0].CallSign.Should().Be("B");

            updateResponse.Record.Id.Should().Be(1);
            updateResponse.Record.CallSign.Should().Be("B");
        }
 public InventoryService(LegacyDbContext legacyContext, RSIDbContext rsiContext, IUnitService unitService, IConfiguration configuration)
 {
     _legacyContext = legacyContext;
     _rsiContext    = rsiContext;
     _unitService   = unitService;
     _configuration = configuration;
 }
示例#10
0
 public DispatchController(IDispatchAllocationService dispatchAllocationService, IDispatchService dispatchService,
                           IUserProfileService userProfileService, IOtherDispatchAllocationService otherDispatchAllocationService,
                           IDispatchDetailService dispatchDetailService, IUnitService unitService, ICommodityTypeService commodityTypeService,
                           IProgramService programService, ITransporterService transporterService, IPeriodService periodService,
                           ICommodityService commodityService, ITransactionService transactionService, IStoreService storeService,
                           IAdminUnitService adminUnitService, IHubService hubService, IFDPService fdpService,
                           IProjectCodeService projectCodeService, IShippingInstructionService shippingInstructionService)
 {
     _dispatchAllocationService      = dispatchAllocationService;
     _dispatchService                = dispatchService;
     _userProfileService             = userProfileService;
     _otherDispatchAllocationService = otherDispatchAllocationService;
     _dispatchDetailService          = dispatchDetailService;
     _unitService                = unitService;
     _commodityTypeService       = commodityTypeService;
     _programService             = programService;
     _transporterService         = transporterService;
     _periodService              = periodService;
     _commodityService           = commodityService;
     _transactionService         = transactionService;
     _storeService               = storeService;
     _adminUnitService           = adminUnitService;
     _hubService                 = hubService;
     _fdpService                 = fdpService;
     _projectCodeService         = projectCodeService;
     _shippingInstructionService = shippingInstructionService;
 }
 public DispatchAllocationController(IDispatchAllocationService dispatchAllocationService,
                                     IUserProfileService userProfileService,
                                     IOtherDispatchAllocationService otherDispatchAllocationService,
                                     IShippingInstructionService shippingInstructionService,
                                     IProjectCodeService projectCodeService,
                                     ITransporterService transporterService,
                                     ICommonService commonService,
                                     IAdminUnitService adminUnitService,
                                     IFDPService fdpService,
                                     IHubService hubService,
                                      ICommodityTypeService commodityTypeService, IDonorService donorService, IUnitService unitService)
     : base(userProfileService)
 {
     this._dispatchAllocationService = dispatchAllocationService;
     this._userProfileService = userProfileService;
     this._otherDispatchAllocationService = otherDispatchAllocationService;
     this._projectCodeService = projectCodeService;
     this._shippingInstructionService = shippingInstructionService;
     this._transporterService = transporterService;
     this._adminUnitService = adminUnitService;
     this._fdpService = fdpService;
     this._commonService = commonService;
     this._hubService = hubService;
     this._commodityTypeService = commodityTypeService;
     this._donorService = donorService;
     this._unitService = unitService;
 }
示例#12
0
 public DispatchController(IDispatchAllocationService dispatchAllocationService, IDispatchService dispatchService,
     IUserProfileService userProfileService, IOtherDispatchAllocationService otherDispatchAllocationService,
     IDispatchDetailService dispatchDetailService, IUnitService unitService, ICommodityTypeService commodityTypeService,
     IProgramService programService, ITransporterService transporterService, IPeriodService periodService, 
     ICommodityService commodityService, ITransactionService transactionService, IStoreService storeService,
     IAdminUnitService adminUnitService, IHubService hubService, IFDPService fdpService,
     IProjectCodeService projectCodeService, IShippingInstructionService shippingInstructionService, 
     ISMSGatewayService smsGatewayService, IContactService contactService, ISMSService smsService)
     : base(userProfileService)
 {
     _dispatchAllocationService = dispatchAllocationService;
     _dispatchService = dispatchService;
     _userProfileService = userProfileService;
     _otherDispatchAllocationService = otherDispatchAllocationService;
     _dispatchDetailService = dispatchDetailService;
     _unitService = unitService;
     _commodityTypeService = commodityTypeService;
     _programService = programService;
     _transporterService = transporterService;
     _periodService = periodService;
     _commodityService = commodityService;
     _transactionService = transactionService;
     _storeService = storeService;
     _adminUnitService = adminUnitService;
     _hubService = hubService;
     _fdpService = fdpService;
     _projectCodeService = projectCodeService;
     _shippingInstructionService = shippingInstructionService;
     _smsGatewayService = smsGatewayService;
     _contactService = contactService;
     _smsService = smsService;
 }
示例#13
0
 public DispatchAllocationController(IDispatchAllocationService dispatchAllocationService,
                                     IUserProfileService userProfileService,
                                     IOtherDispatchAllocationService otherDispatchAllocationService,
                                     IShippingInstructionService shippingInstructionService,
                                     IProjectCodeService projectCodeService,
                                     ITransporterService transporterService,
                                     ICommonService commonService,
                                     IAdminUnitService adminUnitService,
                                     IFDPService fdpService,
                                     IHubService hubService,
                                     ICommodityTypeService commodityTypeService, IDonorService donorService, IUnitService unitService)
     : base(userProfileService)
 {
     this._dispatchAllocationService      = dispatchAllocationService;
     this._userProfileService             = userProfileService;
     this._otherDispatchAllocationService = otherDispatchAllocationService;
     this._projectCodeService             = projectCodeService;
     this._shippingInstructionService     = shippingInstructionService;
     this._transporterService             = transporterService;
     this._adminUnitService     = adminUnitService;
     this._fdpService           = fdpService;
     this._commonService        = commonService;
     this._hubService           = hubService;
     this._commodityTypeService = commodityTypeService;
     this._donorService         = donorService;
     this._unitService          = unitService;
 }
示例#14
0
 public SettingsController(ILogger <SettingsController> logger, ICompanyService companyService, IEmployeeService employeeService, IPointOfSaleService pointOfSaleService, IUnitService unitService) : base(logger)
 {
     _companyService     = companyService;
     _employeeService    = employeeService;
     _pointOfSaleService = pointOfSaleService;
     _unitService        = unitService;
 }
示例#15
0
 public UnitController(
     IMapper mapper,
     IUnitService unitService
     ) : base(mapper)
 {
     _unitService = unitService;
 }
示例#16
0
        public MainWindow(
            IProductService productService,
            IStorageService storageService,
            IUnitService unitService,
            IDocumentTypeService documentTypeService,
            IProductOperationService productOperationService,
            IRuleSaleService ruleSaleService,
            IOperationTypeService operationTypeService,
            IDocumentService documentService,
            IStorageRemainderService storageRemainderService,
            IDocumentOperationService documentOperationService)
        {
            _productService           = productService;
            _storageService           = storageService;
            _unitService              = unitService;
            _documentTypeService      = documentTypeService;
            _productOperationService  = productOperationService;
            _ruleSaleService          = ruleSaleService;
            _operationTypeService     = operationTypeService;
            _documentService          = documentService;
            _storageRemainderService  = storageRemainderService;
            _documentOperationService = documentOperationService;

            try
            {
                InitializeData();
                InitializeComponent();
                InitializedParams();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#17
0
 public UserController(BrainStormDbContext context, IUnitService unitService,
                       UserManager <BrainStormUser> userManager)
 {
     _context     = context;
     _unitService = unitService;
     _userManager = userManager;
 }
示例#18
0
 public ReceiveController(IReceiveService receiveService,IGiftCertificateService giftCertificateService,
                          IReceiptAllocationService receiptAllocationService,IUserProfileService userProfileService,
                          ICommodityTypeService commodityTypeService ,IReceiveDetailService receiveDetailService,
                          ICommodityService commodityService,IStoreService storeService,ITransactionService transactionService,
                          IUnitService unitService,IShippingInstructionService shippingInstructionService,IHubService hubService,
                          ICommodityGradeService commodityGradeService,IProgramService programService,ITransporterService transporterService,
                          ICommoditySourceService commoditySourceService, IDonorService donorService)
     : base(userProfileService)
 {
     _receiveService = receiveService;
     _giftCertificateService = giftCertificateService;
     _receiptAllocationService = receiptAllocationService;
     _userProfileService = userProfileService;
     _commodityTypeService = commodityTypeService;
     _receiveDetailService = receiveDetailService;
     _commodityService = commodityService;
     _storeService = storeService;
     _transactionService = transactionService;
     _unitService = unitService;
     _shippingInstructionService = shippingInstructionService;
     _hubService = hubService;
     _commodityGradeService = commodityGradeService;
     _programService = programService;
     _transporterService = transporterService;
     _commoditySourceService=commoditySourceService;
     _donorService = donorService;
 }
示例#19
0
 public UnitsController(IUnitService unitService, IMapper mapper, IUriService uriService, IPasswordService passwordService)
 {
     _unitService     = unitService;
     _mapper          = mapper;
     _uriService      = uriService;
     _passwordService = passwordService;
 }
示例#20
0
 public void SetUp()
 {
     scope           = new TransactionScope();
     _unitRepository = new UnitRepository();
     _unitService    = new UnitService(_unitRepository);
     _unitController = new UnitController(_unitService);
 }
示例#21
0
        public async Task Initialize()
        {
            context = await UtilityFactory.CreateContextAsync();

            unitService = new UnitService(context, new AsyncReaderWriterLock(), ModifierParserContainer.CreateDefault(),
                                          UtilityFactory.CreateMapper());
        }
示例#22
0
 public SalesIncentiveController(ISalesIncentiveService salesincentiveService, IUnitService utilitymasterService, IUserCredentialService usercredentialservice, IModuleService iIModuleService)
 {
     this._salesincentiveSerive   = salesincentiveService;
     this._utilitymasterService   = utilitymasterService;
     this._IUserCredentialService = usercredentialservice;
     this._iIModuleService        = iIModuleService;
 }
 public LossesAndAdjustmentsController(IUserProfileService userProfileService,
                                       ICommodityService commodityService,
                                       IStoreService storeService,
                                       IProgramService programService,
                                       IHubService hubService,
                                       IUnitService unitService,
                                       IAdjustmentReasonService adjustmentReasonService,
                                       IAdjustmentService adjustmentService,
                                       ITransactionService transactionService,
                                       IProjectCodeService projectCodeService,
                                       IShippingInstructionService shippingInstructionService)
     : base(userProfileService)
 {
     _userProfileService         = userProfileService;
     _commodityService           = commodityService;
     _storeService               = storeService;
     _programService             = programService;
     _hubService                 = hubService;
     _unitService                = unitService;
     _adjustmentReasonService    = adjustmentReasonService;
     _adjustmentService          = adjustmentService;
     _TransactionService         = transactionService;
     _projectCodeService         = projectCodeService;
     _shippingInstructionService = shippingInstructionService;
 }
示例#24
0
 //private readonly IHttpContextAccessor _httpContextAccessor;
 //private ISession _session => _httpContextAccessor.HttpContext.Session;
 /// <summary>
 /// Hàm khởi tạo
 /// </summary>
 /// <param name="accountService"></param>
 /// <param name="LogLoginService"></param>
 /// <returns></returns>
 public ProductController(IProductService productService, ICategoryService categoryService, IUnitService unitService, IImportService importService)
 {
     this._productService  = productService;
     this._categoryService = categoryService;
     this._unitService     = unitService;
     this._importService   = importService;
 }
示例#25
0
 public CatalogueController(IClientMasterService ClientMasterService, ICountryService CountryService, IStateService StateService,
                            IDistrictService DistrictService, IBankService BankService, IBankNameService BankNameService, IUtilityService UtilityService, IUserCredentialService usercredentialservice, IModuleService iIModuleService,
                            IClientBankDetailService ClientBankDetailService, ICatalogueService CatalogueService, IBarcodeNumberService BarcodeNumberService, IItemNameService ItemNameService,
                            IUniversalBarcodeNumberService UniversalBarocodeNumberService, IItemService ItemService, IColorCodeService ColorCodeService, IItemCategoryService CategoryService,
                            IEntryStockItemService EntryStockItemService, IOpeningStockService OpeningStockService, IInwardItemFromSupplierService InwardItemFromSupplierService, IUnitService UnitService)
 {
     this._ClientMasterService           = ClientMasterService;
     this._CountryService                = CountryService;
     this._StateService                  = StateService;
     this._DistrictService               = DistrictService;
     this._BankService                   = BankService;
     this._BankNameService               = BankNameService;
     this._UtilityService                = UtilityService;
     this._ClientBankDetailService       = ClientBankDetailService;
     this._IUserCredentialService        = usercredentialservice;
     this._iIModuleService               = iIModuleService;
     this._CatalogueService              = CatalogueService;
     this._BarcodeNumberService          = BarcodeNumberService;
     this._ItemNameService               = ItemNameService;
     this._UniversalBarcodeNumberService = UniversalBarocodeNumberService;
     this._ItemService                   = ItemService;
     this._ColorCodeService              = ColorCodeService;
     this._CategoryService               = CategoryService;
     this._EntryStockItemService         = EntryStockItemService;
     this._OpeningStockService           = OpeningStockService;
     this._InwardItemFromSupplierService = InwardItemFromSupplierService;
     this._UnitService                   = UnitService;
 }
 public UnitsViewModel(
     IUnitService unitService,
     INavigationService navigationService)
 {
     _unitService       = unitService;
     _navigationService = navigationService;
 }
示例#27
0
 public ProductControl(IUnitService unitService, IProductService productService)
 {
     InitializeComponent();
     _unitService    = unitService;
     _productService = productService;
     UpdateList();
 }
示例#28
0
 public UnitAppService(IUnitService unitService, IMediatorHandler bus, IBus rabbitMQBus, INotificationHandler <DomainNotification> notifications)
 {
     _service       = unitService;
     Bus            = bus;
     _notifications = (DomainNotificationHandler)notifications;
     RabbitMQBus    = rabbitMQBus;
 }
示例#29
0
 public UnitApiController(
     IUnitService unitService,
     ILoginUserRepository loginUserRepository
     ) : base(loginUserRepository)
 {
     _unitService = unitService;
 }
 public HomeController(IWorkerService workerService, IPositionService positionService, IUnitService unitService, IProjectService projService)
 {
     this.workerService   = workerService;
     this.positionService = positionService;
     this.unitService     = unitService;
     this.projService     = projService;
 }
 public UnitAdminController(
     IUnitService unitService,
     ILogger <UnitAdminController> logger
     )
 {
     _unitService = unitService;
     _logger      = logger;
 }
示例#32
0
 public WorkModelFactory(ICustomerService customerService,
                         IWorkTaskService workTaskService,
                         IUnitService unitService)
 {
     this._unitService     = unitService;
     this._workTaskService = workTaskService;
     this._customerService = customerService;
 }
示例#33
0
 public UnitController(IUnitService unitservice, IUtilityService utilityservice, IUserCredentialService usercredentialservice, IModuleService iIModuleService, IUnitConversionService UnitConversionService)
 {
     this._unitservice            = unitservice;
     this._utilityservice         = utilityservice;
     this._IUserCredentialService = usercredentialservice;
     this._iIModuleService        = iIModuleService;
     this._UnitConversionService  = UnitConversionService;
 }
 public CreateOrderController(ICategoriesService categories, IOrderService orders, ICustomerService customers, IUnitService units, IPublicCodeProvider coder)
 {
     this.categoriesService = categories;
     this.orderService = orders;
     this.customerService = customers;
     this.unitService = units;
     this.coder = coder;
 }
示例#35
0
 /// <summary>
 /// Hàm khởi tạo
 /// </summary>
 /// <param name="productService"></param>
 /// <param name="productTypeService"></param>
 /// <param name="unitService"></param>
 /// <param name="staffService"></param>
 /// <param name="logProductService"></param>
 public ProductController(IProductService productService, IProductTypeService productTypeService, IUnitService unitService, IStaffService staffService, ILogProductService logProductService)
 {
     _productService     = productService;
     _productTypeService = productTypeService;
     _unitService        = unitService;
     _staffService       = staffService;
     _logProductService  = logProductService;
 }
 public FrmProductEntry()
 {
     InitializeComponent();
     _brandService = new BrandService();
     _flavourService = new FlavourService();
     _unitService = new UnitService();
     _productionMaterialService = new ProductionMaterialService();
     _productService = new ProductService();
     LoadCombos();
 }
        public FrmPurchaseRequisitionNote()
        {
            _purchaseRequisitionNoteService = new PurchaseRequisitionNoteService();
            _unitService = new UnitService();
            _subProductService = new SubProductService();
            _productionMaterialService = new ProductionMaterialService();

            InitializeComponent();
            _commonService=new CommonService();
            _productService = new ProductService();
        }
 public ReceiveDetailController(IReceiveDetailService receiveDetailService,
                                ICommodityService commodityService,
                                ICommodityGradeService commodityGradeService,
                                IReceiveService receiveService,IUnitService unitService)
 {
     _receiveDetailService = receiveDetailService;
     _commodityService = commodityService;
     _commodityGradeService = commodityGradeService;
     _receiveService = receiveService;
     _unitService = unitService;
 }
示例#39
0
 public RegionalPSNPPledgeController(IDonorService donorService, IFDPService fdpService,
     IRegionalPSNPPlanDetailService regionalPSNPPlanDetailService,IRegionalPSNPPlanService regionalPSNPPlanService,
     IRegionalPSNPPledgeService regionalPSNPPledgeService, IAdminUnitService adminUnitService,
     ICommodityService commodityService, IRationDetailService rationDetailService, IUnitService unitService)
 {
     _donorService = donorService;
     _fdpService = fdpService;
     _regionalPSNPPlanDetailService = regionalPSNPPlanDetailService;
     _regionalPSNPPlanService = regionalPSNPPlanService;
     _regionalPSNPPledgeService = regionalPSNPPledgeService;
     _adminUnitService = adminUnitService;
     _commodityService = commodityService;
     _rationDetailService = rationDetailService;
     _unitService = unitService;
 }
 public StartingBalanceController(IUserProfileService userProfileService,
                                 ITransactionService transactionService,
                                 ICommodityService commoditySerivce,
                                 IStoreService storeService,
                                 IDonorService donorService,
                                 IProgramService programService,
                                 IUnitService unitService)
 {
     _userProfileService = userProfileService;
     _transactionService = transactionService;
     _commodityService = commoditySerivce;
     _storeService = storeService;
     _donorSerivce = donorService;
     _programService = programService;
     _unitService = unitService;
 }
 //
 // GET: /InternalMovement/
 public InternalMovementController(IUserProfileService userProfileService, IInternalMovementService internalMovementService, 
     ITransactionService transactionService, IStoreService storeService, IProjectCodeService projectCodeService,
     IShippingInstructionService shippingInstructionService, ICommodityService commodityService, IHubService hubService,
     IProgramService programService, IUnitService unitService, IDetailService detailService)
 {
     _userProfileService = userProfileService;
     _internalMovementService = internalMovementService;
     _transactionService = transactionService;
     _storeService = storeService;
     _projectCodeService = projectCodeService;
     _shippingInstructionService = shippingInstructionService;
     _commodityService = commodityService;
     _hubService = hubService;
     _programService = programService;
     _unitService = unitService;
     _detailService = detailService;
 }
 public FrmUnitEntry(UnitOfMeasurementModel model, Form frmForm)
 {
     InitializeComponent();
     _frmForm = frmForm;
     _unitService = new UnitService();
     if (model != null)
     {
         _isNewMode = false;
         _unitId = model.UnitOfMeasurementId;
         txtUnitName.Text = model.UnitName;
         txtRemarks.Text = model.Description;
         btnAdd.Text = @"Update";
     }
     else
     {
         _isNewMode = true;
         btnAdd.Text = @"Save";
     }
 }
 public FrmProductionMaterialEntry(ProductionMaterialModel model, Form frmForm)
 {
     InitializeComponent();
     _unitService = new UnitService();
     _frmForm = frmForm;
     _productionMaterialService = new ProductionMaterialService();
     LoadUnits();
     if (model != null)
     {
         _isNewMode = false;
         _productionMaterialId = model.ProductionMaterialId;
         txtName.Text = model.MaterialName;
         txtType.Text = model.MaterialType;
         txtDesc.Text = model.Description;
         cmbUnit.SelectedValue = model.UnitOfMeasurementId;
         btnAdd.Text = @"Update";
     }
     else
     {
         _isNewMode = true;
         btnAdd.Text = @"Save";
     }
 }
示例#44
0
 public ReceiveNewController(IUserProfileService userProfileService,
     IReceiptAllocationService receiptAllocationService,
     IReceiveService receiveService,
     ICommodityService commodityService,
     IUnitService unitService,
     IStoreService storeService,
     ITransactionService transactionService,
     IDonorService donorService,
     IHubService hub,
     ITransporterService transporterService)
     : base(userProfileService)
 {
     _userProfileService = userProfileService;
     _receiptAllocationService = receiptAllocationService;
     _receiveService = receiveService;
     _commodityService = commodityService;
     _unitService = unitService;
     _storeService = storeService;
     _transactionService = transactionService;
     _donorService = donorService;
     _hub = hub;
     _transporterService = transporterService;
 }
示例#45
0
 public UnitController(IUnitService unitService)
 {
     _unitService = unitService;
 }
示例#46
0
 public UnitController(IUnitService unitService, IUserProfileService userProfileService)
     : base(userProfileService)
 {
     this._unitService = unitService;
 }
示例#47
0
 /// <summary>
 /// 获取计量单位
 /// </summary>
 /// <param name="UnitService"></param>
 /// <param name="key">移除当前键,当为""或null不移除</param>
 /// <returns></returns>
 public static List<ChooseDictionary> ListAllUnitInfo(IUnitService UnitService, string key)
 {
     NameValueCollection nvc = new NameValueCollection();
     nvc.Add("isvalid", "1");
     NameValueCollection orderby = new NameValueCollection();
     orderby.Add("unitname", "asc");
     List<UnitInfo> datalist = UnitService.ListAllByCondition(nvc, orderby);
     if (!string.IsNullOrEmpty(key))
     {
         datalist.Remove(datalist.Where(x => x.Id.Equals(key)).SingleOrDefault());
     }
     var dicUnit = (from slist in datalist
                    select new ChooseDictionary { Text = slist.UnitName, Value = slist.Id, ParentId = null }).ToList();
     return dicUnit;
 }