-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
40 lines (38 loc) · 1.4 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Unity.Configuration;
using Unity;
using HRlib;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
using (var container = new UnityContainer())
{
var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
section.Configure(container, "containerEmployee");
var SC = container.Resolve<SalaryCalculator>();
//工時 , 時薪, 請假天數
float amount = SC.Calculate(8 * 19, 200, 8);
Console.WriteLine("normal amount:" + amount);
}
using (var container = new UnityContainer())
{
var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
section.Configure(container, "containerHack");
var SC = container.Resolve<SalaryCalculator>();
//工時 , 時薪, 請假天數
float amount = SC.Calculate(8 * 19, 200, 30);
Console.WriteLine("hack amount:" + amount);
}
Console.WriteLine("press any key to end.");
Console.ReadKey();
}
}
}