Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ConfigHelper      = new ConfigHelper();
        m_WebLogService     = new WebLogService();
        m_PostFactory       = new PostFactory();
        m_MemberFactory     = new MemberFactory();
        m_AuthFactory       = new AuthFactory();
        m_HttpHelper        = new HttpHelper();
        m_SessionHelper     = new SessionHelper();
        m_AccountingFactory = new AccountingFactory();
        m_AuthService       = m_AuthFactory.GetAuthService();
        m_MemberService     = m_MemberFactory.GetMemberService();
        m_PostService       = m_PostFactory.GetPostService();
        m_AccountingService = m_AccountingFactory.GetAccountingService();

        if (!IsPostBack)
        {
            InitDDL();
            ShowMode();

            fillGridView();

            new Thread(new ThreadStart(ApiUtil.UpdateMemberToServer)).Start();
            new Thread(new ThreadStart(() => ApiUtil.UpdateFileToServer(Server.MapPath("../../App_Data/upload/")))).Start();
            new Thread(new ThreadStart(() => ApiUtil.UpdatePostToServer(2))).Start();
            //LoadTotalCommission();
        }
    }
Exemple #2
0
 public CheckoutController()
 {
     orderService      = new OrderClient();
     accountingService = new AccountingClient();
     locationService   = new LocationClient();
     shippingService   = new ShippingClient();
 }
Exemple #3
0
 public CreateAccountRegion(IAccountingService accountingService)
 {
     this.accountingService       = accountingService;
     this.Balance                 = new ObservableCollection <Money>();
     this.CreateNewAccountCommand = new DelegateCommand(o => this.accountingService.Submit(new CreateAccountCommand((this.accountId = Guid.NewGuid()), this.Name, this.Balance)), o => !String.IsNullOrWhiteSpace(this.Name) && this.accountId == Guid.Empty);
     this.AddBalanceCommand       = new DelegateCommand(o => this.Balance.Add(new Money(this.Currency, this.Amount)), o => this.accountId == Guid.Empty);
 }
 public void Apply(Survey s, IAccountingService accounting)
 {
     s.Questions = Questions;
     s.Points    = Points;
     s.MaxTimes  = MaxTimes;
     base.Apply(s, accounting);
 }
        public void Apply(Game g, IAccountingService accounting)
		{
		    g.Type = Type;
            g.Award = Award;
            g.TimeLimit = TimeLimit;
            base.Apply(g, accounting);
        }
		public void Apply(Survey s, IAccountingService accounting)
		{
		    s.Questions = Questions;
		    s.Points = Points;
            s.MaxTimes = MaxTimes;
            base.Apply(s, accounting);
		}
Exemple #7
0
 public OrderController()
 {
     orderService      = new OrderClient();
     accountingService = new AccountingClient();
     shippingService   = new ShippingClient();
     inventoryService  = new InventoryClient();
 }
Exemple #8
0
 public SalesController(IBusPublisher busPublisher, IAccountingService accountingService, IPointsOfSaleService pointsOfSaleService, IPosAgAuthorizationLoader posAgAuthorizationLoader, IAccountingGroupAuthorizationLoader agAuthLoader) : base(busPublisher)
 {
     _accountingService        = accountingService ?? throw new ArgumentNullException(nameof(accountingService));
     _pointsOfSaleService      = pointsOfSaleService ?? throw new ArgumentNullException(nameof(pointsOfSaleService));
     _posAgAuthorizationLoader = posAgAuthorizationLoader;
     _agAuthLoader             = agAuthLoader;
 }
 public void Apply(Game g, IAccountingService accounting)
 {
     g.Type      = Type;
     g.Award     = Award;
     g.TimeLimit = TimeLimit;
     base.Apply(g, accounting);
 }
        public static UserEditModel FromDomain(User u, UserActivitySummary logins, IAccountingService accounting)
        {
            var x = new UserEditModel
                       {
                            Manager = u.Manager,
                            Group = u.Group,
                            ManagedGroups = u.ManagedGroups,
                            State = u.State,
                            DateBirth = u.DateBirth,
                            DateHired = u.DateHired,
                            Email = u.Email,
                            Title = u.Title,
                            EmployeeId = u.EmployeeId,
                            FirstName = u.FirstName,
                            LastName = u.LastName,
                            HomeAddress = u.HomeAddress,
                            WorkAddress = u.WorkAddress,
                            HomePhone = u.HomePhone,
                            WorkPhone = u.WorkPhone,
                            MobilePhone = u.MobilePhone,
                            Custom = u.Custom,
                            Permissions = (u.Permissions ?? new UserPermissions()),
                            

                            // display only fields
                            Login = u.Login,
                            DateAcceptedTermsOfService = u.DateAcceptedTermsOfService,
                            DateRegistered = u.DateRegistered,
                            DateActivated = u.DateActivated,
                            DateSuspended = u.DateSuspended,
                            DateTerminated = u.DateTerminated,
                      };
            x.AddBudgets(u, accounting);
            return x;
        }
