Example #1
0
        public ActionResult Create(int id)
        {
            Journal journal = ServiceFactory.GetJournalServices().Get(id);

            Ledger led = new Ledger();

            led.LedgerPeriod = journal.JournalPeriod;
            led.CompanyId    = Convert.ToInt32(Session["CompanyId"]);

            List <Account>   accList    = new List <Account>();
            List <int>       idList     = (List <int>)ServiceFactory.GetTransactionDetailServices().GetDistinctAccount(journal.Id);
            IAccountServices accService = ServiceFactory.GetAccountServices();

            foreach (int i in idList)
            {
                Account acc = accService.Get(i);
                accList.Add(acc);
            }

            Session["Ledger"]      = led;
            Session["Journal"]     = journal;
            Session["AccountList"] = accList;

            if (journal.LedgerId != 0)
            {
                return(RedirectToAction("GetStoredLedger", new { id = journal.LedgerId }));
            }
            return(RedirectToAction("GenerateLedger"));
        }
Example #2
0
 public AccountAppService(IAccountServices accountService, IUnitOfWorkFactory unitOfWorkFactory, IMapper mapper)
     : base(accountService)
 {
     _accountService    = accountService;
     _unitOfWorkFactory = unitOfWorkFactory;
     _mapper            = mapper;
 }
Example #3
0
        public async Task <IActionResult> Edit(int?id, [FromServices] IAccountServices _accountServices)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var currentUserId = Convert.ToInt32(User.Claims.FirstOrDefault(c => c.Type == "UserId").Value);

            if (!_accountServices.IsValidUser(currentUserId, Convert.ToInt32(id)))
            {
                return(RedirectToAction("Denied", "Account"));
            }

            var details = await _realEstateServices.GetRealEstateDetails(id);

            if (details == null)
            {
                return(NotFound());
            }

            var realEstateTypeList = _realEstateServices.GetRealEstateTypeList();

            ViewData["RealEstateTypeId"] = new SelectList(realEstateTypeList, "Id", "RealEstateTypeName", details.RealEstateTypeId);
            return(View(details));
        }
Example #4
0
 public MarketServices(IApplicationContext currentDbContext, IAccountServices accountServices, IUserService userService, IProductServices productServices)
 {
     _currentDbContext = currentDbContext;
     _accountServices  = accountServices;
     _userService      = userService;
     _productServices  = productServices;
 }
Example #5
0
        public void Balance_CustomerOK()
        {
            //arrange
            Account  account  = new Account();
            Account  account2 = new Account();
            Customer customer = new Customer();

            customer.RelatedAccounts.Add(account, new Role());
            customer.RelatedAccounts.Add(account2, new Role());

            IRepository         repository                  = MockRepository.GenerateMock <IRepository>();
            ICustomerRepository customerRepository          = MockRepository.GenerateMock <ICustomerRepository>();
            IAccountRepository  accountRepository           = MockRepository.GenerateMock <IAccountRepository>();
            IDtoCreator <Customer, CustomerDto> custCreator = new CustomerDtoCreator();


            IAccountServices accountServices = MockRepository.GenerateMock <IAccountServices>(); //(repository, accountRepository,customerRepository);

            accountServices.Expect(x => x.Balance(account2)).Return(-10);
            accountServices.Expect(x => x.Balance(account)).Return(-20);


            //act
            CustomerServices services = new CustomerServices(customerRepository, repository, accountServices, custCreator);
            decimal          balance  = services.CustomerBalance(customer);

            //assert
            Assert.AreEqual(balance, -30);
            accountServices.VerifyAllExpectations();
        }
Example #6
0
 public MarketRoutesController(ICoreOrderService orderService,
                               IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IMarketServices marketServices, IEmployeeServices employeeServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _accountServices  = accountServices;
     _marketServices   = marketServices;
     _employeeServices = employeeServices;
 }
 public ApiAccountSyncController(ITerminalServices terminalServices, ITenantLocationServices tenantLocationServices, IOrderService orderService,
                                 IProductServices productServices, IUserService userService, IAccountServices accountServices, IProductPriceService productPriceService)
     : base(terminalServices, tenantLocationServices, orderService, productServices, userService)
 {
     _accountServices     = accountServices;
     _productPriceService = productPriceService;
 }
