Exemple #1
0
 public Account(int accountNumber, string name, AccountType accountAccountType)
 {
     AccountNumber = accountNumber;
     Name = name;
     Type = accountAccountType;
     _transactions = new List<ITransaction>();
 }
Exemple #2
0
 public TinyPicUploader(string id, string key, AccountType accountType = AccountType.Anonymous, string shuk = null)
 {
     TinyPicID = id;
     TinyPicKey = key;
     AccountType = accountType;
     Shuk = shuk;
 }
 public SteamAccount(string username, string password)
 {
     this.name = username;
     this.username = username;
     this.password = password;
     this.type = AccountType.Main;
 }
        public void CreditAccount(AccountType accountType, Money amount)
        {
            GuardPortfolioState();

            var account = Get<Account>(new AccountId(accountType));
            account.Credit(amount);
        }
Exemple #5
0
 public Account( int num, AccountType type )
 {
     Number = num;
     Amount = 0;
     Type = type;
     History = new List<HistoryEntry>();
 }
 internal Account(AccountTypeEnum accountType, Money initialDeposit)
 {
     this.accountType = accountType;
     ledger = new Ledger(accountType);
     this.accountType.ValidateBalance(initialDeposit);
     ledger.DepositMoney(initialDeposit);
 }
        public AccountSession(IDictionary<string, string> authenticationResponseValues, string clientId = null, AccountType accountType = AccountType.None)
        {
            this.AccountType = accountType;
            this.ClientId = clientId;

            this.ParseAuthenticationResponseValues(authenticationResponseValues);
        }
 /// <summary>
 /// Factory method to assemble and return an account based on passed account type.
 /// </summary>
 /// <param name="accountType">Type of the account.</param>
 /// <returns>
 /// new account
 /// </returns>
 /// <exception cref="System.ArgumentException"></exception>
 public Account CreateAccount(AccountType accountType)
 {
     Func<IDateProvider, Account> f;
     if (!accMap.TryGetValue(accountType, out f))
         throw new ArgumentException(string.Format("Cannot instantiate account of type {0}", accountType));
     return f(dateProvider);
 }
Exemple #9
0
        private static Account CreateAccount(string name, AccountType accountType)
        {
            var account = new Account(name, accountType);
            account.Id = Regex.Replace(account.Name.ToLower(), "[^a-z0-9-/]", "");

            return account;
        }
