Exemplo n.º 1
0
 public UserController(IUserService userService, IBranchService branchService, ICountryService countryService, IUserTypeService userTypeService)
 {
     _userService     = userService;
     _branchService   = branchService;
     _countryService  = countryService;
     _userTypeService = userTypeService;
 }
Exemplo n.º 2
0
 public CollectorsController(ICollectorService collectorService, IEmployeeService employeeService, IProfessionService professionService, IBranchService branchService)
 {
     _collectorService  = collectorService;
     _employeeService   = employeeService;
     _professionService = professionService;
     _branchService     = branchService;
 }
 public BranchGroupController(IPermissionService permissionService,
     IBranchService branchService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     IStoreMappingService storeMappingService, 
     ILocalizedEntityService localizedEntityService, 
     IStoreService storeService,
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, 
     IWorkContext workContext,
     ICacheManager cacheManager, 
     BranchSettings branchSettings, 
     IWebHelper webHelper)
 {
     _permissionService = permissionService;
     _branchService = branchService;
     _languageService = languageService;
     _localizationService = localizationService;
     _storeMappingService = storeMappingService;
     _localizedEntityService = localizedEntityService;
     _storeService = storeService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _workContext = workContext;
     _cacheManager = cacheManager;
     _branchSettings = branchSettings;
     _webHelper = webHelper;
 }
        public static IList<BranchGroup> GetBranchGroupBreadCrumb(this BranchGroup branchGroup,
            IBranchService branchService,
            bool showHidden = false)
        {
            if (branchGroup == null)
                throw new ArgumentNullException("branchGroup");

            var result = new List<BranchGroup>();

            //used to prevent circular references
            var alreadyProcessedBranchGroupIds = new List<int>() { };

            while (branchGroup != null && //not null
                !branchGroup.Deleted && //not deleted
                !alreadyProcessedBranchGroupIds.Contains(branchGroup.Id)) //prevent circular references
            {
                result.Add(branchGroup);

                alreadyProcessedBranchGroupIds.Add(branchGroup.Id);

                branchGroup = branchService.GetBranchGroupById(branchGroup.ParentGroupId);
            }
            result.Reverse();
            return result;
        }
 public WorkerController(IWorkerService workerService, IAccountService accountService, IReservationService reservationService, IBranchService branchService)
 {
     _workerService      = workerService;
     _accountService     = accountService;
     _reservationService = reservationService;
     _branchService      = branchService;
 }
Exemplo n.º 6
0
 public ManagerController(IInsuranceContractService insuranceContractService, IBranchService branch, IMDService mdServices, IPaymentService paymentservice)
 {
     _insuranceContractService = insuranceContractService;
     _branch         = branch;
     _mdServices     = mdServices;
     _paymentservice = paymentservice;
 }
Exemplo n.º 7
0
 public AccountController(
     UserManager <ApplicationUser> userManager,
     RoleManager <IdentityRole> roleManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <AccountController> logger,
     IMessager messager,
     IGenerator generator,
     IMapper mapper,
     IBranchService branchService,
     IEmployeeService employeeService,
     ICustomerService customerService,
     IDepositService depositService,
     ILoanService loanService
     ) : base(
         userManager,
         roleManager,
         mapper,
         generator)
 {
     _signInManager   = signInManager;
     _logger          = logger;
     _messager        = messager;
     _branchService   = branchService;
     _employeeService = employeeService;
     _customerService = customerService;
     _depositService  = depositService;
     _loanService     = loanService;
 }
        public static string GetFormattedBreadCrumb(this BranchGroup category,
            IBranchService branchService,
            string separator = ">>")
        {
            if (category == null)
                throw new ArgumentNullException("category");

            string result = string.Empty;

            //used to prevent circular references
            var alreadyProcessedBranchGroupIds = new List<int>() { };

            while (category != null &&  //not null
                !category.Deleted &&  //not deleted
                !alreadyProcessedBranchGroupIds.Contains(category.Id)) //prevent circular references
            {
                if (String.IsNullOrEmpty(result))
                {
                    result = category.Name;
                }
                else
                {
                    result = string.Format("{0} {1} {2}", category.Name, separator, result);
                }

                alreadyProcessedBranchGroupIds.Add(category.Id);

                category = branchService.GetBranchGroupById(category.ParentGroupId);

            }
            return result;
        }