Example #8
0
        public void TestGetCustomersForAdvisor()
        {
            //arrange
            IRepository         repository                  = MockRepository.GenerateStub <IRepository>();
            ICustomerRepository customerRepository          = MockRepository.GenerateStub <ICustomerRepository>();
            IAccountServices    accountServices             = MockRepository.GenerateStub <IAccountServices>();
            IDtoCreator <Customer, CustomerDto> custCreator = new CustomerDtoCreator();

            Advisor advisor1 = new Advisor {
                Id = 1, FirstName = "Ad1"
            };
            Advisor advisor2 = new Advisor {
                Id = 2, FirstName = "Ad2"
            };
            List <Customer> customers = new List <Customer>();

            customers.Add(new Customer {
                Advisor = advisor1, Id = 1
            });
            customers.Add(new Customer {
                Advisor = advisor2, Id = 2
            });
            advisor1.Customers = customers;
            //repository.Expect(x=>x.GetAll<Customer>()).Return(customers);
            repository.Expect(x => x.Get <Advisor>(advisor1.Id)).Return(advisor1);

            //act
            CustomerServices   services = new CustomerServices(customerRepository, repository, accountServices, custCreator);
            List <CustomerDto> recieved = (List <CustomerDto>)services.GetCustomersForAdvisor(advisor1.Id);

            //assert
            Assert.AreEqual(recieved[0].Id, 1);
            repository.VerifyAllExpectations();
        }
Example #9
0
 public static IQueryable<SelectListItem> GetAccountSelectOptions(IAccountServices accountServices, bool showBalances = false)
 {
     return accountServices.All().Select(x => new SelectListItem {
         Value = x.AccountID.ToString(),
         Text = x.Name + ((showBalances) ? " / " + x.CurrentBalance : "")
     }).AsQueryable();
 }
Example #10
0
 public AccountController(IIdentityServerInteractionService interactionService, IClientStore clientStore
                          , IRepository <User> user, IAccountServices account)
 {
     _IdentityInteractionServce = interactionService;
     _ClientStore = clientStore;
     _user        = account;
 }
 public AccountController(IAccountServices accountServices, UserManager <ApplicationUser> userManager,
                          SignInManager <ApplicationUser> signInManager)
 {
     _userManager     = userManager;
     _signInManager   = signInManager;
     _accountServices = accountServices;
 }
 public BaseController(ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices)
 {
     OrderService    = orderService;
     PropertyService = propertyService;
     AccountServices = accountServices;
     LookupServices  = lookupServices;
 }
 public UsersController(IUserServices userServices,
                        IAccountServices accountServices,
                        ICategoryServices categoryServices,
                        ITransactionServices transactionServices,
                        IBudgetServices budgetServices,
                        IHttpContextProvider context,
                        ISiteConfiguration config,
                        ICryptoProvider crypto,
                        IUrlHelper urlHelper,
                        IModelCache cache,
                        ICachingHelpers cachingHelpers,
                        ISessionServices sessionServices)
     : base(userServices,
                                                                 accountServices,
                                                                 categoryServices,
                                                                 transactionServices, 
                                                                 budgetServices,
                                                                 context,
                                                                 config,
                                                                 urlHelper,
                                                                 cache,
                                                                 cachingHelpers)
 {
     _crypto = crypto;
     _sessionServices = sessionServices;
 }
 public ApiOrderProcessesSyncController(ITerminalServices terminalServices,
                                        ITenantLocationServices tenantLocationServices, IOrderService orderService,
                                        IProductServices productServices, IUserService userService, IAccountServices accountServices, IGaneConfigurationsHelper configHelper) :
     base(terminalServices, tenantLocationServices, orderService, productServices, userService)
 {
     _accountServices = accountServices;
     _configHelper    = configHelper;
 }
Example #15
0
 public AddAccountDialog(IAccountServices services)
 {
     this.services = services;
     InitializeComponent();
     comboBoxCurrency.Items.Add("US$");
     comboBoxCurrency.Items.Add("R$");
     comboBoxCurrency.SelectedIndex = 0;
 }
Example #16
0
 public AddAccountDialog(IAccountServices services)
 {
     this.services = services;
     InitializeComponent();
     comboBoxCurrency.Items.Add("US$");
     comboBoxCurrency.Items.Add("R$");
     comboBoxCurrency.SelectedIndex = 0;
 }
Example #17
0
 public CustomerServices(ICustomerRepository customerRepository, IRepository repository, IAccountServices accountServices,
    IDtoCreator<Customer, CustomerDto> customerDtoCreator)
 {
     _customerRepository = customerRepository;
     _repository = repository;
     _accountServices = accountServices;
     _customerDtoCreator = customerDtoCreator;
 }