Exemple #10
0
 public WindowsAccount(string name, bool? enabled, string accountSID, AccountType type)
 {
     this.Name = name;
     this.Enabled = enabled;// ?? true;
     this.AccountSID = accountSID;
     this.AccountType = type;
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RateEndpoints"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="accountType">Type of the account.</param>
 /// <param name="accountId">The account identifier.</param>
 public RateEndpoints(string key, AccountType accountType, int accountId)
     : base(key, accountType)
 {
     _accountId = accountId;
     _key = key;
     _accountType = accountType;
 }
 public Account(string email, string name, AccountType role)
 {
     id = -1;
     this.Email = email;
     this.Name = name;
     this.Role = role;
 }
Exemple #13
0
 public SignedInUser(AccountType accountType, int userId, string userName, bool isAuthenticated)
 {
     AccountType = accountType;
     AccountId = userId;
     UserName = userName;
     IsAuthenticated = isAuthenticated;
 }
Exemple #14
0
 public Account(AccountType type, Customer accountCustumer, decimal balance, decimal interestRate)
 {
     this.Type = type;
     this.AccountCustomer = accountCustumer;
     this.Balance = balance;
     this.InterestRate = interestRate;
 }
 internal AdalAccountSession(
     IDictionary<string, string> authenticationResponseValues,
     string clientId = null,
     AccountType accountType = AccountType.None)
     : base(authenticationResponseValues, clientId, accountType)
 {
 }
Exemple #16
0
 public Account(int id, string name, string password, AccountType type)
     : base(id)
 {
     Name = name;
     Password = password;
     Type = type;
 }
Exemple #17
0
 protected Account(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, AccountType type, string url)
 {
     AvatarUrl = avatarUrl;
     Bio = bio;
     Blog = blog;
     Collaborators = collaborators;
     Company = company;
     CreatedAt = createdAt;
     DiskUsage = diskUsage;
     Email = email;
     Followers = followers;
     Following = following;
     Hireable = hireable;
     HtmlUrl = htmlUrl;
     TotalPrivateRepos = totalPrivateRepos;
     Id = id;
     Location = location;
     Login = login;
     Name = name;
     OwnedPrivateRepos = ownedPrivateRepos;
     Plan = plan;
     PrivateGists = privateGists;
     PublicGists = publicGists;
     PublicRepos = publicRepos;
     Type = type;
     Url = url;
 }
Exemple #18
0
 /// <summary>
 /// Internal constructor.
 /// </summary>
 protected Account(AccountType accountType, BalanceType defaultBalanceType)
     : base()
 {
     this.AccountID = Guid.NewGuid();
     this.AccountType = accountType;
     this.DefaultBalanceType = defaultBalanceType;
 }
 public void SetAccountType(AccountType type)
 {
     if ((Application.platform != RuntimePlatform.OSXEditor) && (Application.platform != RuntimePlatform.WindowsEditor))
     {
         _tdgaSetAccountType((int) type);
     }
 }
Exemple #20
0
        public static bool CanFindAccount(this Cmdlet command, AccountIdentity account, AccountType accountType)
        {
            if (account == null)
            {
                return false;
            }
            var name = account.Name;
            var error = $"Cannot find an account with identity '{name}'.";

            if (accountType == AccountType.Role && !Role.Exists(name))
            {
                command.WriteError(new ErrorRecord(new ObjectNotFoundException(error), ErrorIds.AccountNotFound.ToString(),
                    ErrorCategory.ObjectNotFound, account));
                return false;
            }

            if (accountType == AccountType.User && !User.Exists(name))
            {
                command.WriteError(new ErrorRecord(new ObjectNotFoundException(error), ErrorIds.AccountNotFound.ToString(),
                    ErrorCategory.ObjectNotFound, account));
                return false;
            }

            return true;
        }
 public AccountAlreadyOpened(AccountType type, Int64 number, Decimal balance, AccountStatus status)
 {
     AccountType = type;
     AccountNumber = number;
     Balance = balance;
     Status = status;
 }
Exemple #22
0
        public ShopifyShop(string address1, string city, string country, DateTime createdAt,
				string domain, string email, int id, string name, string phone, string province,
				bool Public, string source, string zip, CurrencyCode currency,
				string timezone, string shopOwner, string moneyFormat, bool taxesIncluded,
				string taxShipping, AccountType planName)
        {
            this.Address1 = address1;
            this.City = city;
            this.Country = country;
            this.CreatedAt = createdAt;
            this.Domain = domain;
            this.Email = email;
            this.Id = id;
            this.Name = name;
            this.Phone = phone;
            this.Province = province;
            this.Public = Public;
            this.Source = source;
            this.Zip = zip;
            this.Currency = currency;
            this.Timezone = timezone;
            this.ShopOwner = shopOwner;
            this.MoneyFormat = moneyFormat;
            this.TaxesIncluded = taxesIncluded;
            this.TaxShipping = taxShipping;
            this.PlanName = planName;
        }
Exemple #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Account"/> class.
 /// </summary>
 /// <param name="accountType">Type of the account.</param>
 /// <param name="interestCalculator">The interest calculator.</param>
 /// <param name="dateProvider">The date provider.</param>
 public Account(AccountType accountType,IInterestCalculator interestCalculator,IDateProvider dateProvider)
 {
     AccountType = accountType;
     transactionsList = new List<Transaction>();
     this.interestCalculator = interestCalculator;
     this.dateProvider = dateProvider;
 }
        public void DebitAccount(AccountType accountType, Money amount)
        {
            GuardPortfolioState();
            GuardPortfolioBalance(accountType, amount);

            var account = Get<Account>(new AccountId(accountType));
            account.Debit(amount);
        }
Exemple #25
0
 // Do we need id here?
 public Account(long accountId, string currency, long ownerPersonId, string name, AccountType type)
 {
     this.accountId = accountId;
     this.currency = currency;
     this.ownerPersonId = ownerPersonId;
     this.name = name;
     this.type = type;
 }
Exemple #26
0
			public Account (string server, string path, int port, AccountType type, char delim)
			{
				this.server_string = server;
				this.path = path;
				this.server_port = port;
				this.account_type = type;
				this.delimiter = delim;
			}
Exemple #27
0
 public AccountDTO(Int32 accountID, Decimal balance, CurrencyType currency, AccountType typeOfAccount, Int32 client_ClientID)
 {
     this.AccountID = accountID;
     this.Balance = balance;
     this.Currency = currency;
     this.TypeOfAccount = typeOfAccount;
     this.Client_ClientID = client_ClientID;
 }
        public void setUserRole(String username, AccountType accountType)
        {
            AccountDAO accountDao = new AccountDAO();
            AccountDTO accountDto = accountDao.find(username);

            accountDto.accountType = accountType.ToString();
            accountDao.merge(accountDto);
        }
Exemple #29
0
        public Account(User user, AccountType type)
        {
            _user = user;
            _Id++;

            _type = type;
            _AccountId = type.ToString() + _Id.ToString();
        }
Exemple #30
0
        public Account(Guid accountId, AccountType accountType, Security security, Account parentAccount, string name, int? smallestFraction)
        {
            if (accountId == Guid.Empty)
            {
                throw new ArgumentOutOfRangeException("accountId");
            }

            if (!Enum.GetValues(typeof(AccountType)).Cast<AccountType>().Contains(accountType))
            {
                throw new ArgumentOutOfRangeException("accountType");
            }

            if (security == null && smallestFraction.HasValue)
            {
                throw new ArgumentNullException("security");
            }

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            if (security != null && !smallestFraction.HasValue)
            {
                throw new ArgumentNullException("smallestFraction");
            }

            if (smallestFraction <= 0)
            {
                throw new ArgumentOutOfRangeException("smallestFraction");
            }

            if (security != null)
            {
                if (security.FractionTraded % smallestFraction != 0)
                {
                    throw new InvalidOperationException("An account's smallest fraction must represent a whole number multiple of the units used by its security");
                }
            }

            var parent = parentAccount;
            while (parent != null)
            {
                if (parent.AccountId == accountId)
                {
                    throw new InvalidOperationException("An account may not share an its Account Id with any of its ancestors.");
                }

                parent = parent.ParentAccount;
            }

            this.accountId = accountId;
            this.accountType = accountType;
            this.security = security;
            this.parentAccount = parentAccount;
            this.name = name;
            this.smallestFraction = smallestFraction;
        }
        public IEnumerable <CustomerAccount> GetByAccountType(AccountType accountType)
        {
            var value = _db.GetByAccountType(accountType);

            return(value);
        }
Exemple #32
0
 public bool CheckNegativeDataExists(List <ExpenseData> expenses, string category, string subCategory, AccountType type)
 {
     return(expenses.Any(expense => expense.CategoryName == category && expense.SubCategory == subCategory));
 }
Exemple #33
0
        /// <summary>
        /// Creates a new <see cref="IBrokerageModel"/> for the specified <see cref="BrokerageName"/>
        /// </summary>
        /// <param name="orderProvider">The order provider</param>
        /// <param name="brokerage">The name of the brokerage</param>
        /// <param name="accountType">The account type</param>
        /// <returns>The model for the specified brokerage</returns>
        public static IBrokerageModel Create(IOrderProvider orderProvider, BrokerageName brokerage, AccountType accountType)
        {
            switch (brokerage)
            {
            case BrokerageName.Default:
                return(new DefaultBrokerageModel(accountType));

            case BrokerageName.InteractiveBrokersBrokerage:
                return(new InteractiveBrokersBrokerageModel(accountType));

            case BrokerageName.TradierBrokerage:
                return(new TradierBrokerageModel(accountType));

            case BrokerageName.OandaBrokerage:
                return(new OandaBrokerageModel(accountType));

            case BrokerageName.FxcmBrokerage:
                return(new FxcmBrokerageModel(accountType));

            case BrokerageName.Bitfinex:
                return(new BitfinexBrokerageModel(accountType));

            case BrokerageName.Binance:
                return(new BinanceBrokerageModel(accountType));

            case BrokerageName.BinanceUS:
                return(new BinanceUSBrokerageModel(accountType));

            case BrokerageName.GDAX:
                return(new GDAXBrokerageModel(accountType));

            case BrokerageName.AlphaStreams:
                return(new AlphaStreamsBrokerageModel(accountType));

            case BrokerageName.Zerodha:
                return(new ZerodhaBrokerageModel(accountType));

            case BrokerageName.Atreyu:
                return(new AtreyuBrokerageModel(accountType));

            case BrokerageName.TradingTechnologies:
                return(new TradingTechnologiesBrokerageModel(accountType));

            case BrokerageName.Samco:
                return(new SamcoBrokerageModel(accountType));

            case BrokerageName.Kraken:
                return(new KrakenBrokerageModel(accountType));

            case BrokerageName.Exante:
                return(new ExanteBrokerageModel(accountType));

            case BrokerageName.FTX:
                return(new FTXBrokerageModel(accountType));

            case BrokerageName.FTXUS:
                return(new FTXUSBrokerageModel(accountType));

            default:
                throw new ArgumentOutOfRangeException(nameof(brokerage), brokerage, null);
            }
        }
Exemple #34
0
        public void FreeAccountWithdrawalRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, bool expectedResult)
        {
            IWithdraw ruke = new FreeAccountWithdrawRule();
            Account   juke = new Account();

            juke.AccountNumber = accountNumber;
            juke.Name          = name;
            juke.Balance       = balance;
            juke.Type          = accountType;

            AccountWithdrawResponse adr = ruke.Withdraw(juke, amount);

            Assert.AreEqual(expectedResult, adr.Success);
        }
        /// <summary>
        /// Creates a new <see cref="IBrokerageModel"/> for the specified <see cref="BrokerageName"/>
        /// </summary>
        /// <param name="orderProvider">The order provider</param>
        /// <param name="brokerage">The name of the brokerage</param>
        /// <param name="accountType">The account type</param>
        /// <returns>The model for the specified brokerage</returns>
        public static IBrokerageModel Create(IOrderProvider orderProvider, BrokerageName brokerage, AccountType accountType)
        {
            switch (brokerage)
            {
            case BrokerageName.Default:
                return(new DefaultBrokerageModel(accountType));

            case BrokerageName.InteractiveBrokersBrokerage:
                return(new InteractiveBrokersBrokerageModel(accountType));

            case BrokerageName.TradierBrokerage:
                return(new TradierBrokerageModel(accountType));

            case BrokerageName.OandaBrokerage:
                return(new OandaBrokerageModel(accountType));

            case BrokerageName.FxcmBrokerage:
                return(new FxcmBrokerageModel(accountType));

            case BrokerageName.Bitfinex:
                return(new BitfinexBrokerageModel(accountType));

            case BrokerageName.GDAX:
                return(new GDAXBrokerageModel(accountType));

            case BrokerageName.Alpaca:
                return(new AlpacaBrokerageModel(orderProvider, accountType));

            case BrokerageName.AlphaStreams:
                return(new AlphaStreamsBrokerageModel(accountType));

            default:
                throw new ArgumentOutOfRangeException(nameof(brokerage), brokerage, null);
            }
        }
 public CompanyAccounts(decimal balance, decimal monthlyRate, AccountType typeOfAccount)
     : base(balance, monthlyRate, typeOfAccount)
 {
 }
 // Constructors
 public DepositAccount(AccountType type, AccountCurrency currency, AccountPeriod period, Customer owner,
                       long accountNumber)
     : base(type, currency, period, owner, accountNumber)
 {
 }
