protected override void OnDeleteToolBarItem() { if (MessageBoxService.AskForDelete(_activeFobType.Title) == true) { using (var dbContext = new FarnahadManufacturingDbContext()) { var fobType = dbContext.FobTypes.Find(_activeFobType.Id); dbContext.FobTypes.Remove(fobType); dbContext.SaveChanges(); } LoadSearchGridControl(); _activeFobType = new FobType(); IsNotEditingAndAdding(); } }
protected override void OnAddToolBarItem() { _activeFobType = new FobType(); FillData(_activeFobType); IsAdding(); }
private void FillData(FobType fobType) { NameTextEdit.Text = fobType.Title; DescriptionTextEdit.Text = fobType.Description; }
private void ReadData(FobType fobType) { fobType.Title = NameTextEdit.Text; fobType.Description = DescriptionTextEdit.Text; }
private void EditData(FobType fobType) { _activeFobType = fobType; FillData(_activeFobType); IsEditing(); }