private void FillTable() { CreateColumnsTable(); PolicyList policyList = PolicyList.getInstance(); DataTable dt = policyList.ToDataTable(_account); foreach (DataRow row in dt.Rows) { int idPolicy; int.TryParse(row.ItemArray[0].ToString(), out idPolicy); Policy policy = policyList.getItem(idPolicy); if (_account.IsPolicyKaskoAndPayment2()) { dgvPolicy.Rows.Add(row.ItemArray[0], row.ItemArray[7], row.ItemArray[3], row.ItemArray[12]); } else { dgvPolicy.Rows.Add(row.ItemArray[0], row.ItemArray[7], row.ItemArray[3], row.ItemArray[8]); } } FormatDGV(); tbSum.Text = _account.Sum.ToString(); ChangeEnableComboBoxes(); }
private void FillTable() { CreateColumnsTable(); PolicyList policyList = PolicyList.getInstance(); DataTable dt = policyList.ToDataTable(_policyType, _idOwner, _paymentNumber); foreach (DataRow row in dt.Rows) { int idPolicy; int.TryParse(row.ItemArray[0].ToString(), out idPolicy); Policy policy = policyList.getItem(idPolicy); if (_account.IsPolicyKaskoAndPayment2()) { dgvPolicy.Rows.Add(policy.IsInList(_account), idPolicy, row.ItemArray[7], row.ItemArray[3], row.ItemArray[12]); } else { dgvPolicy.Rows.Add(policy.IsInList(_account), idPolicy, row.ItemArray[7], row.ItemArray[3], row.ItemArray[8]); } } }
public bool CanAgree() { PolicyList policyList = PolicyList.getInstance(); DataTable dt = policyList.ToDataTable(this); return((_agreed == 0) && (dt.Rows.Count > 0)); }
private void GotoPagePolicy(Account account) { savedPosition = new Point(_dgvCar.SelectedCells[0].RowIndex, _dgvCar.SelectedCells[0].ColumnIndex); mainStatus.Set(Status.Policy); PolicyList policyList = PolicyList.getInstance(); DataTable dt = policyList.ToDataTable(account); btnBack.Visible = true; loadCars(dt); }
private int GetIDCar() { PolicyList policyList = PolicyList.getInstance(); DataTable dt = policyList.ToDataTable(this); int idCar = 1; if (dt.Rows.Count > 0) { int.TryParse(dt.Rows[0].ItemArray[1].ToString(), out idCar); } return(idCar); }
private void FillTable() { CreateColumnsTable(); PolicyList policyList = PolicyList.getInstance(); DataTable dt = policyList.ToDataTable(_account); foreach (DataRow row in dt.Rows) { dgvPolicy.Rows.Add(row.ItemArray[0], row.ItemArray[7], row.ItemArray[3], _account.IsPolicyKaskoAndPayment2() ? row.ItemArray[12] : row.ItemArray[8]); } FormatDgv(); tbSum.Text = _account.Sum.ToString(); ChangeEnableComboBoxes(); }
private void loadPolicy() { _dgvPolicy.DataSource = _policyList.ToDataTable(_car); formatDGVPolicy(); }