Example #18
0
        //public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager) {
        //    UserManager = userManager;
        //    SignInManager = signInManager;
        //}

        public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager, IAccountServices services
                                 )
        {
            UserManager   = userManager;
            SignInManager = signInManager;
            RoleManager   = roleManager;
            _services     = services;
        }
 public SalesOrdersController(IProductServices productServices, ISalesOrderService salesOrderService, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices,
                              IAppointmentsService appointmentsService, IGaneConfigurationsHelper configurationsHelper, IEmailServices emailServices, ITenantLocationServices tenantLocationservices, ITenantsServices tenantsServices)
     : base(orderService, propertyService, accountServices, lookupServices, appointmentsService, configurationsHelper, emailServices, tenantLocationservices, tenantsServices)
 {
     _salesServices   = orderService;
     _accountServices = accountServices;
     _productServices = productServices;
 }
Example #20
0
 public ManagerPaymentController(IAccountServices AccountServices, IClaimsServices ClaimsServices,
                                 IPaymentServices PaymentServices, IWalletServices WalletServices)
 {
     this._AccountServices = AccountServices;
     this._claimsServices  = ClaimsServices;
     this._paymentServices = PaymentServices;
     this._walletServices  = WalletServices;
 }
Example #21
0
 public UserController(UserManager <User> userManager, MainDbContext appDb, IContactsServices contactsServices, IAccountServices accountServices, IMapper mapper)
 {
     this.userManager      = userManager;
     this.appDb            = appDb;
     this.contactsServices = contactsServices;
     this.accountServices  = accountServices;
     this.mapper           = mapper;
 }
Example #22
0
 public CustomerServices(ICustomerRepository customerRepository, IRepository repository, IAccountServices accountServices,
                         IDtoCreator <Customer, CustomerDto> customerDtoCreator)
 {
     _customerRepository = customerRepository;
     _repository         = repository;
     _accountServices    = accountServices;
     _customerDtoCreator = customerDtoCreator;
 }
Example #23
0
 public TemplateController(UserManager userManager, RoleManager roleManager, IMenuServices menuAppService, IMenuInRolesServices menuInRolesAppService,
                           IAccountServices accountServices)
 {
     this.userManager       = userManager;
     this.roleManager       = roleManager;
     _menuInRolesAppService = menuInRolesAppService;
     _accountServices       = accountServices;
     _menuAppService        = menuAppService;
 }
 public TenantConfigsController(ITenantsServices tenantsServices, ICoreOrderService orderService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices, IUserService userService, IInvoiceService invoiceService)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _userService     = userService;
     _invoiceService  = invoiceService;
     _lookupServices  = lookupServices;
     _accountServices = accountServices;
     _tenantsServices = tenantsServices;
 }
Example #25
0
        public DeleteAccountConfirmationViewModel(Account accountToDelete, ObservableCollection <Account> accounts, IAccountServices accountProxy)
        {
            AccountToDelete = accountToDelete;
            Accounts        = accounts;

            DeleteAccountCommand = new RelayCommand(DeleteAccountExecute, DeleteAccountCanExecute);

            AccountProxy = accountProxy;
        }
 public AccountController(
     IAccountServices accountServices,
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager)
 {
     this.accountServices = accountServices;
     this.userManager     = userManager;
     this.signInManager   = signInManager;
 }
Example #27
0
 public BudgetServices(IBudgetRepository budgets, IAccountRepository accounts, ICategoryRepository categories, ICategory_BudgetRepository categories_budgets, ITransactionRepository transactions, IAccountServices accountServices, ICategoryServices categoryServices)
 {
     _budgets = budgets;
     _accounts = accounts;
     _categories = categories;
     _categories_budgets = categories_budgets;
     _transactions = transactions;
     _accountServices = accountServices;
     _categoryServices = categoryServices;
 }
Example #28
0
 public AuthenticationController(UserManager <User> userManager, RoleManager <IdentityRole> roleManager, MainDbContext appDb, IAuthenticationServices authServices, IConfiguration configuration, IEmailSender emailSender, IAccountServices accountServices)
 {
     this.userManager     = userManager;
     this.roleManager     = roleManager;
     this.appDb           = appDb;
     this.authServices    = authServices;
     _configuration       = configuration;
     this.emailSender     = emailSender;
     this.accountServices = accountServices;
 }
Example #29
0
 public TimeLogController(IEmployeeShiftsServices employeeShiftsServices, IEmployeeShiftsStoresServices employeeShiftsStoresServices,
                          IEmployeeServices employeeServices, ITenantLocationServices tenantLocationsServices, IShiftsServices shiftsServices, ICoreOrderService orderService, IPropertyService propertyService,
                          IAccountServices accountServices, ILookupServices lookupServices, IActivityServices activityServices) : base(orderService, propertyService, accountServices, lookupServices)
 {
     _employeeShiftsServices       = employeeShiftsServices;
     _employeeShiftsStoresServices = employeeShiftsStoresServices;
     _employeeServices             = employeeServices;
     _tenantLocationsServices      = tenantLocationsServices;
     _shiftsServices   = shiftsServices;
     _activityServices = activityServices;
 }
