private void EditSelectedItem() { int id = 0; AccountView b = null; if (dgList.SelectedItem != null) { object sel = dgList.SelectedItem; b = (AccountView)sel; id = b.id; } if (id > 0) { AccountsEditView v = new AccountsEditView(); v._id = b.id; v.edtName.Text = b.name; v.edtDescr.Text = b.description; v.edtAddress.Text = b.address; v.edtDiscount.Text = b.discount.ToString(); v.edtOKPO.Text = b.okpo.ToString(); //v.edtScore.Text = b.bank_score; v.edtShippingBase.Text = b.shipping_base; v.edtShippingDest.Text = b.shipping_point; //v.edtType.SelectedItem = b.account_type.name; //v.edtBank.SelectedItem = b.bank.name; v.edtUNN.Text = b.unn; v.ShowDialog(); ReloadList(); } }
private void CreateItem() { AccountsEditView v = new AccountsEditView(); v._id = -1; v.ShowDialog(); }