Exemple #38
0
        private IList <Account> GetCustomers(string sWhere)
        {
            IList <Account>     list = new List <Account>();
            Account             tmpData;
            AccountTypeRelation tmpAccTypeRel;

            try
            {
                //Lamar los documents que necesita del Erp usando econnect
                //TODO: Revisar obtener solo lo modificado last X days
                ds = DynamicsGP_ec.GetDataSet(DynamicsGP_ec.RetreiveData("Customer", false, 2, 0, sWhere, true));

                if (ds.Tables.Count == 0)
                {
                    return(null);
                }

                //Company company = WType.GetDefaultCompany();
                AccountType accType = WType.GetAccountType(new AccountType {
                    AccountTypeID = AccntType.Customer
                });
                Status status = WType.GetStatus(new Status {
                    StatusID = EntityStatus.Active
                });

                //En el dataset, Tables: 1 - CustomerHeader, 2 - CustomerAddress
                foreach (DataRow dr in ds.Tables[1].Rows)
                {
                    //Map Properties
                    tmpData = new Account();

                    try
                    {
                        tmpData.AccountCode = dr["CUSTNMBR"].ToString();

                        if (string.IsNullOrEmpty(tmpData.AccountCode))
                        {
                            continue;
                        }

                        tmpData.Company       = CurCompany;
                        tmpData.ContactPerson = dr["CNTCPRSN"].ToString();

                        tmpData.Name        = dr["CUSTNAME"].ToString();
                        tmpData.Phone       = dr["PHONE1"].ToString();
                        tmpData.UserDefine1 = dr["USERDEF1"].ToString();
                        tmpData.UserDefine2 = dr["USERDEF2"].ToString();

                        //Account Type
                        tmpAccTypeRel              = new AccountTypeRelation();
                        tmpAccTypeRel.Account      = tmpData;
                        tmpAccTypeRel.AccountType  = accType;
                        tmpAccTypeRel.ErpCode      = dr["CUSTNMBR"].ToString();
                        tmpAccTypeRel.Status       = status;
                        tmpAccTypeRel.CreationDate = DateTime.Now;
                        tmpAccTypeRel.CreatedBy    = WmsSetupValues.SystemUser;
                        tmpData.AccountTypes       = new AccountTypeRelation[] { tmpAccTypeRel };
                        tmpData.IsFromErp          = true;
                        tmpData.BaseType           = accType;

                        //Asignacion de Lines
                        tmpData.AccountAddresses = GetCustomerAddress(tmpData,
                                                                      ds.Tables[2].Select("CUSTNMBR='" + dr["CUSTNMBR"].ToString() + "'"));

                        list.Add(tmpData);
                    }

                    catch (Exception ex) {
                        ExceptionMngr.WriteEvent("GetCustomers:" + tmpData.AccountCode + "-" +
                                                 tmpData.Name, ListValues.EventType.Error, ex, null, ListValues.ErrorCategory.ErpConnection);
                    }
                }

                //retornar la lista
                return(list);
            }
            catch (Exception ex)
            {
                ExceptionMngr.WriteEvent("GetCustomers", ListValues.EventType.Error, ex, null, ListValues.ErrorCategory.ErpConnection);
                //throw;
                return(null);
            }
        }
Exemple #39
0
        public void BasicAccountDepositRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, decimal newBalance, bool expectedResult)
        {
            NoLimitDepositRule noLimitDepositRule = new NoLimitDepositRule();
            Account            account            = new Account();

            IDeposit    deposit = noLimitDepositRule;
            AccountType type    = account.Type;

            account.AccountNumber = accountNumber;
            account.Type          = accountType;
            account.Name          = name;
            account.Balance       = balance;

            AccountDepositResponse response = deposit.Deposit(account, amount);

            Assert.AreEqual(expectedResult, response.Success);
        }
Exemple #40
0
 protected void RadioButton2(object sender, EventArgs a)
 {
     accountType = AccountType.Deposit;
 }
Exemple #41
0
 protected void RadioButton1(object sender, EventArgs a)
 {
     accountType = AccountType.Ordinary;
 }
Exemple #42
0
        /// <summary>
        /// 下一步允許的流程
        /// </summary>
        /// <param name="nowStatus">現在訂單狀態</param>
        /// <param name="user">登入者身分(Member/Admin)</param>
        /// <param name="OrderStatuses">包含訂單流程</param>
        /// <returns></returns>
        public static List <OrderStatus> AllowSteps(OrderStatus nowStatus, AccountType user, List <OrderStatus> OrderStatuses)
        {
            //允許的流程
            var model = new List <OrderStatus>();
            //允許編輯的身分
            var editor = AccountType.None;

            switch (nowStatus)
            {
            //編輯中
            case OrderStatus.Editing:
                model = new List <OrderStatus> {
                    OrderStatus.New, OrderStatus.NonPayment, OrderStatus.Delete
                };
                editor = AccountType.Member;
                break;

            //待確認
            case OrderStatus.New:
                model = new List <OrderStatus> {
                    OrderStatus.Processing, OrderStatus.NonPayment, OrderStatus.Combine, OrderStatus.Refuse, OrderStatus.Cancel, OrderStatus.Done
                };
                editor = AccountType.Admin;
                break;

            //待付款
            case OrderStatus.NonPayment:
                if (user == AccountType.Admin)
                {
                    model = new List <OrderStatus> {
                        OrderStatus.OverduePayment, OrderStatus.Processing, OrderStatus.Refuse, OrderStatus.Cancel, OrderStatus.Done
                    };
                    editor = user;
                }
                else if (user == AccountType.Member)     //會員-可退回
                {
                    model = new List <OrderStatus> {
                        OrderStatus.Editing
                    };
                    editor = user;
                }
                break;

            //付款過期
            case OrderStatus.OverduePayment:
                model = new List <OrderStatus> {
                    OrderStatus.NonPayment, OrderStatus.Processing, OrderStatus.Refuse, OrderStatus.Cancel, OrderStatus.Done
                };
                editor = AccountType.Admin;
                break;

            //處理中
            case OrderStatus.Processing:
                model = new List <OrderStatus> {
                    OrderStatus.NonPayment, OrderStatus.Shipment, OrderStatus.Combine, OrderStatus.Refuse, OrderStatus.Cancel, OrderStatus.Done
                };
                editor = AccountType.Admin;
                break;

            //已出貨
            case OrderStatus.Shipment:
                model = new List <OrderStatus> {
                    OrderStatus.Done
                };
                editor = AccountType.Member;
                break;

            //編輯團隊-未完成
            case OrderStatus.TeamEdit:
                if (user == AccountType.Admin)
                {
                    model = new List <OrderStatus> {
                        OrderStatus.Abandon
                    };
                    editor = user;
                }
                else if (user == AccountType.Member)
                {
                    model = new List <OrderStatus> {
                        OrderStatus.TeamEditConfirm, OrderStatus.Abandon
                    };
                    editor = user;
                }
                break;

            //編輯團隊-待確認
            case OrderStatus.TeamEditConfirm:
                model = new List <OrderStatus> {
                    OrderStatus.TeamEditDone
                };
                editor = user;    //皆可
                break;

            //編輯完成
            case OrderStatus.TeamEditDone:
                model = new List <OrderStatus> {
                    OrderStatus.TeamEdit
                };
                editor = AccountType.Member;
                break;

            //退回編輯
            case OrderStatus.Refuse:
                model = new List <OrderStatus> {
                    OrderStatus.Editing
                };
                editor = AccountType.Member;
                break;

            //放棄
            case OrderStatus.Abandon:     //從程式排程作廢
                model = new List <OrderStatus> {
                    OrderStatus.TeamEdit
                };
                editor = AccountType.Admin;
                break;

            //已合併
            case OrderStatus.Combine:
                break;

            //取消
            case OrderStatus.Cancel:
                break;

            //完成
            case OrderStatus.Done:
                if (user == AccountType.Member)     //會員-可作廢
                {
                    model = new List <OrderStatus> {
                        OrderStatus.Invalid
                    };
                    editor = user;
                }
                break;

            //截止未完成
            case OrderStatus.NotDone:
                break;

            //作廢
            case OrderStatus.Invalid:
                break;
            }

            //編輯身分不符合 return null
            if (editor != user)
            {
                return(new List <OrderStatus>());
            }
            //允許next步驟 && 訂單包含流程
            else
            {
                return(model.Where(x => OrderStatuses.Contains(x)).ToList());
            }
        }
        internal HSteamUser CreateLocalUser(ref HSteamPipe phSteamPipe, AccountType eAccountType)
        {
            var returnValue = _CreateLocalUser(Self, ref phSteamPipe, eAccountType);

            return(returnValue);
        }
