本文整理汇总了C#中IEmployee类的典型用法代码示例。如果您正苦于以下问题:C# IEmployee类的具体用法?C# IEmployee怎么用?C# IEmployee使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEmployee类属于命名空间,在下文中一共展示了IEmployee类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee == null)
throw new ArgumentNullException(nameof(employee));
database.StaffRepository.Create(new Employee(employee));
database.Save();
}
示例2: TeacherViewModel
public TeacherViewModel (IEmployee model, IEduProgramProfile eduProgramProfile, EmployeeDirectoryTeachersViewModel rootViewModel, ViewModelIndexer indexer)
: base (model)
{
RootViewModel = rootViewModel;
EduProgramProfile = eduProgramProfile;
Indexer = indexer;
}
示例3: PhoneWrapItem
public PhoneWrapItem(IPhone phone, IEmployee employee = null)
{
if (phone == null)
throw new ArgumentException("Phone is null!");
this.PhoneItem = phone;
this.EmployeeItem = employee;
}
示例4: GetPackageCost
public IBenefitsPackage GetPackageCost(IEmployee employee)
{
return new BenefitsPackage()
{
EmployeeCost = _configuration.AnnualEmployeeBenefitsCost
};
}
示例5: UsersDetails
public UsersDetails(IEmployee employee, ILoadDataSender lastScreen) : this(employee as IUser, lastScreen)
{
InitializeComponent();
Title.Text = "Employee properties";
_employeeDetailsVM = new EmployeeDetailsUserControlVM(employee, lastScreen);
_employeeDetailsUserControl = new EmployeeDetailsUserControl(employee, lastScreen, _userDetailsVM);
EmployeesGrid.Children.Add(_employeeDetailsUserControl);
}
示例6: Employee
public Employee(IEmployee employee)
{
Id = employee.Id;
Name = employee.Name;
Position = employee.Position;
Status = employee.Status;
Salary = employee.Salary;
}
示例7: GetPackageCost
public IBenefitsPackage GetPackageCost(IEmployee employee)
{
return new BenefitsPackage()
{
EmployeeCost = _configuration.AnnualEmployeeBenefitsCost,
DependentCost = GetEmployeeDependentBenefitsCost(employee)
};
}
示例8: GenerateReport
public static void GenerateReport(IEmployee employee)
{
string reportType = employee is IDeveloper ? "Project" : "Sales";
string fileName = String.Format("{0}-{1}-{2}-Report.docx",
employee.FirstName, employee.LastName, employee.ID);
var document = DocX.Create(fileName);
// Heading
var heading = document.InsertParagraph(
String.Format("{0} {1} : {2} Report",
employee.FirstName, employee.LastName, reportType));
heading.Alignment = Alignment.left;
heading.FontSize(20d).Bold();
document.InsertParagraph();
// Personal Info
Dictionary<string, object> dict = new Dictionary<string, object>()
{
{"Name: ", employee.FirstName + " " + employee.LastName},
{"Id: ", employee.ID},
{"Department: ", employee.Department},
{"Salary: ", employee.Salary}
};
foreach (var prop in dict)
{
var text = document.InsertParagraph(prop.Key).Bold();
text.InsertText(" " + prop.Value, true);
text.FontSize(12);
text.Alignment = Alignment.right;
}
document.InsertParagraph();
// Project / Sales Report Details
var detailsList = document.AddList(null, 0, ListItemType.Bulleted);
if (employee is IDeveloper)
{
var projectsHeading = document.InsertParagraph("Projects:")
.UnderlineStyle(UnderlineStyle.singleLine)
.FontSize(15);
foreach (var project in (employee as IDeveloper).Projects)
{
document.AddListItem(detailsList, project.ToString());
}
}
else if (employee is ISalesEmployee)
{
var salesHeading = document.InsertParagraph("Sales:");
foreach (var sale in (employee as ISalesEmployee).Sales)
{
document.AddListItem(detailsList, sale.ToString());
var innerList = document.AddList(null, 2, ListItemType.Numbered);
}
}
document.InsertList(detailsList);
// Save changes to file
document.Save();
}
示例9: EmployeeWrapperItem
public EmployeeWrapperItem(IEmployee item, IUserInfo userInfo = null)
{
if (item == null)
{
throw new ArgumentException("Item is null");
}
this.Item = item;
this.UserInfo = userInfo;
}
示例10: DeleteEmployee
/// <summary>
/// Deletes the employee.
/// </summary>
/// <param name="employee">The employee.</param>
public void DeleteEmployee(IEmployee employee)
{
Argument.IsNotNull("employee", employee);
lock (_employees)
{
_employees.Remove(employee);
}
}
示例11: AddEmployee
/// <summary>
/// Adds the employee.
/// </summary>
/// <param name="employee">The employee.</param>
public void AddEmployee(IEmployee employee)
{
Argument.IsNotNull("employee", employee);
lock (_employees)
{
_employees.Add(employee);
}
}
示例12: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee.Department != this.Department)
{
throw new InvalidOperationException("Wrong employee");
}
this.employees.Add(employee);
}
示例13: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee.Depratment != this.Depratment)
{
throw new InvalidOperationException(CompanyConstants.WrongEmployee);
}
this.employees.Add(employee);
}
示例14: getEmployee
/// <summary>
/// Checks the type of employee to get information on and queries from specific table.
/// </summary>
/// <param name="employee"></param>
/// <returns></returns>
public IEmployee getEmployee(IEmployee employee)
{
if (employee.GetType() == typeof(Director))
return getDirector(employee);
if (employee.GetType() == typeof(GroupManager))
return getManager(employee);
return getUser(employee);
}
示例15: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee.DepartmentName != this.DepartmentName)
{
throw new InvalidOperationException(EmployeeError);
}
this.employees.Add(employee);
}