Example #30
0
 public AccountController(IAccountServices accountServices, IMapper mapper, AccessManagementContext context
                          , PresetFunctionServices presetFunctionServices, ILogger <AccountController> logger
                          , BasicInfoServices basicInfoServices, LuJCDBContext luJCDBContext)
     : base(logger)
 {
     _accountServices        = accountServices;
     _mapper                 = mapper;
     _context                = context;
     _presetFunctionServices = presetFunctionServices;
     _basicInfoServices      = basicInfoServices;
     _luJCDBContext          = luJCDBContext;
 }
 public AccountController(
     UserManager <User> userManager,
     IUserServices userServices,
     IAccountServices accountServices,
     IValidateAccount validateAccount,
     IEmailSender emailSender)
 {
     _userManager     = userManager;
     _userServices    = userServices;
     _validateAccount = validateAccount;
     _emailSender     = emailSender;
     _accountServices = accountServices;
 }
Example #32
0
 public AccountController(IAccountServices accountService, IUserInfoServices userInfoServices,
                          IWalletServices walletServices, IConfigServices configServices, IClaimsServices claimsServices,
                          IUserRefServices userRefServices, ITargetServices targetServices, IIPlockServices IPlockServices)
 {
     _accountService   = accountService;
     _userInfoServices = userInfoServices;
     _walletServices   = walletServices;
     _configServices   = configServices;
     _claimsServices   = claimsServices;
     _userRefServices  = userRefServices;
     _targetServices   = targetServices;
     _IPlockServices   = IPlockServices;
 }
Example #33
0
        public HomeViewModel(Account person)
        {
            AddPersonCommand       = new RelayCommand(AddPersonExecute, AddPersonCanExecute);
            ModifyPersonCommand    = new RelayCommand(ModifyPersonExecute, ModifyPersonCanExecute);
            DeletePersonCommand    = new RelayCommand(DeletePersonExecute, DeletePersonCanExecute);
            PersonDetailsCommand   = new RelayCommand(PersonDetailsExecute, PersonDetailsCanExecute);
            DuplicatePersonCommand = new RelayCommand(DuplicatePersonExecute, DuplicatePersonCanExecute);
            UndoPersonCommand      = new RelayCommand(UndoPersonExecute, UndoPersonCanExecute);
            RedoPersonCommand      = new RelayCommand(RedoPersonExecute, RedoPersonCanExecute);
            ShowPeopleCommand      = new RelayCommand(ShowPeopleExecute, ShowPeopleCanExecute);
            SearchPersonCommand    = new RelayCommand(SearchPersonExecute, SearchPersonCanExecute);

            AddEventCommand     = new RelayCommand(AddEventExecute, AddEventCanExecute);
            ModifyEventCommand  = new RelayCommand(ModifyEventExecute, ModifyEventCanExecute);
            DeleteEventCommand  = new RelayCommand(DeleteEventExecute, DeleteEventCanExecute);
            EventDetailsCommand = new RelayCommand(EventDetailsExecute, EventDetailsCanExecute);
            ShowEventsCommand   = new RelayCommand(ShowEventsExecute, ShowEventsCanExecute);

            CreateAccountCommand         = new RelayCommand(CreateAccountExecute, CreateAccountCanExecute);
            ModifyAccountCommand         = new RelayCommand(ModifyAccountExecute, ModifyAccountCanExecute);
            ModifyPersonalAccountCommand = new RelayCommand(ModifyPersonalAccountExecute, ModifyPersonalAccountCanExecute);
            DeleteAccountCommand         = new RelayCommand(DeleteAccountExecute, DeleteAccountCanExecute);
            ShowAccountsCommand          = new RelayCommand(ShowAccountsExecute, ShowAccountsCanExecute);

            LogOutCommand = new RelayCommand(LogOutExecute, LogOutCanExecute);

            InstanceContext instanceContext = new InstanceContext(this);

            _personProxy  = PersonProxy.ConnectToPersonService(instanceContext);
            _accountProxy = AccountProxy.ConnectToAccountService(instanceContext);
            _eventProxy   = EventProxy.ConnectToAccountService(instanceContext);

            _personProxy.Subscribe();
            _accountProxy.Subscribe();
            _eventProxy.Subscribe();

            LoggedInAccount = person;
            LogText         = LoggerHelper.Instance.ClientLogBuilder;

            PeopleList   = new ObservableCollection <Person>(_personProxy.GetAllPeople());
            AccountsList = new ObservableCollection <Account>(_accountProxy.GetAllAccounts());
            EventsList   = new ObservableCollection <Event>(_eventProxy.GetAllEvents());

            ListOfCommands = new List <BaseCommand>();
            CurrentCommand = 0;

            logger.Info("HomeViewModel constructor success.");
            LoggerHelper.Instance.LogMessage($"HomeViewModel constructor success.", EEventPriority.INFO, EStringBuilder.CLIENT);
            LogText = LoggerHelper.Instance.ClientLogBuilder;
        }
        public static IAccountServices ConnectToAccountService(InstanceContext instanceContext)
        {
            NetTcpBinding binding = new NetTcpBinding()
            {
                CloseTimeout   = new TimeSpan(0, 10, 0),
                OpenTimeout    = new TimeSpan(0, 10, 0),
                ReceiveTimeout = new TimeSpan(0, 10, 0),
                SendTimeout    = new TimeSpan(0, 10, 0),
            };
            DuplexChannelFactory <IAccountServices> accountChannelFactory = new DuplexChannelFactory <IAccountServices>(instanceContext, binding, new EndpointAddress("net.tcp://localhost:6001/IAccountServices"));
            IAccountServices accountProxy = accountChannelFactory.CreateChannel();

            return(accountProxy);
        }
Example #35
0
 public ApiVanSalesController(ITerminalServices terminalServices,
                              ITenantLocationServices tenantLocationServices, IOrderService orderService,
                              IProductServices productServices, IUserService userService, IMarketServices marketServices, IVanSalesService vanSalesService, IVehicleInspectionService inspectionService, IEmployeeServices employeeServices,
                              IAccountServices accountServices, ITransferOrderService transferOrderService, ITenantsServices tenantServices)
     : base(terminalServices, tenantLocationServices, orderService, productServices, userService)
 {
     _marketServices       = marketServices;
     _vanSalesService      = vanSalesService;
     _inspectionService    = inspectionService;
     _employeeServices     = employeeServices;
     _accountServices      = accountServices;
     _transferOrderService = transferOrderService;
     _tenantServices       = tenantServices;
 }
Example #36
0
 public BaseController(IUserServices userServices,
                       IAccountServices accountServices,
                       ICategoryServices categoryServices,
                       ITransactionServices transactionServices,
                       IBudgetServices budgetServices,
                       IHttpContextProvider context,
                       ISiteConfiguration config,
                       IUrlHelper urlHelper,
                       IModelCache cache,
                       ICachingHelpers cachingHelpers)
 {
     _userServices = userServices;
     _accountServices = accountServices;
     _categoryServices = categoryServices;
     _transactionServices = transactionServices;
     _budgetServices = budgetServices;
     _context = context;
     _config = config;
     _url = urlHelper;
     _cache = cache;
     _cachingHelpers = cachingHelpers;
 }
 public HomeController(IAccountServices accountServices)
 {
     _accountServices = accountServices;
 }
 public PredictabullController(IAccountServices predictabullAccountServices, ISelectionServices selectionServices)
 {
     _predictabullAccountServices = predictabullAccountServices;
     _selectionServices = selectionServices;
 }
Example #39
0
 /// <summary>
 /// ctor
 /// </summary>
 public AccountController(IAccountServices accountservices)
 {
     UserMailer = new UserMailer();
     this.AccountServices =  accountservices;
 }
Example #40
0
 public MainForm()
 {
     accountServices = Program.GetService<IAccountServices>();
     InitializeComponent();
     PopulateAccountsTabControl();
 }
Example #41
0
 public UserController(IAccountServices accountservices)
 {
     this.AccountServices = accountservices;
 }
 public PreferencesController(IAccountServices accountServices, IPreferenceServices preferenceServices)
 {
     _accountServices = accountServices;
     _preferenceServices = preferenceServices;
 }
Example #43
0
 public void Initialize()
 {
     services = new AccountServices(this);
 }
 public AccountsController(IAccountServices accountServices)
 {
     _accountServices = accountServices;
 }
 public CachingAccountServices(IAccountServices nonCachingAccountServices, IModelCache cache, ICachingHelpers helpers)
     : base(cache, helpers)
 {
     _accountServices = nonCachingAccountServices;
 }
 public AdminController(IUserRepository userRepository, IAccountServices accountServives)
 {
     _userRepository = userRepository;
     _accountServices = accountServives;
 }