Exemple #44
0
 public BankAccount()
 {
     accNo   = NextNumber();
     accBal  = 0;
     accType = AccountType.Checking;
 }
 private static extern HSteamUser _CreateLocalUser(IntPtr self, ref HSteamPipe phSteamPipe, AccountType eAccountType);
Exemple #46
0
 public BankAccount(AccountType aType)
 {
     accNo   = NextNumber();
     accBal  = 0;
     accType = aType;
 }
Exemple #47
0
 public AccountTypeDto(AccountType accountType)
 {
     Code        = accountType.Code;
     Name        = accountType.Name;
     Description = accountType.Description;
 }
Exemple #48
0
 public BankAccount(decimal aBal)
 {
     accNo   = NextNumber();
     accBal  = aBal;
     accType = AccountType.Checking;
 }
Exemple #49
0
        public List <Account> getAccounts()
        {
            if (players == null)
            {
                players = new List <Account>();
            }
            else
            {
                players.Clear();
            }
            string          SQL = "Select * from account_data";
            MySqlDataReader rdr;

            try
            {
                MySqlCommand cmd = new MySqlCommand(SQL, getLoginDBConn());
                rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    int         id           = (int)tryGet(rdr, "id", 'i');
                    string      name         = (string)tryGet(rdr, "name", 's');
                    string      password     = (string)tryGet(rdr, "password", 's');
                    byte        activated    = (byte)tryGet(rdr, "activated", 'b');
                    byte        bal          = (byte)tryGet(rdr, "access_level", 'b');
                    AccountType access_level = (AccountType)bal;
                    bal = (byte)tryGet(rdr, "membership", 'b');
                    Membership membership = (Membership)bal;
                    bal = (byte)tryGet(rdr, "old_membership", 'b');
                    Membership old_membership = (Membership)bal;
                    byte       last_server    = (byte)tryGet(rdr, "last_server", 'b');
                    string     last_ip        = (string)tryGet(rdr, "last_ip", 's');
                    string     last_mac       = (string)tryGet(rdr, "last_mac", 's');
                    string     ip_force       = (string)tryGet(rdr, "ip_force", 's');
                    DateTime   expire         = (DateTime)tryGet(rdr, "expire", 'd');
                    int        toll           = (int)tryGet(rdr, "toll", 'i');
                    double     balance        = (double)tryGet(rdr, "balance", 'f');
                    string     email          = (string)tryGet(rdr, "email", 's');
                    string     question       = (string)tryGet(rdr, "question", 's');
                    string     answer         = (string)tryGet(rdr, "answer", 's');

                    Account acct = new Account();
                    acct.id             = id;
                    acct.name           = name;
                    acct.password       = password;
                    acct.activated      = activated;
                    acct.access_level   = access_level;
                    acct.membership     = membership;
                    acct.old_membership = old_membership;
                    acct.last_server    = last_server;
                    acct.last_ip        = last_ip;
                    acct.last_mac       = last_mac;
                    acct.ip_force       = ip_force;
                    acct.expire         = expire;
                    acct.toll           = toll;
                    acct.balance        = balance;
                    acct.email          = email;
                    acct.question       = question;
                    acct.answer         = answer;
                    players.Add(acct);
                }
            }
            catch (MySqlException e)
            {
                clearMySQLErrors();
                //
                Console.Out.WriteLine("MySqlException caught " + e.Message);
            }
            finally
            {
                closeLoginConn();
            }
            return(players);
        }