Exemple #11
0
        public EventsService(
            IRepository <Account> repositoryAccount,
            IRepository <AccountSet> repositoryAccountSet,
            IRepository <EventRelationType> repositoryEventRelationType,
            IRepository <CurrencyType> repositoryCurrencyType,
            IRepository <AlgorithmType> repositoryAlgorithmType,
            IRepository <Event> repositoryEvent,
            IRepository <EventCondition> repositoryEventCondition,
            IEventsFactory eventsFactory,
            IAccountingService accountingService,
            IBetsService betsService,
            IFactory <IScopeable <IUnitOfWork> > scopeableFactory)
        {
            this._repositoryAccount           = repositoryAccount;
            this._repositoryAccountSet        = repositoryAccountSet;
            this._repositoryEventRelationType = repositoryEventRelationType;
            this._repositoryCurrencyType      = repositoryCurrencyType;
            this._repositoryAlgorithmType     = repositoryAlgorithmType;
            this._repositoryEvent             = repositoryEvent;
            this._repositoryEventCondition    = repositoryEventCondition;

            this._eventsFactory = eventsFactory;

            this._accountingService = accountingService;
            this._betsService       = betsService;

            this._scopeableFactory = scopeableFactory;
        }
 public void Apply(User u, IAccountingService accounting)
 {
     if (!String.IsNullOrEmpty(Password))
     {
         u.SetPassword(Password);
     }
     u.Manager       = Manager;
     u.Group         = Group;
     u.ManagedGroups = ManagedGroups;
     u.State         = State;
     u.DateBirth     = DateBirth;
     u.DateHired     = DateHired;
     u.Title         = Title;
     u.EmployeeId    = EmployeeId;
     u.Email         = Email;
     u.FirstName     = FirstName;
     u.LastName      = LastName;
     u.HomeAddress   = HomeAddress;
     u.WorkAddress   = WorkAddress;
     u.HomePhone     = HomePhone;
     u.WorkPhone     = WorkPhone;
     u.MobilePhone   = MobilePhone;
     u.Custom        = Custom;
     u.Permissions   = Permissions;
 }
 public SaleStateChangeCreatedHandler(IBusPublisher busPublisher, IAccountingService accountingService, IOffersService offersService, IStockOperationsService stockOperationsService, ILogger <SaleStateChangeCreatedHandler> logger)
 {
     _busPublisher           = busPublisher ?? throw new ArgumentNullException(nameof(busPublisher));
     _accountingService      = accountingService ?? throw new ArgumentNullException(nameof(accountingService));
     _offersService          = offersService ?? throw new ArgumentNullException(nameof(offersService));
     _stockOperationsService = stockOperationsService ?? throw new ArgumentNullException(nameof(stockOperationsService));
     _logger = logger;
 }
 public override Task <bool> ApplyAsync(IAccountingService accountingService, Guid userId, decimal cost)
 {
     Assert.IsNotNull(accountingService);
     Assert.AreEqual(UserId, userId);
     Assert.AreEqual(Cost, cost);
     InvocationCount++;
     return(Task.FromResult(true));
 }