Exemplo n.º 9
0
 public AccountController(ICompanyService companyService, IEmployeeService employeeService, IBranchService branchService, IDepartmentService departmentService)
 {
     this.companyService    = companyService;
     this.employeeService   = employeeService;
     this.branchService     = branchService;
     this.departmentService = departmentService;
 }
Exemplo n.º 10
0
 public ReportsController(UserManager <ApplicationUser> userManager,
                          RoleManager <IdentityRole> roleManager,
                          ILogger <ReportsController> logger,
                          IMapper mapper,
                          IGenerator generator,
                          IBranchService branchService,
                          IProductService productService,
                          ICustomerService customerService,
                          IEmployeeService employeeService,
                          IDepositService depositService,
                          IDepositConfirmService depositconfirmService,
                          ILoanService loanService,
                          ILoanApprovalService loanapprovalService,
                          IRefundService refundService,
                          IRefundConfirmService refundconfirmService) : base(userManager, roleManager, mapper, generator)
 {
     _logger                = logger;
     _branchService         = branchService;
     _productService        = productService;
     _customerService       = customerService;
     _employeeService       = employeeService;
     _depositService        = depositService;
     _depositconfirmService = depositconfirmService;
     _loanService           = loanService;
     _loanapprovalService   = loanapprovalService;
     _refundService         = refundService;
     _refundconfirmService  = refundconfirmService;
 }
Exemplo n.º 11
0
 public CreditContractController(
     dbwebContext context,
     IBookingServices ibookService,
     IUserServices iuserService,
     ICustomerServices icustService,
     IRelationService irelaService,
     IContractGroupService icontGroupService,
     IContractTypeService iconTypeService,
     IZoneService izoneService,
     IBranchService ibranchService,
     ISysParameterService isysParamService,
     IStatusService istatusService
     )
 {
     ctx               = context;
     iBookService      = ibookService;
     iUserService      = iuserService;
     iCustService      = icustService;
     iRelaService      = irelaService;
     iContGroupService = icontGroupService;
     iContTypeService  = iconTypeService;
     iZoneService      = izoneService;
     iBranchService    = ibranchService;
     iSysParamService  = isysParamService;
     iStatusService    = istatusService;
 }
Exemplo n.º 12
0
 public BusinessHomeModel(IBranchService branchService, IBusinessService businessService, IBranchItemService branchItemService, IEmployeeItemService employeeItemService)
 {
     this.branchService       = branchService;
     this.businessService     = businessService;
     this.branchItemService   = branchItemService;
     this.employeeItemService = employeeItemService;
 }
Exemplo n.º 13
0
 public TableController(IMapper mapper, IBranchService branchService, ISubstationService substationService, IVoltLevelService voltLevelService)
 {
     _mapper            = mapper;
     _branchService     = branchService;
     _voltLevelService  = voltLevelService;
     _substationService = substationService;
 }
Exemplo n.º 14
0
        public void SetUp()
        {
            List <SalesInvoice> salesInvoiceTest = new List <SalesInvoice>();
            {
                new SalesInvoice {
                    SalesInvoiceId = 1, CustomerId = 1, BranchId = 1, SalesType = 0, UserId = "98f74499-a614-4373-aacd-5eec5b46ef95", DateSold = DateTime.Parse("2016-10-09")
                };
                new SalesInvoice {
                    SalesInvoiceId = 2, CustomerId = 2, BranchId = 2, SalesType = 1, UserId = "98f74499-a614-4373-aacd-5eec5b46ef95", DateSold = DateTime.Parse("2016-10-09")
                };
            }

            List <Customer> customerTest = new List <Customer>();
            {
                new Customer {
                    FirstName = "Tewodros", LastName = "Afro", Address = "Arat Killo", TelephoneNo = "123456789", TIN = "123456789", VATNumber = "123456789", Trusted = true
                };
                new Customer {
                    FirstName = "Tilahun", LastName = "Gessesse", Address = "Arat Killo", TelephoneNo = "123456789", TIN = "123456789", VATNumber = "123456789", Trusted = true
                };
            }

            List <Branch> branchTest = new List <Branch>();
            {
                new Branch {
                    BranchName = "Main", BranchLocation = "Addis Ababa", BranchDescription = "Country Main Branch"
                };
                new Branch {
                    BranchName = "South Branch", BranchLocation = "Awassa", BranchDescription = "SNNP Branch in Awassa"
                };
            }

            List <Productc> productcTest = new List <Productc>();
            {
                new Productc {
                    ProductName = "Toyota Vitz", ProductDescription = "Toyota Vitz 2014", Model = "Vitz 2014", UnitOfMeasure = "Pcs", UnitCost = 200000.00M, UnitPrice = 250000.00M, CategoryId = 1
                };
                new Productc {
                    ProductName = "Toyota Yaris", ProductDescription = "Toyota Yaris 2012", Model = "Yaris 2012", UnitOfMeasure = "Pcs", UnitCost = 350000.00M, UnitPrice = 400000.00M, CategoryId = 1
                };
            }

            Mock <ISalesInvoiceService> mockSalesInvoiceService = new Mock <ISalesInvoiceService>();
            Mock <ICustomerService>     mockCustomerService     = new Mock <ICustomerService>();
            Mock <IBranchService>       mockBranchService       = new Mock <IBranchService>();
            Mock <IProductService>      mockProductService      = new Mock <IProductService>();

            mockSalesInvoiceService.Setup(m => m.GetAllSalesInvoices()).Returns(salesInvoiceTest);
            mockCustomerService.Setup(m => m.GetAllCustomers()).Returns(customerTest);
            mockBranchService.Setup(m => m.GetAllBranches()).Returns(branchTest);
            mockProductService.Setup(m => m.GetAllProducts()).Returns(productcTest);

            MockSalesInvoiceService = mockSalesInvoiceService.Object;
            MockCustomerService     = mockCustomerService.Object;
            MockBranchService       = mockBranchService.Object;
            MockProductService      = mockProductService.Object;

            _salesInvoicesController = new SalesInvoicesController(MockSalesInvoiceService, MockCustomerService, MockBranchService, MockProductService);
        }
