Beispiel #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            IstabAddEditDialog add = new IstabAddEditDialog(this, this.tabtyp);

            if (add.ShowDialog() == DialogResult.OK)
            {
                this.istab = this.LoadIstabFromServer();
                this.bs.ResetBindings(true);
                this.bs.DataSource = this.istab;
            }
        }
Beispiel #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (this.gridViewIstab.GetRow(this.gridViewIstab.FocusedRowHandle) == null)
            {
                return;
            }

            IstabVM istab = this.istab.Where(i => i.Id == (int)this.gridViewIstab.GetRowCellValue(this.gridViewIstab.FocusedRowHandle, this.colId)).FirstOrDefault();

            if (istab == null)
            {
                return;
            }

            IstabAddEditDialog edit = new IstabAddEditDialog(this, this.tabtyp, istab);

            if (edit.ShowDialog() == DialogResult.OK)
            {
                this.istab = this.LoadIstabFromServer();
                this.bs.ResetBindings(true);
                this.bs.DataSource = this.istab;
            }
        }