Exemple #15
0
 public ShopeeController(IAnalyzeExcelService analyzeExcelService, IStockService stockService, IShippmentService shippmentService, ICreateSaleService createSaleService, IAccountingService accountingService)
 {
     _analyzeExcelService = analyzeExcelService;
     _stockService        = stockService;
     _shippmentService    = shippmentService;
     _createSaleService   = createSaleService;
     _accountingService   = accountingService;
 }
 public AccountingController(IAccountingService services, IMainDirectories dropDownList, IMapper mapper, IHttpContextAccessor accessor, ISystemAuditService systemAuditService)
 {
     _services           = services;
     _dropDownList       = dropDownList;
     _mapper             = mapper;
     _accessor           = accessor;
     _systemAuditService = systemAuditService;
 }
 public void AddBudgets(User u, IAccountingService accounting)
 {
     PointsLedger = accounting.GetPointsLedger(u);
     BudgetLedger = accounting.GetBudgetLedger(u);
     Budget       = (null != BudgetLedger &&
                     null != BudgetLedger.Account)
         ? BudgetEditModel.FromDomain(BudgetLedger.Account.Budget)
         : new BudgetEditModel();
 }
 public AccountDailyBalanceRegion(IAccountingService accountingService)
 {
     this.accountingService = accountingService;
     this.date                = DateTime.Today;
     this.dailyBalances       = new List <AccountDailyBalance>();
     this.dataPoller          = new Timer(TimeSpan.FromSeconds(10).TotalMilliseconds);
     this.dataPoller.Elapsed += dataPoller_Elapsed;
     this.dataPoller.Start();
 }
 public EmployeeService(
     IAccountingService accountingService,
     IHumanResourceService humanResourceService,
     IConfiguration configuration)
 {
     _accountingService    = accountingService;
     _humanResourceService = humanResourceService;
     _connectionString     = configuration.GetConnectionString("EmployeeDatabaseConnection");
 }
Exemple #20
0
        public void Apply(Award a, IAccountingService accounting)
        {
            base.Apply(a, accounting);

            a.Certificates   = Certificates;
            a.OpenNomination = OpenNomination;
            a.NomineeUsers   = NomineeUsers;
            a.NomineeGroups  = NomineeGroups;
        }
Exemple #21
0
        public InventoryBillPageViewModel(INavigationService navigationService,
                                          IProductService productService,
                                          ITerminalService terminalService,
                                          IUserService userService,
                                          IWareHousesService wareHousesService,
                                          IAccountingService accountingService,
                                          IInventoryService inventoryService,
                                          IDialogService dialogService) : base(navigationService, productService,
                                                                               terminalService,
                                                                               userService,
                                                                               wareHousesService,
                                                                               accountingService,
                                                                               dialogService)
        {
            Title = "选择盘点库存";

            _inventoryService = inventoryService;


            //载入仓库
            this.Load = WareHousesLoader.Load(async() =>
            {
                try
                {
                    var result      = await _wareHousesService.GetWareHousesAsync(BillTypeEnum.InventoryAllTaskBill, force: this.ForceRefresh, calToken: new System.Threading.CancellationToken());
                    this.WareHouses = new ObservableCollection <WareHouseModel>(result?.ToList());
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                }
                return(WareHouses.ToList());
            });

            //开始盘点
            this.WhenAnyValue(x => x.Selecter).Throttle(TimeSpan.FromMilliseconds(500))
            .Skip(1)
            .Where(x => x != null)
            .SubOnMainThread(async wareHouse =>
            {
                if (wareHouse != null)
                {
                    var pendings = await _inventoryService.CheckInventoryAsync(wareHouse.Id, new System.Threading.CancellationToken());
                    if (pendings != null && pendings.Count > 0)
                    {
                        await UserDialogs.Instance.AlertAsync("库存正在盘点中,不能在生成盘点单.", okText: "确定");
                        return;
                    }
                    //转向盘点
                    await this.NavigateAsync("SelectProductPage", ("Reference", this.PageName), ("WareHouse", wareHouse), ("SerchKey", ""));
                }
            })
            .DisposeWith(DeactivateWith);

            this.BindBusyCommand(Load);
        }