Exemplo n.º 15
0
 public BranchController(IBranchService branchService, ICountryService countryService, ICityService cityService, ICountyService countyService, ICompanyService companyService, ApplicationUserManager userManager, IEmployeeService employeeService, ApplicationRoleManager roleManager) : base(userManager, employeeService, roleManager)
 {
     this.branchService  = branchService;
     this.countryService = countryService;
     this.cityService    = cityService;
     this.countyService  = countyService;
     this.companyService = companyService;
 }
Exemplo n.º 16
0
        public BranchServiceTests()
        {
            var ctx = Substitute.For <IDbContext>();

            this.branchRepository = Substitute.For <IRepository <Branch> >();

            this._branchService = new BranchService(branchRepository);
        }
Exemplo n.º 17
0
 public ComponentController(IComponentTypeService componentTypeService, IComponentService componentService, IDonorService donorService, IBranchService branchService, IUserHelper userHelper)
 {
     _componentTypeService = componentTypeService;
     _componentService     = componentService;
     _donorService         = donorService;
     _branchService        = branchService;
     _userHelper           = userHelper;
 }
Exemplo n.º 18
0
 public EditModel(IBranchService branchService, IAbilityService abilityService, ICoreLogic coreLogic,
                  ISkillService skillService, IMajorService majorService) : base(majorService)
 {
     _branchService  = branchService;
     _abilityService = abilityService;
     _coreLogic      = coreLogic;
     _skillService   = skillService;
 }
Exemplo n.º 19
0
 public EmailProvider(IUserService userService,
                      IBranchService branchService,
                      ICompanyService companyService)
 {
     _userService    = userService;
     _branchService  = branchService;
     _companyService = companyService;
 }
Exemplo n.º 20
0
 public AdministratorController(IOrganisationService organisationService, IBranchService branchService, IBankService bankService, IEmployeeService employeeService, IUserManager userManager)
 {
     _organisationService = organisationService;
     _branchService = branchService;
     _bankService = bankService;
     _employeeService = employeeService;
     _userManager = userManager;
 }
Exemplo n.º 21
0
 public SearchController(ApplicationUserManager userManager, IEmployeeService employeeService, ApplicationRoleManager roleManager, IBranchService branchService, IDepartmentService departmentService, ISuggestionService suggestionService, ICompanyService companyService) : base(userManager, employeeService, roleManager)
 {
     this.branchService     = branchService;
     this.departmentService = departmentService;
     this.suggestionService = suggestionService;
     this.companyService    = companyService;
     this.companyService    = companyService;
 }
Exemplo n.º 22
0
 public RoomLessonTeacherController(IRoomLessonTeacherService roomLessonTeacherService, IClassRoomService classRoomService, ILessonService lessonService, ITeacherService teacherService, IBranchService branchService)
 {
     this.roomLessonTeacherService = roomLessonTeacherService;
     this.classRoomService         = classRoomService;
     this.lessonService            = lessonService;
     this.teacherService           = teacherService;
     this.branchService            = branchService;
 }
Exemplo n.º 23
0
 public BranchReadController(IBranchService branchService,
     IPictureService pictureService,
     BranchSettings branchSettings)
 {
     _branchService = branchService;
     _pictureService = pictureService;
     _branchSettings = branchSettings;
 }
Exemplo n.º 24
0
        public static object Add(Branch obj)
        {
            Int32 LoginUserId = 0;

            if (HttpContext.Current.Session["UserId"] != null)
            {
                LoginUserId = Convert.ToInt32(HttpContext.Current.Session["UserId"].ToString());
            }
            Response response = new Response();

            try
            {
                if (obj.Id == 0)
                {
                    if (IBranchService.GetCountByPropertyName(nameof(Utility.Branch.Code), obj.Code, true) != 0)
                    {
                        response.isSuccess = false;
                        response.message   = "Code already exist";
                        return(response);
                    }
                    if (IBranchService.GetCountByPropertyName(nameof(Utility.Branch.Name), obj.Name, true) != 0)
                    {
                        response.isSuccess = false;
                        response.message   = "Name already exist";
                        return(response);
                    }
                    obj.CreatedBy   = LoginUserId;
                    obj.CreatedDate = DateTime.Now;
                    IBranchService.PostData(obj);
                    response.message   = "Successfully added";
                    response.isSuccess = true;
                }
                else
                {
                    Branch branch = IBranchService.GetSingle(obj.Id);
                    if (branch.Name == obj.Name && branch.Code == obj.Code)
                    {
                        response.message   = "No changes";
                        response.isSuccess = false;
                    }
                    else
                    {
                        obj.UpdatedBy   = LoginUserId;
                        obj.UpdatedDate = DateTime.Now;
                        IBranchService.UpdateData(obj);
                        response.message   = "Successfully updated";
                        response.isSuccess = true;
                    }
                }
            }
            catch (Exception ex)
            {
                response.message   = ex.ToString();
                response.isSuccess = false;
            }
            return(response);
        }
Exemplo n.º 25
0
        // private readonly List<Claim> claims;

        public BranchController(IBranchService branchService, IMapper mapper, IHostingEnvironment hostingEnvironment)
        {
            this.mapper             = mapper;
            this.branchService      = branchService;
            this.hostingEnvironment = hostingEnvironment;

            //   var ci = new ClaimsIdentity(User.Claims, "Forms", "name", "role");
            //   claims = ci.Claims.ToList();
        }
 public CatalogController(
     ILibraryAssetService libraryAssetService,
     ICheckoutService checkoutService,
     IBranchService branchService)
 {
     _libraryAssetService = libraryAssetService;
     _checkoutService     = checkoutService;
     _branchService       = branchService;
 }
Exemplo n.º 27
0
        /// <summary>
        /// Constructor to inject Country Service
        /// </summary>
        /// <param name="CountryService">Country Service Instance</param>

        public AccountController(ICountryService countryService, ISettingService settingService, IBranchService branchService, IFinancialYearService financialYearService, ICompanyService companyService, IUserCompanyService userCompanyService)
        {
            _countryService       = countryService;
            _branchService        = branchService;
            _settingService       = settingService;
            _financialYearService = financialYearService;
            _companyService       = companyService;
            _userCompanyService   = userCompanyService;
        }
Exemplo n.º 28
0
 public RentController(IRentService service, ICustomerService _customer, IBranchService _branch, ICompanyService _company, ICarService _car, IUserService srvc)
 {
     _service      = service;
     customer      = _customer;
     branch        = _branch;
     company       = _company;
     car           = _car;
     _IuserService = srvc;
 }
Exemplo n.º 29
0
 public BranchController(ICommonDataService dataService, IOperationFormListService formListService,
                         IBranchService branchService, IAtuAddressService atuAddressService, IEntityStateHelper entityStateHelper)
 {
     _dataService       = dataService;
     _formListService   = formListService;
     _branchService     = branchService;
     _atuAddressService = atuAddressService;
     _entityStateHelper = entityStateHelper;
 }
Exemplo n.º 30
0
 public HomeController(ISalesInvoiceService salesInvoiceService, IProductService productService,
                       IProductReceiveService productReceiveService, IProductTransferService productTransferService,
                       IBranchService branchService)
 {
     _salesInvoiceService    = salesInvoiceService;
     _productService         = productService;
     _productReceiveService  = productReceiveService;
     _productTransferService = productTransferService;
     _branchService          = branchService;
 }
