M
Mr. Arnold
public interface IDefaultView
{
DataTable BrokenRules { set; }
DataTable TableContext { get; set; }
List<Department> ObjectContext { get; set; }
event EventHandler<EventArgs> GetDepartments;
event EventHandler<EventArgs> Save;
}
The class that's using the Interface.
public class DefaultEditorPresenter
{
private readonly IDefaultView mView;
private readonly IDepartmentService mService;
public DefaultEditorPresenter(IDefaultView view, IDepartmentService service)
{
mView = view;
mService = service;
Initialize();
}
private void Initialize()
{
mView.GetDepartments += new EventHandler<EventArgs>(mView_GetDepartments);
mView.Save += new EventHandler<EventArgs>(mView_Save);
}
The method that is having the trouble.
private void mView_GetDepartments(object sender, EventArgs e)
{
try
{
var depts = mService.GetDepartments();
mView.ObjectContext = depts;
}
catch (Exception ex)
{
throw ex;
}
}
I have tried what I know to get mView.ObjectContext to be populated. The
problem is that I cannot set mView.ObjectContext = depts, as
mView.ObjectContext is *null* after the set is done.
I was able to do this when the Presenter referenced the BLL directly to
execute List<Department> GetDepartments and the definition was Object
ObjectContext { get; set; }, and I had no problem doing this.
But now that this ServiceController has been introduced, I can't set
mView.ObjectContext, period.
Is there a way to get it set? I am pissed-off about this to get all of this
in place and hit this snag.
What I really want is that the UI have no reference to the BLL, which I
could achieve when it was Object. Now am forced to make reference to
List<Department> at the UI.
{
DataTable BrokenRules { set; }
DataTable TableContext { get; set; }
List<Department> ObjectContext { get; set; }
event EventHandler<EventArgs> GetDepartments;
event EventHandler<EventArgs> Save;
}
The class that's using the Interface.
public class DefaultEditorPresenter
{
private readonly IDefaultView mView;
private readonly IDepartmentService mService;
public DefaultEditorPresenter(IDefaultView view, IDepartmentService service)
{
mView = view;
mService = service;
Initialize();
}
private void Initialize()
{
mView.GetDepartments += new EventHandler<EventArgs>(mView_GetDepartments);
mView.Save += new EventHandler<EventArgs>(mView_Save);
}
The method that is having the trouble.
private void mView_GetDepartments(object sender, EventArgs e)
{
try
{
var depts = mService.GetDepartments();
mView.ObjectContext = depts;
}
catch (Exception ex)
{
throw ex;
}
}
I have tried what I know to get mView.ObjectContext to be populated. The
problem is that I cannot set mView.ObjectContext = depts, as
mView.ObjectContext is *null* after the set is done.
I was able to do this when the Presenter referenced the BLL directly to
execute List<Department> GetDepartments and the definition was Object
ObjectContext { get; set; }, and I had no problem doing this.
But now that this ServiceController has been introduced, I can't set
mView.ObjectContext, period.
Is there a way to get it set? I am pissed-off about this to get all of this
in place and hit this snag.
What I really want is that the UI have no reference to the BLL, which I
could achieve when it was Object. Now am forced to make reference to
List<Department> at the UI.