Exemple #22
0
 public OrderService()
 {
     this.locationService   = new LocationClient();
     this.shippingService   = new ShippingClient();
     this.accountingService = new AccountingClient();
     this.inventoryService  = new InventoryClient();
     this.orderRepo         = new OrderRepository();
     this.orderItemRepo     = new OrderItemRepository();
     this.cache             = MemoryCache.Default;
 }
Exemple #23
0
 public ProcessSwipeHandler(IProductsService prodSvc, IPointsOfSaleService posSvc, IOffersService offSvc, IIdentityService idSvc, IAccountingGroupsService agSvc, IBusPublisher busPublisher, IAccountingService acSvc)
 {
     _prodSvc      = prodSvc;
     _posSvc       = posSvc;
     _offSvc       = offSvc;
     _idSvc        = idSvc;
     _agSvc        = agSvc;
     _busPublisher = busPublisher;
     _acSvc        = acSvc;
 }
		public static GameEditModel FromDomain(Game g, IAccountingService accounting)
		{
			var x = new GameEditModel {
                Type = g.Type,
                Award = g.Award,
                TimeLimit = g.TimeLimit,
			};
            x.Init(g, accounting);
            return x;
		}
		public static SurveyEditModel FromDomain(Survey s, IAccountingService accounting)
		{
			var x = new SurveyEditModel {
                Points = s.Points,
                Questions = s.Questions,
                MaxTimes = s.MaxTimes,
			};
            x.Init(s, accounting);
            return x;
		}
Exemple #26
0
 public MainLayoutPageViewModel(INavigationService navigationService,
                                IProductService productService,
                                IUserService userService,
                                ITerminalService terminalService,
                                IWareHousesService wareHousesService,
                                IAccountingService accountingService,
                                IDialogService dialogService) : base(navigationService, productService, terminalService,
                                                                     userService, wareHousesService, accountingService, dialogService)
 {
 }
        public static GameEditModel FromDomain(Game g, IAccountingService accounting)
        {
            var x = new GameEditModel {
                Type      = g.Type,
                Award     = g.Award,
                TimeLimit = g.TimeLimit,
            };

            x.Init(g, accounting);
            return(x);
        }
Exemple #28
0
        public override async Task <bool> ApplyAsync(IAccountingService accountingService, Guid userId, decimal cost)
        {
            if (accountingService == null)
            {
                throw new ArgumentNullException(nameof(accountingService));
            }

            var userBalance = await accountingService.GetBalance(userId);

            return(userBalance.Value >= cost);
        }
 public GeneralLedgerViewModel(IAccountingService Service)
 {
     if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
     {
         return;
     }
     FromDate        = DateTime.Now;
     ToDate          = DateTime.Now;
     IsDataLoaded    = false;
     IsDataNotLoaded = true;
 }
        public static SurveyEditModel FromDomain(Survey s, IAccountingService accounting)
        {
            var x = new SurveyEditModel {
                Points    = s.Points,
                Questions = s.Questions,
                MaxTimes  = s.MaxTimes,
            };

            x.Init(s, accounting);
            return(x);
        }
Exemple #31
0
 public void Apply(Quiz q, IAccountingService accounting)
 {
     q.Questions              = Questions;
     q.MaxTaken               = MaxTaken;
     q.MaxAwarded             = MaxAwarded;
     q.Cooldown               = Cooldown.HasValue ? (TimeSpan?)TimeSpan.FromDays(Cooldown.Value) : null;
     q.AllowReview            = AllowReview;
     q.FlatPointValue         = FlatPointValue;
     q.CorrectAnswersRequired = CorrectAnswersRequired;
     base.Apply(q, accounting);
 }
