Example #1
0
        public override void Refresh()
        {
            this._detail = this.accountManager.Select();
            this.bindingSource1.DataSource = this._detail;
            if (this.action == "insert")
            {
                Model.Account account = new Book.Model.Account();
                account.AccountId       = Guid.NewGuid().ToString();
                account.AccountBalance0 = decimal.Zero;
                account.AccountBalance1 = decimal.Zero;
                this._detail.Add(account);
                this.bindingSource1.Position = this.bindingSource1.IndexOf(account);
                this.gridControl1.RefreshDataSource();
            }
            switch (this.action)
            {
            case "insert":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "update":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "view":
                this.gridView1.OptionsBehavior.Editable = false;
                break;

            default:
                break;
            }
            base.Refresh();
        }
Example #2
0
        public void Decrement(Book.Model.Account account, decimal value)
        {
            Hashtable paras = new Hashtable();

            paras.Add("AccountId", account.AccountId);
            paras.Add("Money", value);
            sqlmapper.Update("Account.decrement", paras);
        }
Example #3
0
 protected override void grid_keyDpwn()
 {
     Model.Account account = new Book.Model.Account();
     account.AccountId       = Guid.NewGuid().ToString();
     account.AccountBalance0 = decimal.Zero;
     account.AccountBalance1 = decimal.Zero;
     this._detail.Add(account);
     this.bindingSource1.Position = this.bindingSource1.IndexOf(account);
 }
Example #4
0
 public void Decrement(Book.Model.Account account, decimal?value)
 {
     this.Decrement(account, value.Value);
 }