Exemple #50
0
 public BankAccount(AccountType aType, decimal aBal)
 {
     accNo   = NextNumber();
     accBal  = aBal;
     accType = aType;
 }
Exemple #51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultBrokerageModel"/> class
 /// </summary>
 /// <param name="accountType">The type of account to be modelled, defaults to
 /// <see cref="QuantConnect.AccountType.Margin"/></param>
 public TradierBrokerageModel(AccountType accountType = AccountType.Margin)
     : base(accountType)
 {
 }
 public Transaction(string line, int year, AccountType accountType) : this(new List <string>() { line }, year, accountType)
 {
     this.Type = accountType;
 }
Exemple #53
0
 public bool CheckDataExists(List <ExpenseData> expenses, string category, string subCategory, AccountType type, int incomeMonth)
 {
     return(expenses.Any(expense => expense.CategoryName == category && expense.SubCategory == subCategory && incomeMonth == expense.DateTime.Month));
 }
        public Transaction(IList <string> lines, int year, AccountType accountType)
        {
            const int MIN_LENGTH = 6;// 24;

            this.Type = accountType;

            var line = lines[0];

            this.Source = lines;

            var debug = false;

            Trace.WriteLineIf(debug, "LINE0: " + lines[0]);
            if (lines.Count > 1)
            {
                Trace.WriteLineIf(debug, "LINE1: " + lines[1]);
                if (lines.Count > 2)
                {
                    Trace.WriteLineIf(debug, "LINE2: " + lines[2]);
                }
            }

            if (line.Length > MIN_LENGTH && IsCrap(line) == false)
            {
                if (IsCrap(line))
                {
                    Trace.WriteLine(line);
                }

                Regex r = new Regex(@"^\d{1,2} [A-z]{3}", RegexOptions.IgnoreCase);
                Match m = r.Match(line.Substring(0, 6));

                if (m.Success)
                {
                    var month = m.Value.Split(' ')[1];     // had a gutful of regex now
                    var day   = m.Value.Substring(0, 2);

                    var lineDate = GetDateFromLine(line, year);

                    if (lineDate.HasValue)
                    {
                        Trace.WriteLine(string.Format("NEW TRANS: {0}", lines[0]));

                        this.Date = lineDate.Value;

                        if (StreamLine.IsBracketLine(line))
                        {
                            var line2 = line.Substring(0, line.IndexOf(')'));
                            this.Amount = LineParser.GetAmountFromLine(line2).GetValueOrDefault();
                            this.Biller = line;
                        }
                        else
                        {
                            //this.Biller = line.Substring(7, line.LastIndexOf(' ') - 7);
                            this.Biller = line.Substring(7);

                            var multiLine1 = lines.Count >= 2 && lines[1].StartsWith("##");
                            var multiLine2 = lines.Count >= 2 && lines[1].Count(f => f == ')') == 1;

                            if (multiLine2)
                            {
                                var line2 = lines[1].Substring(0, lines[1].IndexOf(')'));
                                this.Amount = LineParser.GetAmountFromLine(line2).GetValueOrDefault();
                            }
                            else
                            {
                                var amount = LineParser.GetAmountFromLine(line);
                                if (!multiLine1 && amount.HasValue)
                                {
                                    this.Amount = amount.Value;
                                }
                                else
                                {
                                    Trace.WriteLine("       " + lines[0]);
                                    Trace.WriteLine("       " + lines[1]);
                                    Trace.WriteLine("       " + lines[2]);
                                    if (lines[1].StartsWith("##"))
                                    {
                                        var line2 = LineParser.TrimEndAlpha(lines[2]);

                                        if (decimal.TryParse(line2, out decimal x))
                                        {
                                            this.Amount = decimal.Parse(line2);
                                        }
                                        else
                                        {
                                            this.Amount = amount.Value;
                                        }
                                    }
                                }
                            }
                        }

                        this.ParseSuccess = !string.IsNullOrWhiteSpace(this.Biller);

                        Trace.WriteLine(this.ToString());
                        Trace.WriteLine("----------------------------------------------------------------");
                        Trace.WriteLine("");
                    }
                }
            }
        }
