コード例 #1
0
        public Account InsertAccount(Account account)
        {
            account.CreateDate = DateTime.Now;
            account.Active = true;
            _dbContext.Accounts.AddObject(account);
            _dbContext.SaveChanges();

            return account;
        }
コード例 #2
0
        private void btnInsert_Click(object sender, RoutedEventArgs e)
        {
            Account newAccount = new Account();
            newAccount.TypeID = Convert.ToInt32(cmbMailType.Tag);
            newAccount.UserName = txtUsername.Text;
            newAccount.Password = txtPassword.Text;
            _musubiRepo.InsertAccount(newAccount);

            bindAccounts();
        }
コード例 #3
0
 partial void DeleteAccount(Account instance);
コード例 #4
0
 partial void UpdateAccount(Account instance);
コード例 #5
0
 partial void InsertAccount(Account instance);
コード例 #6
0
 /// <summary>
 /// Create a new Account object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="typeID">Initial value of the TypeID property.</param>
 /// <param name="userName">Initial value of the UserName property.</param>
 /// <param name="password">Initial value of the Password property.</param>
 /// <param name="active">Initial value of the Active property.</param>
 public static Account CreateAccount(global::System.Int32 id, global::System.Int32 typeID, global::System.String userName, global::System.String password, global::System.Boolean active)
 {
     Account account = new Account();
     account.ID = id;
     account.TypeID = typeID;
     account.UserName = userName;
     account.Password = password;
     account.Active = active;
     return account;
 }
コード例 #7
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Accounts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAccounts(Account account)
 {
     base.AddObject("Accounts", account);
 }
コード例 #8
0
        public AccountActivity UpdateAccountActivity(Account account, int activityCount)
        {
            AccountActivity activity = new AccountActivity();
            activity.Date = DateTime.Now;
            activity.EmailSendCount = activity.EmailSendCount + activityCount;
            account.AccountActivities.Add(activity);
            _dbContext.SaveChanges();

            return activity;
        }
コード例 #9
0
        private int getEmailAvailableCount(Account acc)
        {
            decimal emailsSent = 0;
            decimal emailsCap = 0;

            var activities = acc.AccountActivities.Where(ac => ac.Date > DateTime.Now.AddHours(-24));
            decimal sum = activities.Sum(ac => ac.EmailSendCount);
            emailsSent += sum;
            if (acc.TypeID == 0)
            {
                emailsCap += 500;
            }

            return (int)(emailsCap - emailsSent);
        }
コード例 #10
0
ファイル: DALAccount.cs プロジェクト: rizkioa/ceurape1
 public int UpdateAccount(Account account)
 {
     int result = 0;
     try
     {
         String[] columnNames = {userName, password, role, birthday, sex, identifyCode, fullName, address, phone, email, status };
         Object[] values = {account.UserName, account.Password, account.Role, account.Birthday, account.Sex, account.IdentifyCode, account.FullName, account.Address, account.Phone, account.Email, account.Status };
         String[] keyColumnNames = {accountID};
         Object[] keyColumnValues = {account.AccountID};
         result = DALBase.UpdateTable(tableName, columnNames, values, keyColumnNames, keyColumnValues);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }