示例#1
0
        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;
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
 public void ShowObject(object keyValue)
 {
     _equipmentInsurance = keyValue as EquipmentInsurance;
     InsuranceBindingSource.DataSource = _equipmentInsurance;
     LoadLookUps();
 }
示例#4
0
 internal void InsuranceAdded(EquipmentInsurance ins)
 {
     _equipment.Insurance.Add(ins);
     BtnSave.Enabled = true;
 }
示例#5
0
 private void gridControl1_Click(object sender, EventArgs e)
 {
     _selectedInsurance         = (EquipmentInsurance)InsuranceListBindingSource.Current;
     btnDeleteInsurance.Enabled = true;
 }