Пример #1
0
        public IBeheerContextEntity GetBusinessObject(string qry, BeheerContextEntity beheerObject)            
        {
            using (var conn = new OracleConnection(_oradb))
            {
                conn.Open();                
                var cmd = new OracleCommand
                {
                    Connection = conn,
                    CommandText = qry,
                    CommandType = CommandType.Text
                };
                cmd.Connection = conn;
                var reader = cmd.ExecuteReader();

                var smartReader = new SmartDataReader(reader);

                BeheerContextEntity businessObject = null;
                while (smartReader.Read())
                {
                    businessObject = new BeheerContextEntity
                    {
                        Id = smartReader.GetInt32("id"),
                        DataKeyValue = smartReader.GetString(beheerObject.DataKeyName, ""),
                        Tablename = beheerObject.Tablename,
                        DataKeyName = beheerObject.DataKeyName
                    };
                }
                return businessObject;
            }
        }
        public void OnViewLoadedSetsBusinessObjectenIntheView()
        {
            //Arrange            
            var controller = new MockTrefwoordController();
            var beheerObject = new BeheerContextEntity { DataKeyValue = "test1" };
            beheerObject.Details.Add(new BeheerContextEntity
                                         {
                                             DataKeyValue = "Test-Detail"
                                         });
            controller.MockBusinessentity.Add(beheerObject);
            controller.AddDetail(beheerObject.Details[0]);

            var presenter = new TrefwoordenPresenter(controller);
            var view = new MockTrefwoordenView();
            presenter.View = view;

            //Act            
            presenter.OnViewLoaded();

            //Assert
            Assert.AreEqual(1, view.BusinessEntities.Count);
            Assert.AreSame(beheerObject, view.BusinessEntities[view.BusinessEntities.Count - 1]);

            Assert.AreEqual(beheerObject.Details, view.Details);
        }
        public void OnViewLoadedSetsCategorieIntheView()
        {
            // Mock the View
            MockRepository mocks = new MockRepository();
            //Arrange
            var service = mocks.DynamicMock<ICategorieService>();

            //Act
            var controller = mocks.DynamicMock<ICategorieController>();

            // Create Presenter With Mock View and Dummy BlogService
            CategorieService serviceActual = new MockCategorieService();
            var controllerActual = new CategorieController(serviceActual,null,null);
            var presenter = new CategorieenPresenter(controllerActual);
            var cat = new BeheerContextEntity { DataKeyValue = "added" };
            IList<BeheerContextEntity> list= new List<BeheerContextEntity>();
            list.Add(cat);
            //controller.AddBusinessEntity(cat);

            // Set Expectations  
            controller.Expect(action=>action.AddBusinessEntity(cat));
            //presenter.Expect(action => action.OnViewLoaded());
            
            
            // Tell Rhino Mocks We're Done Setting Expectations
            mocks.ReplayAll();
            presenter.OnViewLoaded();
            
            mocks.VerifyAll();


        }
        /// <summary>
        /// Alleen als de application-controller een select-proces in behandeling neemt van zijn presenter
        /// deze functie gebruiken.
        /// </summary>
        /// <param name="master"></param>
        public void UpdateDetails(BeheerContextEntity master)
        {
            m_DetailsLastUpdated = master.Details;

            AddMaster(master);
            Master = master;
        }
 /// <summary>
 /// De repository van masters inrichten en herinrichten, als de master al bestaat.
 /// </summary>
 /// <param name="master"></param>
 public void AddMaster(BeheerContextEntity master)
 {
     BeheerContextEntity found;
     m_QueueMasters.TryGetValue(master.Id, out found);
     if (m_QueueMasters != null && found == null)
     {
         m_QueueMasters.Add(new KeyValuePair<int, BeheerContextEntity>(master.Id, master));
     }
 }
Пример #6
0
 public virtual void AddBusinessEntity(BeheerContextEntity entity)
 {
     //Master info meegeven.
     entity.Parent= new ParentKeyEntity
                        {
                            DataKeyValue = m_Master.DataKeyValue,
                            Id = m_Master.Id,
                            DataKeyName = "categorienaam",
                            Tablename = "categorie"
                        };
     TrefwoordService.AddBusinessEntity(entity);
 }
