Пример #1
0
        public void StealMoney(int modelFrom, int modelTo, decimal amount, string comment)
        {
            var from = GetSINByModelId(modelFrom, s => s.Character, s => s.Wallet);
            var to   = GetSINByModelId(modelTo, s => s.Character, s => s.Wallet);

            if (BillingHelper.IsAdmin(modelFrom))
            {
                throw new BillingException("У него нельзя воровать. Ваше местоположение зафиксировано, информация в нужные службы поступила");
            }
            MakeTransferSINSIN(from, to, amount, comment, false);
        }
Пример #2
0
        public OrganisationViewModel GetAvailableOrganisations(int modelId)
        {
            var isAdmin = BillingHelper.IsAdmin(modelId);
            var model   = new OrganisationViewModel
            {
                CurrentModelId       = modelId,
                CurrentCharacterName = GetCharacterName(modelId)
            };
            var sin = GetSINByModelId(modelId);

            if (sin == null)
            {
                throw new BillingNotFoundException($"sin not found {modelId}");
            }
            model.Shops = GetShops(modelId, s => (isAdmin || s.OwnerId == modelId || s.TrustedUsers.Any(t => t.Model == modelId)));
            if (isAdmin)
            {
                model.Shops.ForEach(s => s.IsOwner = true);
            }
            model.Corporations = GetCorporationDtos(s => s.OwnerId == modelId || isAdmin);
            return(model);
        }