Exercise - Binding Controls result
At item 14 Your ShowEmployeesDataInTabs class should look like :
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Firefly.Box;
using ENV;
using ENV.Data;
namespace Northwind.TestExercies
{
public class ShowEmployeesDataInTabs : UIControllerBase
{
public readonly Models.Employees Employees = new Models.Employees();
public readonly NumberColumn TabValue = new NumberColumn { DefaultValue=1};
public ShowEmployeesDataInTabs()
{
From = Employees;
}
public void Run()
{
Execute();
}
protected override void OnLoad()
{
View = () => new Views.ShowEmployeesDataInTabsView(this);
}
public Text FullName()
{
return Employees.FirstName + " " + Employees.LastName;
}
}
}
The ShowEmployeesDataInTabs runtime should look like :
Personal Tab :
Address Tab :
Contact Tab :
Notes Tab :
Extra Tab:
After item 15 The Notes Tab runtime should look like :
After item 24 ShowEmployeesDataInTabs class should look like :
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using Firefly.Box;
using ENV;
using ENV.Data;
namespace Northwind.TestExercies
{
public class ShowEmployeesDataInTabs : UIControllerBase
{
public readonly Models.Employees Employees = new Models.Employees();
public readonly Models.Employees EmployeesReportsTo = new Models.Employees();
public readonly NumberColumn TabValue = new NumberColumn { DefaultValue=1};
public ShowEmployeesDataInTabs()
{
From = Employees;
}
public void Run()
{
Execute();
}
protected override void OnLoad()
{
View = () => new Views.ShowEmployeesDataInTabsView(this);
}
public Text FullName()
{
return Employees.FirstName + " " + Employees.LastName;
}
}
}
ShowEmployeesDataInTabsView class should look like :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Firefly.Box;
using Firefly.Box.UI.Advanced;
using ENV;
using ENV.Data;
namespace Northwind.TestExercies.Views
{
partial class ShowEmployeesDataInTabsView : Shared.Theme.Controls.Form
{
ShowEmployeesDataInTabs _controller;
public ShowEmployeesDataInTabsView(ShowEmployeesDataInTabs controller)
{
_controller = controller;
InitializeComponent();
cmbReportsTo.ListSource = _controller.EmployeesReportsTo;
cmbReportsTo.ValueColumn = _controller.EmployeesReportsTo.EmployeeID;
cmbReportsTo.DisplayColumn = _controller.EmployeesReportsTo.FirstName;
cmbReportsTo.ListWhere.Add(_controller.EmployeesReportsTo.EmployeeID.IsDifferentFrom(_controller.Employees.EmployeeID));
}
}
}
The ShowEmployeesDataInTabs runtime should look like :
Extra Tab:
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com