Пример #7
0
 protected void ThemaTableDataSource_Inserted(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     BeheerContextEntity thema = new BeheerContextEntity();
     thema = e.Instance as BeheerContextEntity;
     if (thema != null)
     {
         thema.Tablename = "thema";
         thema.DataKeyName = "themanaam";
         m_Presenter.OnBusinessEntityAdded(thema);
     }
     m_Presenter.OnViewLoaded();
 }
Пример #8
0
 public virtual void AddBusinessEntity(BeheerContextEntity entity)
 {
     //Master info meegeven voor business layer
     entity.Parent= new ParentKeyEntity
                        {
                            DataKeyValue = m_Master.DataKeyValue,
                            Id = m_Master.Id,
                            DataKeyName = "categorienaam",
                            Tablename = "categorie"
                        };
     entity.MasterId = m_Master.Id;
     entity.Master = m_Master.DataKeyValue;//for system-bindings
     TrefwoordService.AddBusinessEntity(entity);
 }
Пример #9
0
        /// <summary>
        /// Deze wordt aangeroepen tijdens de page_load van trefwoord.
        /// </summary>
        /// <returns></returns>
        public virtual IList<BeheerContextEntity> GetEntities()
        {
            if(m_Master==null)
            {
                m_Master = TrefwoordService.GetMaster();
            }

            if (m_Master != null)
            {
                var result = m_Master.Details;
            
                return result;
            }
            return null;
        }
        public void OnViewLoadedSetsBusinessObjectenIntheView()
        {
            //Arrange            
            var controller = new MockCategorieController();
            var beheerObject = new BeheerContextEntity {  DataKeyValue = "test1" };
            controller.MockBusinessentity.Add(beheerObject);
            var presenter = new CategorieenPresenter(controller);
            var view= new MockCategorieenView();
            presenter.View = view;

            //Act            
            presenter.OnViewLoaded();

            //Assert
            Assert.AreEqual(1, view.BusinessEntities.Count);
            Assert.AreSame(beheerObject, view.BusinessEntities[view.BusinessEntities.Count - 1]);
        }
Пример #11
0
        public void InsertThemasTest()
        {
            var target = new OracleAccess();        

            var themaNew = new BeheerContextEntity
            {
                DataKeyValue = "aaaDwight" + DateTime.Now,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };
            int rowsAffected = target.Insert(themaNew);
            var expected = target.GetBusinessObject(themaNew.Tablename, themaNew.DataKeyName, 
                themaNew.DataKeyValue) as BeheerContextEntity;

            Assert.IsTrue(rowsAffected == 1);
            // ReSharper disable PossibleNullReferenceException
            Assert.AreEqual(expected.DataKeyValue, themaNew.DataKeyValue);
            // ReSharper restore PossibleNullReferenceException
            Assert.AreEqual(expected.Tablename, themaNew.Tablename);
            Assert.AreEqual(expected.DataKeyName, themaNew.DataKeyName);

        }
Пример #12
0
        /// <summary>
        /// Dit geldt alleen voor inline insert van Trefwoord.
        /// </summary>
        protected void AccepteerTrefwoord()
        {
            int i;
            if (Int32.TryParse(Request.Form["RowId"], out i))
            {
                var detail = m_ListDetailsEntities[i - 1];// m_Presenter.m_ListDetails[i - 1];// m_ListDetailsEntities[i - 1]
                var updatedMaster = new BeheerContextEntity
                {
                    Id = detail.MasterId,
                    DataKeyValue = detail.Master
                };
                var trefwoord = new BeheerContextEntity
                {
                    Id = -3, //-1 = geen trefwoord, -2 = lege tabel, -3 = nieuw trefwoord.
                    DataKeyValue = Request.Form["InlineInsert"],
                    Master = detail.Master,
                    MasterId = detail.MasterId,
                    Parent = new ParentKeyEntity
                    {
                        Id = detail.MasterId,
                        DataKeyValue = detail.Master
                    }
                };

                updatedMaster.Details.Add(trefwoord);
                m_Presenter.OnBusinessEntityUpdated(updatedMaster);
                m_Presenter.OnViewLoaded();
            }
            else
            {                
                //TODO: this.ErrorMessages["TxtBox1"] = "Input data is not an integer";
            }
        }
Пример #13
0
 public override void AddDetail(BeheerContextEntity detail)
 {
     MockBusinessentity[0].Details.Add(detail);
 }
Пример #14
0
        public int Insert(ParentKeyEntity masterForeignKey, BeheerContextEntity newBusinessObject)
        {
            int rowsAffected = 0;
            using (OracleConnection conn = new OracleConnection(_oradb))
            {
                conn.Open();
                var trans = conn.BeginTransaction();
                try
                {
                    string sqlUpdate =
                    @"INSERT INTO {0}
                        ({1}, {3})
                        VALUES
                        ('{2}','{4}')
                    ";
                    sqlUpdate = string.Format(sqlUpdate, 
                        newBusinessObject.Tablename,
                        newBusinessObject.DataKeyName, 
                        newBusinessObject.DataKeyValue,
                        masterForeignKey.DataKeyName,
                        masterForeignKey.DataKeyValue);
                    var cmd = new OracleCommand
                    {
                        Connection = conn,
                        CommandText = sqlUpdate,
                        CommandType = CommandType.Text
                    };
                    cmd.Connection = conn;

                    rowsAffected = cmd.ExecuteNonQuery();
                    trans.Commit();
                }
                catch (Exception)
                {
                    trans.Rollback();
                    throw;
                }
            }
            return rowsAffected;
        }
Пример #15
0
        /// <summary>
        /// Na Delete wordt het aantal verwijderde rijen teruggegeven.
        /// </summary>
        /// <param name="businessObject"></param>
        /// <returns></returns>
        public int Delete(BeheerContextEntity businessObject)
        {
            int rowsaffected = 0;
            using (OracleConnection conn = new OracleConnection(_oradb))
            {
                conn.Open();
                var trans = conn.BeginTransaction();

                try
                {
                    string sqlUpdate =
                @"
                        DELETE FROM {0}
                        WHERE {1} = '{2}'
                    ";
                    sqlUpdate = string.Format(sqlUpdate, businessObject.Tablename,
                        businessObject.DataKeyName, businessObject.DataKeyValue);
                    var cmd = new OracleCommand
                    {
                        Connection = conn,
                        CommandText = sqlUpdate,
                        CommandType = CommandType.Text
                    };
                    cmd.Connection = conn;

                    rowsaffected = cmd.ExecuteNonQuery();
                    trans.Commit();
                }
                catch (Exception)
                {
                    trans.Rollback();
                    throw;
                }

            }
            return rowsaffected;
        }
Пример #16
0
        // TODO: Forward events to the presenter and show state to the user.
        // For examples of this, see the View-Presenter (with Application Controller) QuickStart:
        //		ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.practices.wcsf.2007oct/wcsf/html/08da6294-8a4e-46b2-8bbe-ec94c06f1c30.html

        protected void TrefwoordTableDataSource_Inserted(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            BeheerContextEntity trefwoord = new BeheerContextEntity();
            trefwoord = e.Instance as BeheerContextEntity;
            if (trefwoord != null)
            {
                trefwoord.Tablename = "trefwoord";
                trefwoord.DataKeyName = "trefwoord";
                m_Presenter.OnBusinessEntityAdded(trefwoord);
            }
            AllowCrud = true;
        }
Пример #17
0
        protected void BtnSaveFooter_Click(object sender, ImageClickEventArgs e)
        {
            var footer = TrefwoordView.FooterRow;
            var categorie = footer.FindControl("tbCategorieFooter") as TextBox;
            BeheerContextEntity master = new BeheerContextEntity
                                             {
                                                 DataKeyValue = categorie.Text
                                             };           

            var trefwoord = footer.FindControl("tbTrefwoordInsertFooter") as TextBox;
            BeheerContextEntity detail = null;
            if (trefwoord != null && !string.IsNullOrEmpty(trefwoord.Text))
            {
                detail = new BeheerContextEntity
                                                 {
                                                     Id = -1,
                                                     DataKeyValue = trefwoord.Text,
                                                     Master = master.DataKeyValue
                                                 };
                master.Details.Add(detail);
                
            }
            var found = m_ListBeheerEntities.Where(cat => cat.DataKeyValue.Equals(master.DataKeyValue)).FirstOrDefault();

            if(found==null)
            {
                m_Presenter.OnBusinessEntityAdded(master);

                if (detail != null && trefwoord != null && !string.IsNullOrEmpty(trefwoord.Text))
                {
                    m_Presenter.OnDetailEntityUpdated(detail);
                }
                m_Presenter.OnViewLoaded();
            }
            else
            {
                m_Presenter.DuplicateMaster = new StateValue<BeheerContextEntity>(master);
                m_Presenter.OnViewShowErrorMessage("<b>" + master.DataKeyValue + " bestaat al. Dubbele categorieen zijn niet toegestaan.</b>");
                m_Presenter.OnViewShowfooter(true);
                m_Presenter.OnViewLoaded();//ondataboundchecks
            }

        }
Пример #18
0
        public void UpdateThemasTest()
        {
            var target = new OracleAccess();            

            string nu = DateTime.Now.ToString();
            var themaOld = new BeheerContextEntity
            {
                DataKeyValue = "aaP" + nu,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };
            target.Insert(themaOld);

            var themaNew= new BeheerContextEntity
                                              {
                                                  DataKeyValue = "aapje" + nu,
                                                  Tablename = "thema",
                                                  DataKeyName = "themanaam"
                                              }; 
            int rowsAffected  = target.Update(themaOld,themaNew);
            Assert.AreEqual(1,rowsAffected );

            var expected = target.GetBusinessObject(themaNew.Tablename, themaNew.DataKeyName,
                themaNew.DataKeyValue) as BeheerContextEntity;
            // ReSharper disable PossibleNullReferenceException
            Assert.AreEqual(expected.DataKeyValue, themaNew.DataKeyValue);
            // ReSharper restore PossibleNullReferenceException
            Assert.AreEqual(expected.Tablename, themaNew.Tablename);
            Assert.AreEqual(expected.DataKeyName, themaNew.DataKeyName);
        }
Пример #19
0
        public void Datasettest()
        {
            var target = new OracleAccess();

            var themaNew = new BeheerContextEntity
                               {
                                   DataKeyValue = "aaaDwight" + DateTime.Now,
                                   Tablename = "thema",
                                   DataKeyName = "themanaam"
                               };
            string qry = @"select id, {0} from {1} where {0} = '{2}'";
            qry = string.Format(CultureInfo.InvariantCulture, qry, themaNew.DataKeyName, themaNew.Tablename, 
                themaNew.DataKeyValue);

            int rowsAffected = target.Insert(themaNew);
            var ds = target.GetDaBusinessObject(qry,themaNew);

        }
Пример #20
0
        protected void TrefwoordenTableDatasource_Updated(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            BeheerContextEntity trefwoord = new BeheerContextEntity();
            trefwoord = e.Instance as BeheerContextEntity;

            if (!m_IsInsertingInline)
            {
                if (trefwoord != null)
                {
                    trefwoord.DataKeyValue = trefwoord.DataKeyValue.Trim();
                    trefwoord.Tablename = "trefwoord";
                    trefwoord.DataKeyName = "trefwoord";
                    //var detail = m_ListDetailsEntities.Where(det => det.Id == trefwoord.Id).FirstOrDefault();
               
                    var master = m_ListBeheerEntities.Where(mas => mas.Id == trefwoord.MasterId).FirstOrDefault();

                    var updatedMaster = new BeheerContextEntity
                                            {
                                                Id = master.Id,
                                                DataKeyValue = trefwoord.Master//update de master.
                                            };
                    trefwoord.Parent= new ParentKeyEntity
                                          {
                                              Id = master.Id,
                                              DataKeyValue = master.DataKeyValue
                                          };
                    if (trefwoord.Id == -1 && !trefwoord.DataKeyValue.Equals(string.Empty))
                    {
                        //-1 = geen trefwoord, -2 = lege tabel, -3 = nieuw trefwoord.
                        trefwoord.Id = -3;
                        updatedMaster.Details.Add(trefwoord);
                        m_Presenter.OnBusinessEntityUpdated(updatedMaster);                    
                    }
                    else
                        m_Presenter.OnDetailEntityUpdated(trefwoord);
                }
            }
            else
            {
                #region  inline insert trefwoord gebruikt een selectedrow

                int selectedIndex = TrefwoordView.SelectedIndex;
                GridViewRow row = TrefwoordView.Rows[selectedIndex];

                var tbCategorie = row.FindControl("tbCategorie") as TextBox;                
                var tbTrefwoordInline = TrefwoordView.Rows[selectedIndex].FindControl("TrefwoordTextBoxInline") as TextBox;
                
                var master = m_ListBeheerEntities.Where(mas => mas.DataKeyValue == tbCategorie.Text).FirstOrDefault();
                var updatedMaster = new BeheerContextEntity
                {
                    Id = master.Id,
                    DataKeyValue = master.DataKeyValue
                };
                trefwoord = new BeheerContextEntity
                                {                                   
                                    Id = -3, //-1 = geen trefwoord, -2 = lege tabel, -3 = nieuw trefwoord.
                                    DataKeyValue = tbTrefwoordInline.Text,
                                    Master = master.DataKeyValue,
                                    MasterId = master.Id,
                                    Parent = new ParentKeyEntity
                                    {
                                        Id = master.Id,
                                        DataKeyValue = master.DataKeyValue
                                    }
                                };

                updatedMaster.Details.Add(trefwoord);
                m_Presenter.OnBusinessEntityUpdated(updatedMaster);   
                #endregion


                TrefwoordView.SelectedIndex = -1;
            }
            m_Presenter.OnViewLoaded();
            
        }
 public static BeheerContextEntity FindBusinessEntity(IList<BeheerContextEntity> entities,
                                                 BeheerContextEntity entity)
 {
     // <pex>
     if (Equals(entity, default(BeheerContextEntity)))
         throw new ArgumentNullException("entity");
     // </pex>
     IEnumerable<BeheerContextEntity> result;
     if (entities != null)
     {
         result = entities.Where(businessObject => businessObject.Id.Equals(entity.Id));
         return result.FirstOrDefault();             
     }
     return null;
 }
        public void UpdateDetailBusinessEntity(BeheerContextEntity updatedDetail)
        {
            // <pex>
            if (updatedDetail == null)
                throw new ArgumentNullException("updatedDetail");
            // </pex>
            var master = m_BusinessEntities.Where(mas => mas.DataKeyValue == updatedDetail.Master).FirstOrDefault();
            var details = master.Details;

            var found = FindBusinessEntity(details, updatedDetail);
            if (found != null)
            {
                details.Where(detail => detail.Id == found.Id).
                                Update( detail =>
                                        {
                                            detail.DataKeyValue = updatedDetail.DataKeyValue;
                                            
                                        });
            }
        }
        public void DeleteDetailBusinessEntity(BeheerContextEntity detail)
        {
            var master = m_BusinessEntities.Where(mas => mas.DataKeyValue == detail.Master).FirstOrDefault();
            var details = master.Details;

            var found = FindBusinessEntity(details, detail);
            if (found != null)
            {
                details.Remove(found);
            }
        }
        public void AddDetailBusinessEntity(BeheerContextEntity detail)
        {
            var master = m_BusinessEntities.Where(mas => mas.Id == detail.Parent.Id).FirstOrDefault();
            var details = master.Details;

            var found = FindBusinessEntity(details, detail);
            if (found == null)
            {
                detail.Id = m_Id;
                details.Add(detail);
                m_Id++;
            }
        }
Пример #25
0
        public void DeleteThemasTest()
        {
            var target = new OracleAccess();

            var thema = new BeheerContextEntity
            {
                DataKeyValue = "aaaDwight" + DateTime.Now,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };

            Assert.IsTrue(target.Insert(thema) > 0);

            int rowsAffected = target.Delete(thema);

            Assert.IsTrue(rowsAffected == 1);
            var expected = target.GetBusinessObject(thema.Tablename, thema.DataKeyName,
                thema.DataKeyValue) as BeheerContextEntity;
            Assert.AreEqual(expected, null);

        }
Пример #26
0
        public DataSet GetDaBusinessObject(string qry, BeheerContextEntity beheerObject)
        {
            using (var conn = new OracleConnection(_oradb))
            {
                DataSet myDs = new DataSet();
                conn.Open();
                var cmd = new OracleCommand
                {
                    Connection = conn,
                    CommandText = qry,
                    CommandType = CommandType.Text
                };
                cmd.Connection = conn;
                OracleDataAdapter dataAdapter = new OracleDataAdapter(cmd);
                dataAdapter.Fill(myDs);

                return myDs;
            }
        }
Пример #27
0
        public void Datasettest2()
        {
            var target = new MyAccess<OracleConnection, OracleCommand, OracleDataAdapter>();

            var themaNew = new BeheerContextEntity
            {
                DataKeyValue = "aaaDwight" + DateTime.Now,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };
            string qry = @"select id, {0} from {1} where {0} = '{2}'";
            qry = string.Format(CultureInfo.InvariantCulture, qry, themaNew.DataKeyName, themaNew.Tablename,
                themaNew.DataKeyValue);

            target.Insert(themaNew);
            var ds = target.GetDaBusinessObject(qry, themaNew);
            Assert.AreEqual(themaNew.DataKeyValue, ds.Tables[0].Rows[0].ItemArray[1].ToString());
        }
Пример #28
0
        public IList<BeheerContextEntity> GetBusinessObjects(string tableName, string kolomName)
        {
            var theTables = new List<BeheerContextEntity>();            
            using (OracleConnection conn = new OracleConnection(_oradb))
            {
                conn.Open();
                var cmd = new OracleCommand
                              {
                                  Connection = conn,
                                  CommandText = "select "+ kolomName + " from " + tableName + 
                                  " order by " + kolomName,
                                  CommandType = CommandType.Text
                              };
                cmd.Connection = conn;
                var reader = cmd.ExecuteReader();

                SmartDataReader smartReader = new SmartDataReader(reader);
                int i = 0;
                while (smartReader.Read())
                {

                    BeheerContextEntity aTable = new BeheerContextEntity
                    {
                        Id = i++,
                        DataKeyValue = smartReader.GetString(kolomName, ""),
                        Tablename = tableName,
                        DataKeyName = kolomName
                    };
                    theTables.Add(aTable);
                }

                return theTables;
            }
        }
Пример #29
0
        /// <summary>
        /// Na Update wordt het aantal bijgewerkte rijen teruggegeven.
        /// </summary>
        /// <param name="oldBusinessObject"></param>
        /// <param name="newBusinessObject"></param>
        /// <returns></returns>
        public int Update(BeheerContextEntity oldBusinessObject, BeheerContextEntity newBusinessObject)
        {
            int rowsAffected = 0;
            using (OracleConnection conn = new OracleConnection(_oradb))
            {
                string sqlUpdate = "update {0} set {1} ='{2}' where {1} = '{3}'";
                string tableName = oldBusinessObject.Tablename;
                string columnName = oldBusinessObject.DataKeyName;
                sqlUpdate = string.Format(sqlUpdate,
                    tableName,
                    columnName,
                    newBusinessObject.DataKeyValue,
                    oldBusinessObject.DataKeyValue);
                conn.Open();

                var trans = conn.BeginTransaction();
                try
                {
                    var cmd = new OracleCommand
                            {
                                Connection = conn,
                                CommandText = sqlUpdate,
                                CommandType = CommandType.Text
                            };
                    cmd.Connection = conn;

                    rowsAffected = cmd.ExecuteNonQuery();
                    trans.Commit();
                }
                catch (Exception)
                {
                    trans.Rollback();
                    throw;
                }
            }
            return rowsAffected;
        }
Пример #30
0
        protected void TrefwoordenTableDatasource_Deleted(object sender, ObjectContainerDataSourceStatusEventArgs e)
        {
            BeheerContextEntity trefwoord = new BeheerContextEntity();
            trefwoord = e.Instance as BeheerContextEntity;

            if (trefwoord != null)
            {
                if (m_DeleteAlleenTrefwoord)
                {
                    trefwoord.Tablename = "trefwoord";
                    trefwoord.DataKeyName = "trefwoord";
                    m_Presenter.OnDetailEntityDeleted(trefwoord);
                }
                else
                {
                    //Verwijder de master/categorie.
                    var detail = trefwoord;
                    BeheerContextEntity categorie;

                    //Haal gegevens op van de master.
                    string naam = detail.Master;
                    var master = m_ListBeheerEntities.Where(cat => cat.DataKeyValue == naam).FirstOrDefault();

                    categorie = new BeheerContextEntity
                                    {
                                        DataKeyValue = naam,
                                        Id = master.Id
                                    };
                    m_Presenter.OnBusinessEntityDeleted(categorie);
                }
            }
            m_Presenter.OnViewLoaded();
        }