Ejemplo n.º 1
0
        public override void Refresh()
        {
            this._detail = this._dutymanager.Select();
            this.bindingSource1.DataSource = this._detail;
            if (this.action == "insert")
            {
                Model.Duty duty = new Book.Model.Duty();
                duty.DutyId = Guid.NewGuid().ToString();
                //  department.Id = string.Empty;
                duty.DutyName = string.Empty;
                // department.DepartmentDescription = string.Empty;
                this._detail.Add(duty);
                this.bindingSource1.Position = this.bindingSource1.IndexOf(duty);
                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();
        }
Ejemplo n.º 2
0
 protected override void grid_keyDpwn()
 {
     Model.Duty duty = new Book.Model.Duty();
     duty.DutyId = Guid.NewGuid().ToString();
     //department.Id = string.Empty;
     duty.DutyName = string.Empty;
     // department.DepartmentDescription = string.Empty;
     this._detail.Add(duty);
     this.bindingSource1.Position = this.bindingSource1.IndexOf(duty);
 }