Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            DlvProfileAddEditDialog dlv = new DlvProfileAddEditDialog(this);

            if (dlv.ShowDialog() == DialogResult.OK)
            {
                this.dlvprofile = this.LoadDlvProfileFromServer();
                this.bs.ResetBindings(true);
                this.bs.DataSource = this.dlvprofile;
            }
        }
Esempio n. 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (this.gridViewDlvProfile.GetRow(this.gridViewDlvProfile.FocusedRowHandle) == null)
            {
                return;
            }

            DlvProfileVM dlvprofile = this.dlvprofile.Where(d => d.Id == (int)this.gridViewDlvProfile.GetRowCellValue(this.gridViewDlvProfile.FocusedRowHandle, this.colProfileId)).FirstOrDefault();

            if (dlvprofile == null)
            {
                return;
            }

            DlvProfileAddEditDialog dlv = new DlvProfileAddEditDialog(this, dlvprofile);

            if (dlv.ShowDialog() == DialogResult.OK)
            {
                this.dlvprofile = this.LoadDlvProfileFromServer();
                this.bs.ResetBindings(true);
                this.bs.DataSource = this.dlvprofile;
            }
        }