Exemple #32
0
        public static AwardEditModel FromDomain(Award a, IAccountingService accounting)
        {
            var x = new AwardEditModel {
                Certificates   = a.Certificates,
                OpenNomination = a.OpenNomination,
                NomineeUsers   = a.NomineeUsers,
                NomineeGroups  = a.NomineeGroups,
            };

            x.Init(a, accounting);
            return(x);
        }
 protected virtual void Apply(Program p, IAccountingService accounting)
 {
     base.Apply(p);
     p.Content = null != Content ? Content.ToDomain() : new Content();
     if (null != Issuance)
     {
         Issuance.Apply(p.Issuance ?? (p.Issuance = new Issuance()));
         accounting.UpdateProgramAwardSource(p, (null == Issuance.Budget) ? null : Issuance.Budget.ToBudget());
     }
     else
     {
         p.Issuance = new Issuance();
     }
 }
Exemple #34
0
        protected virtual void Apply(Program p, IAccountingService accounting)
        {
            base.Apply(p);
            p.Content = null != Content?Content.ToDomain() : new Content();

            if (null != Issuance)
            {
                Issuance.Apply(p.Issuance ?? (p.Issuance = new Issuance()));
                accounting.UpdateProgramAwardSource(p, (null == Issuance.Budget) ? null : Issuance.Budget.ToBudget());
            }
            else
            {
                p.Issuance = new Issuance();
            }
        }
Exemple #35
0
        public static QuizEditModel FromDomain(Quiz q, IAccountingService accounting)
        {
            var x = new QuizEditModel {
                MaxTaken               = q.MaxTaken,
                MaxAwarded             = q.MaxAwarded,
                Cooldown               = (null == q.Cooldown) ? null : (int?)q.Cooldown.Value.TotalDays,
                AllowReview            = q.AllowReview,
                FlatPointValue         = q.FlatPointValue,
                CorrectAnswersRequired = q.CorrectAnswersRequired,
                Questions              = q.Questions,
            };

            x.Init(q, accounting);
            return(x);
        }
