示例#1
0
        public override void Refresh()
        {
            this._detail = this.materialTypeManager.Select();
            this.bindingSource1.DataSource = this._detail;
            if (this.action == "insert")
            {
                Model.MaterialType Material = new Book.Model.MaterialType();
                Material.MaterialTypeID          = Guid.NewGuid().ToString();
                Material.MaterialTypeName        = string.Empty;
                Material.MaterialTypeDescription = string.Empty;
                Material.EndMaterialTypeLogo     = false;
                this._detail.Add(Material);
                this.bindingSource1.Position = this.bindingSource1.IndexOf(Material);
                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();
        }
示例#2
0
 protected override void grid_keyDpwn()
 {
     Model.MaterialType Material = new Book.Model.MaterialType();
     Material.MaterialTypeID          = Guid.NewGuid().ToString();
     Material.MaterialTypeName        = string.Empty;
     Material.MaterialTypeDescription = string.Empty;
     Material.EndMaterialTypeLogo     = false;
     this._detail.Add(Material);
     this.bindingSource1.Position = this.bindingSource1.IndexOf(Material);
 }