Exemple #55
0
 private void atcSendSpaceAccountType_AccountTypeChanged(AccountType accountType)
 {
     Config.SendSpaceAccountType = accountType;
 }
Exemple #56
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InteractiveBrokersBrokerageModel"/> class
 /// </summary>
 /// <param name="accountType">The type of account to be modelled, defaults to
 /// <see cref="AccountType.Margin"/></param>
 public InteractiveBrokersBrokerageModel(AccountType accountType = AccountType.Margin)
     : base(accountType)
 {
 }
Exemple #57
0
 public AccountCreated(Guid id, string title, string description, string notes, string code, AccountType type,
                       CounterpartyType counterpartyType, Security security, string parentAccountId)
 {
     Id               = id;
     AggregateId      = id.ToString();
     Title            = title;
     Description      = description;
     Notes            = notes;
     Code             = code;
     Type             = type;
     CounterpartyType = counterpartyType;
     Security         = security;
     ParentAccountId  = parentAccountId;
 }
Exemple #58
0
        public void BasicAccountWithdrawRuleTest(string accountNumber, string name, decimal balance, AccountType accountType, decimal amount, decimal newBalance, bool expectedResult)
        {
            IWithdraw withdraw = new BasicAccountWithdrawRule();
            Account   account  = new Account();

            account.AccountNumber = accountNumber;
            account.Type          = accountType;
            account.Name          = name;
            account.Balance       = balance;

            AccountWithdrawResponse response = withdraw.Withdraw(account, amount);

            Assert.AreEqual(expectedResult, response.Success);
        }
