public void SaveChanges() { if (!ValidateForm()) { return; } InsuranceBindingSource.EndEdit(); //if(_newMode) // _context.EquipmentInsurances.AddObject(_equipmentInsurance); //_context.SaveChanges(); //EquipmentDetail.ReloadInsurances(); if (SaveAndNew) { _equipmentInsurance = new EquipmentInsurance(); InsuranceBindingSource.DataSource = _equipmentInsurance; LoadLookUps(); this.DialogResult = DialogResult.OK; } else { this.DialogResult = DialogResult.OK; } }
private void newToolStripButton_Click(object sender, EventArgs e) { var iv = new InsuranceView(); var data = new EquipmentInsurance(); iv.ShowObject(data); var result = iv.ShowDialog(); if (result == DialogResult.OK) { _equipment.Insurance.Add(iv.CurrentObject); } }
public void ShowObject(object keyValue) { _equipmentInsurance = keyValue as EquipmentInsurance; InsuranceBindingSource.DataSource = _equipmentInsurance; LoadLookUps(); }
internal void InsuranceAdded(EquipmentInsurance ins) { _equipment.Insurance.Add(ins); BtnSave.Enabled = true; }
private void gridControl1_Click(object sender, EventArgs e) { _selectedInsurance = (EquipmentInsurance)InsuranceListBindingSource.Current; btnDeleteInsurance.Enabled = true; }