private void AddInsBtn_Click(object sender, RoutedEventArgs e) { InsuranceWindow insuranceWindow = new InsuranceWindow(); insuranceWindow.Client = user.Username; insuranceWindow.Show(); UpdateInsuranceDG(); }
private void UpdateInsurance() { try { int row = InsTypeDG.SelectedIndex; if (row != -1) { var ci = new DataGridCellInfo(InsTypeDG.Items[row], InsTypeDG.Columns[0]); var crow = ci.Column.GetCellContent(ci.Item) as TextBlock; var vrow = crow.Text; InsuranceWindow insuranceWindow = new InsuranceWindow(); insuranceWindow.Ins = Convert.ToInt32(vrow); insuranceWindow.ShowDialog(); UpdateInsuranceDG(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }