public bool ChangeDomainOfApplicationName(EconomicActivity pEconomicActivity, string newName) { if (newName == String.Empty) { throw new OpenCbsDoaUpdateException(OpenCbsDOAUpdateExceptionEnum.NewNameIsNull); } if (_doam.ThisActivityAlreadyExist(newName, pEconomicActivity.Parent.Id)) { throw new OpenCbsDoaSaveException(OpenCbsDOASaveExceptionEnum.AlreadyExist); } EconomicActivity activity = pEconomicActivity; activity.Name = newName; _doam.UpdateEconomicActivity(activity); return(true); }
public void UpdateEconomicActivity() { _economicActivityManager = (EconomicActivityManager)container["EconomicActivityManager"]; EconomicActivity activity = new EconomicActivity { Name = "Services", Parent = null }; activity.Id = _economicActivityManager.AddEconomicActivity(activity); activity.Name = "NewServices"; activity.Deleted = true; _economicActivityManager.UpdateEconomicActivity(activity); EconomicActivity selectedActivity = _economicActivityManager.SelectEconomicActivity(activity.Id); Assert.AreEqual(activity.Id, selectedActivity.Id); Assert.AreEqual("NewServices", selectedActivity.Name); Assert.AreEqual(true, selectedActivity.Deleted); }