Exemple #1
0
        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();
            }
        }
Exemple #2
0
 protected override void OnAddToolBarItem()
 {
     _activeFobType = new FobType();
     FillData(_activeFobType);
     IsAdding();
 }
Exemple #3
0
 private void FillData(FobType fobType)
 {
     NameTextEdit.Text        = fobType.Title;
     DescriptionTextEdit.Text = fobType.Description;
 }
Exemple #4
0
 private void ReadData(FobType fobType)
 {
     fobType.Title       = NameTextEdit.Text;
     fobType.Description = DescriptionTextEdit.Text;
 }
Exemple #5
0
 private void EditData(FobType fobType)
 {
     _activeFobType = fobType;
     FillData(_activeFobType);
     IsEditing();
 }