Exemple #59
0
 public async Task <IMbankResponse <LoginInfo> > Login(string login, string password, AccountType accountType) => await Login(login, password, accountType, default(CancellationToken));
Exemple #60
0
        public async Task <IMbankResponse <LoginInfo> > Login(string login, string password, AccountType accountType, CancellationToken cancellationToken)
        {
            Client.DefaultParameters.Clear();
            var loginRequest = new RestRequest("/Account/JsonLogin", Method.POST);

            loginRequest.AddParameter("UserName", login, ParameterType.QueryString);
            loginRequest.AddParameter("Password", password, ParameterType.QueryString);
            loginRequest.AddParameter("Seed", "", ParameterType.QueryString);
            loginRequest.AddParameter("Lang", "", ParameterType.QueryString);
            var loginResponse = await Client.ExecuteTaskAsync(loginRequest, cancellationToken);

            if (loginResponse.StatusCode != HttpStatusCode.OK)
            {
                return(MbankResponse <LoginInfo> .Failed(loginResponse));
            }

            var loginInfo = JsonConvert.DeserializeObject <LoginInfo>(loginResponse.Content,
                                                                      new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });

            if (!loginInfo.Successful)
            {
                return(new MbankResponse <LoginInfo>(loginResponse, false, loginInfo));
            }

            Client.BaseUrl = new Uri($"{Client.BaseUrl.GetLeftPart(UriPartial.Scheme | UriPartial.Authority)}{loginInfo.RedirectUrl}");

            var tokenRequest  = new RestRequest();
            var tokenResponse = await Client.ExecuteTaskAsync(tokenRequest, cancellationToken);

            if (tokenResponse.StatusCode != HttpStatusCode.OK)
            {
                return(MbankResponse <LoginInfo> .Failed(tokenResponse));
            }

            var htmlDocument = new HtmlDocument();

            htmlDocument.LoadHtml(tokenResponse.Content);
            var tokenNode = htmlDocument.DocumentNode.SelectSingleNode("//meta[@name='__AjaxRequestVerificationToken']");
            var token     = tokenNode.GetAttributeValue("content", null);

            loginInfo.Token = token;

            Client.AddDefaultParameter("X-Request-Verification-Token", token, ParameterType.HttpHeader);
            Client.AddDefaultParameter("X-Tab-Id", loginInfo.TabId, ParameterType.HttpHeader);


            var activateAccountRequest = new RestRequest("/LoginMain/Account/JsonActivateProfile", Method.POST);

            switch (accountType)
            {
            case AccountType.Individual:
                activateAccountRequest.AddParameter("profileCode", "I", ParameterType.QueryString);
                break;

            case AccountType.Business:
                activateAccountRequest.AddParameter("profileCode", "B", ParameterType.QueryString);
                break;

            default:
                throw new NotImplementedException();
            }
            var activateAccountResponse = await Client.ExecuteTaskAsync(activateAccountRequest, cancellationToken);

            if (activateAccountResponse.StatusCode != HttpStatusCode.OK)
            {
                return(MbankResponse <LoginInfo> .Failed(activateAccountResponse));
            }

            return(new MbankResponse <LoginInfo>(tokenResponse, true, loginInfo));
        }