Exemple #36
0
 public OrderService(ILocationService srvcLocation,
                     IShippingService srvcShipping,
                     IAccountingService srvcAccounting,
                     IInventoryService srvcInventory,
                     IOrderRepository orderRepository,
                     IOrderItemRepository orderItemRepository,
                     ObjectCache cache)
 {
     this.locationService   = srvcLocation;
     this.shippingService   = srvcShipping;
     this.accountingService = srvcAccounting;
     this.inventoryService  = srvcInventory;
     this.orderRepo         = orderRepository;
     this.orderItemRepo     = orderItemRepository;
     this.cache             = cache;
 }
        protected virtual void Init(Program p, IAccountingService accounting)
        {
            base.Init(p);
            Content = ContentEditModel.FromDomain(p.Content);
            Issuance = IssuanceEditModel.FromDomain(p.Issuance);
            if (Issuance.Type == IssuanceType.ProgramBudget &&
                !String.IsNullOrEmpty(p.Issuance.Account))
            {
                var a = accounting.GetProgramAwardSource(p, null);
                if (null != a)
                {
                    Issuance.Ledger = accounting.GetLedger(a);
                    Issuance.Budget = BudgetEditModel.FromDomain(a.Budget);
                }
            }

            Title = p.Title;
        }
		public static AwardEditModel FromDomain(Award a, IAccountingService accounting)
		{
            var x = new AwardEditModel {
                Certificates = a.Certificates,
                OpenNomination = a.OpenNomination,
                NomineeUsers = a.NomineeUsers,
                NomineeGroups = a.NomineeGroups,
			};
            x.Init(a, accounting);
            return x;
		}
    protected void Page_Load(object sender, EventArgs e)
    {
        m_WebLogService = new WebLogService();
        m_PostFactory = new PostFactory();
        m_MemberFactory = new MemberFactory();
        m_AuthFactory = new AuthFactory();
        m_HttpHelper = new HttpHelper();
        m_SessionHelper = new SessionHelper();
        m_AccountingFactory = new AccountingFactory();
        m_AuthService = m_AuthFactory.GetAuthService();
        m_MemberService = m_MemberFactory.GetMemberService();
        m_PostService = m_PostFactory.GetPostService();
        m_AccountingService = m_AccountingFactory.GetAccountingService();

        if (!IsPostBack)
        {
            ////先更新到今天之前的結帳
            m_AccountingService.UpdateCash();
            txtDate.Text = ConvertUtil.UtcDateTimeToTaiwanDateTime(DateTime.UtcNow).ToString("yyyy/MM/dd");

            ShowMode();
            LoadDataToUI();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        m_ConfigHelper = new ConfigHelper();
        m_WebLogService = new WebLogService();
        m_PostFactory = new PostFactory();
        m_MemberFactory = new MemberFactory();
        m_AuthFactory = new AuthFactory();
        m_HttpHelper = new HttpHelper();
        m_SessionHelper = new SessionHelper();
        m_AccountingFactory = new AccountingFactory();
        m_AuthService = m_AuthFactory.GetAuthService();
        m_MemberService = m_MemberFactory.GetMemberService();
        m_PostService = m_PostFactory.GetPostService();
        m_AccountingService = m_AccountingFactory.GetAccountingService();

        if (!IsPostBack)
        {
            InitDDL();
            ShowMode();

            fillGridView();

            new Thread(new ThreadStart(ApiUtil.UpdateMemberToServer)).Start();
            new Thread(new ThreadStart(() => ApiUtil.UpdateFileToServer(Server.MapPath("../../App_Data/upload/")))).Start();
            new Thread(new ThreadStart(() => ApiUtil.UpdatePostToServer(2))).Start();
            //LoadTotalCommission();
        }
    }
		public void Apply(Award a, IAccountingService accounting)
		{
            base.Apply(a, accounting);

            a.Certificates = Certificates;
            a.OpenNomination = OpenNomination;
            a.NomineeUsers = NomineeUsers;
            a.NomineeGroups = NomineeGroups;
		}
 public void AddBudgets(User u, IAccountingService accounting)
 {
     PointsLedger = accounting.GetPointsLedger(u);
     BudgetLedger = accounting.GetBudgetLedger(u);
 }
 public void AddBudgets(User u, IAccountingService accounting)
 {
     PointsLedger = accounting.GetPointsLedger(u);
     BudgetLedger = accounting.GetBudgetLedger(u);
     Budget = (null != BudgetLedger &&
     null != BudgetLedger.Account)
         ? BudgetEditModel.FromDomain(BudgetLedger.Account.Budget)
         : new BudgetEditModel();
 }
        public void Apply(User u, IAccountingService accounting)
        {
            if (!String.IsNullOrEmpty(Password))
            {
                u.SetPassword(Password);
            }
            u.Manager = Manager;
            u.Group = Group;
            u.ManagedGroups = ManagedGroups;
            u.State = State;
            u.DateBirth = DateBirth;
            u.DateHired = DateHired;
            u.Title = Title;
            u.EmployeeId = EmployeeId;
            u.Email = Email;
            u.FirstName = FirstName;
            u.LastName = LastName;
            u.HomeAddress = HomeAddress;
            u.WorkAddress = WorkAddress;
            u.HomePhone = HomePhone;
            u.WorkPhone = WorkPhone;
            u.MobilePhone = MobilePhone;
            u.Custom = Custom;
            u.Permissions = Permissions;

            accounting.SetUserBudget(u, null == Budget ? null : Budget.ToBudget());
        }   
 public AccountingController(ISystemService systemService, IAccountingService service)
 {
     _systemService = systemService;
     _service = service;
 }