Exemplo n.º 31
0
        public UserBranchController(ISubsidiaryInfoAppService _subsidiaryInfoService,

                                    ISecUserInfoService _secuserinfoService,
                                    IUserBranchService _userbranchService,
                                    IBranchService _branchService)
        {
            this._secuserinfoService = _secuserinfoService;
            this._userbranchService  = _userbranchService;
            this._branchService      = _branchService;
        }
Exemplo n.º 32
0
 public BranchController(IBranchService service,
                         ICompanyService companyService,
                         IFeatureProvider featureProvider,
                         IWarehouseService warehouseService) : base(service)
 {
     _service          = service;
     _companyService   = companyService;
     _featureProvider  = featureProvider;
     _warehouseService = warehouseService;
 }
Exemplo n.º 33
0
 public BranchController(IBranchService branchService,
                         ICitiesService citiesService,
                         ICustomerService customerService,
                         UserManager <AppUser> userManager,
                         IActionResultMapper <BranchController> actionResultMapper)
 {
     _branchService      = branchService;
     _citiesService      = citiesService;
     _actionResultMapper = actionResultMapper;
 }
Exemplo n.º 34
0
 public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager, ICompanyService companyService, IEmployeeService employeeService, IBranchService branchService, IDepartmentService departmentService)
 {
     UserManager            = userManager;
     SignInManager          = signInManager;
     RoleManager            = roleManager;
     this.companyService    = companyService;
     this.employeeService   = employeeService;
     this.branchService     = branchService;
     this.departmentService = departmentService;
 }
Exemplo n.º 35
0
        public BranchModule(IBranchService branchService)
        {
            Get["/branches", runAsync: true] = async (parameter, ct) =>
            {
                dynamic source = Request.Query.source;

                var branches = await Task.Run(() => branchService.Get(source));

                return Response.AsJson((IEnumerable<string>)branches);
            };
        }
Exemplo n.º 36
0
 public BranchController(IPermissionService permissionService,
     IBranchService branchService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, IDateTimeHelper dateTimeHelper)
 {
     _permissionService = permissionService;
     _branchService = branchService;
     _languageService = languageService;
     _localizationService = localizationService;
     _localizedEntityService = localizedEntityService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _dateTimeHelper = dateTimeHelper;
 }
Exemplo n.º 37
0
        public VendorController(ICategoryService categoryService, IVendorService vendorService,
            IVendorTemplateService vendorTemplateService, IProductService productService,
            IUrlRecordService urlRecordService, IPictureService pictureService,
            ILanguageService languageService, ILocalizationService localizationService, ILocalizedEntityService localizedEntityService,
            IExportManager exportManager, IWorkContext workContext,
            ICustomerActivityService customerActivityService, IAclService aclService, IPermissionService permissionService,
            AdminAreaSettings adminAreaSettings, CatalogSettings catalogSettings,
            ICustomerService customerService, CustomerSettings customerSettings
            , IBranchService branchService
            , ICountryService countryService, IStateProvinceService stateProvinceService)
        {
            this._categoryService = categoryService;
            this._vendorTemplateService = vendorTemplateService;
            this._vendorService = vendorService;
            this._productService = productService;
            this._urlRecordService = urlRecordService;
            this._pictureService = pictureService;
            this._languageService = languageService;
            this._localizationService = localizationService;
            this._localizedEntityService = localizedEntityService;
            this._exportManager = exportManager;
            this._workContext = workContext;
            this._customerActivityService = customerActivityService;
            this._aclService = aclService;
            this._permissionService = permissionService;
            this._adminAreaSettings = adminAreaSettings;
            this._catalogSettings = catalogSettings;
            this._customerService = customerService;
            this._customerSettings = customerSettings;

            this._branchService = branchService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;

            customerVendorId = _vendorService.GetVendorIdByCustomerId(_workContext.CurrentCustomer.Id);//add by hz
        }
Exemplo n.º 38
0
 public TestBranchService()
 {
     this.branchService = ServiceLocator.Instance.GetService<IBranchService>();
     this.userService = ServiceLocator.Instance.GetService<IUserService>();
     //CurrentUser = userService.Login("admin", "14e1b600b1fd579f47433b88e8d85291");
 }
Exemplo n.º 39
0
 public BranchController(IBranchService branchService)
     : base()
 {
     this.branchService = branchService;
 }