本文整理汇总了C#中IEmployee类的典型用法代码示例。如果您正苦于以下问题:C# IEmployee类的具体用法?C# IEmployee怎么用?C# IEmployee使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEmployee类属于命名空间,在下文中一共展示了IEmployee类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee == null)
throw new ArgumentNullException(nameof(employee));
database.StaffRepository.Create(new Employee(employee));
database.Save();
}
开发者ID:MisterHoker,项目名称:ASP.NET_TestTask,代码行数:7,代码来源:StaffService.cs
示例2: TeacherViewModel
public TeacherViewModel (IEmployee model, IEduProgramProfile eduProgramProfile, EmployeeDirectoryTeachersViewModel rootViewModel, ViewModelIndexer indexer)
: base (model)
{
RootViewModel = rootViewModel;
EduProgramProfile = eduProgramProfile;
Indexer = indexer;
}
开发者ID:roman-yagodin,项目名称:R7.University,代码行数:7,代码来源:TeacherViewModel.cs
示例3: PhoneWrapItem
public PhoneWrapItem(IPhone phone, IEmployee employee = null)
{
if (phone == null)
throw new ArgumentException("Phone is null!");
this.PhoneItem = phone;
this.EmployeeItem = employee;
}
开发者ID:AliaksandrNovik,项目名称:PhoneBook,代码行数:7,代码来源:PhoneWrapItem.cs
示例4: GetPackageCost
public IBenefitsPackage GetPackageCost(IEmployee employee)
{
return new BenefitsPackage()
{
EmployeeCost = _configuration.AnnualEmployeeBenefitsCost
};
}
开发者ID:barbosatek,项目名称:Paylocity,代码行数:7,代码来源:SingleEmployeeStrategy.cs
示例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);
}
开发者ID:Vsailor,项目名称:ProjectManager,代码行数:8,代码来源:UsersDetails.xaml.cs
示例6: Employee
public Employee(IEmployee employee)
{
Id = employee.Id;
Name = employee.Name;
Position = employee.Position;
Status = employee.Status;
Salary = employee.Salary;
}
开发者ID:MisterHoker,项目名称:ASP.NET_TestTask,代码行数:8,代码来源:Employee.cs
示例7: GetPackageCost
public IBenefitsPackage GetPackageCost(IEmployee employee)
{
return new BenefitsPackage()
{
EmployeeCost = _configuration.AnnualEmployeeBenefitsCost,
DependentCost = GetEmployeeDependentBenefitsCost(employee)
};
}
开发者ID:barbosatek,项目名称:Paylocity,代码行数:8,代码来源:EmployeeWithDependentsStrategy.cs
示例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();
}
开发者ID:EBojilova,项目名称:SoftUni-3,代码行数:58,代码来源:WordReportGenerator.cs
示例9: EmployeeWrapperItem
public EmployeeWrapperItem(IEmployee item, IUserInfo userInfo = null)
{
if (item == null)
{
throw new ArgumentException("Item is null");
}
this.Item = item;
this.UserInfo = userInfo;
}
开发者ID:AliaksandrNovik,项目名称:PhoneBook,代码行数:9,代码来源:EmployeeWrapperItem.cs
示例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);
}
}
开发者ID:ruisebastiao,项目名称:Catel.Examples,代码行数:13,代码来源:EmployeeRepository.cs
示例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);
}
}
开发者ID:ruisebastiao,项目名称:Catel.Examples,代码行数:13,代码来源:EmployeeRepository.cs
示例12: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee.Department != this.Department)
{
throw new InvalidOperationException("Wrong employee");
}
this.employees.Add(employee);
}
开发者ID:rextor92,项目名称:OOP-November2015,代码行数:9,代码来源:Manager.cs
示例13: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee.Depratment != this.Depratment)
{
throw new InvalidOperationException(CompanyConstants.WrongEmployee);
}
this.employees.Add(employee);
}
开发者ID:vdonchev,项目名称:InheritanceAndAbstraction-Homework,代码行数:9,代码来源:Manager.cs
示例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);
}
开发者ID:tah182,项目名称:Comet,代码行数:14,代码来源:EmployeeSvcImplDB.cs
示例15: AddEmployee
public void AddEmployee(IEmployee employee)
{
if (employee.DepartmentName != this.DepartmentName)
{
throw new InvalidOperationException(EmployeeError);
}
this.employees.Add(employee);
}
开发者ID:naskoni,项目名称:SoftUni-OOP-November-2015,代码行数:9,代码来源:Manager.cs
示例16: AddEmployeeDetails
//Employee functionalities.
/// <summary>
/// To add a new employee.
/// </summary>
/// <param name="objEmployee">object of Employee class</param>
/// <returns>returns true or false</returns>
public bool AddEmployeeDetails(IEmployee objEmployee)
{
bool isAdded=false;
SqlConnection objSQLConn = null;
SqlCommand objSQLCommand = null;
try
{
objSQLConn = new SqlConnection(strConnectionString);
objSQLCommand = new SqlCommand("usp_addEmployee", objSQLConn);
objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
objSQLCommand.Parameters.AddWithValue("@EmployeeFirstName", objEmployee.FirstName);
objSQLCommand.Parameters.AddWithValue("@EmployeeLastName", objEmployee.LastName);
objSQLCommand.Parameters.AddWithValue("@RoleId", objEmployee.RoleId);
objSQLCommand.Parameters.AddWithValue("@DateOfBirth", objEmployee.Dob);
objSQLCommand.Parameters.AddWithValue("@DateOfJoining", objEmployee.Doj);
objSQLCommand.Parameters.AddWithValue("@Address", objEmployee.Address);
objSQLCommand.Parameters.AddWithValue("@State", objEmployee.State);
objSQLCommand.Parameters.AddWithValue("@City", objEmployee.City);
objSQLCommand.Parameters.AddWithValue("@ContactNumber", objEmployee.MobileNumber);
objSQLCommand.Parameters.Add("@EmployeeID", System.Data.SqlDbType.Int);
objSQLCommand.Parameters["@EmployeeID"].Direction = System.Data.ParameterDirection.Output;
objSQLConn.Open();
int noOfRowsAffected = objSQLCommand.ExecuteNonQuery();
if (noOfRowsAffected > 0)
objEmployee.EmployeeId = Convert.ToInt32(objSQLCommand.Parameters["@EmployeeID"].Value);
isAdded = true;
objSQLCommand = new SqlCommand("usp_addToLoginDetails", objSQLConn);
objSQLCommand.CommandType = System.Data.CommandType.StoredProcedure;
objSQLCommand.Parameters.AddWithValue("@EmployeeID", objEmployee.EmployeeId);
objSQLCommand.Parameters.AddWithValue("@RoleId", objEmployee.RoleId);
string pwd = string.Empty;
pwd = (objEmployee.Dob.Month).ToString() + (objEmployee.Dob.Day).ToString()+(objEmployee.Dob.Year).ToString();
objSQLCommand.Parameters.AddWithValue("@Password", pwd);
objSQLCommand.ExecuteNonQuery();
}
catch
{
throw;
}
finally
{
if (objSQLConn != null && objSQLConn.State != System.Data.ConnectionState.Closed)
objSQLConn.Close();
}
return isAdded;
}
开发者ID:anaya-upadhyay,项目名称:Inventory-Store-Management-System,代码行数:62,代码来源:AdminDAL.cs
示例17: EmployeeDetailsUserControl
public EmployeeDetailsUserControl(IEmployee employee, ILoadDataSender lastScreen, UserDetailsVM userDetailsVM)
{
InitializeComponent();
_lastScreen = lastScreen;
_userDetailsVM = userDetailsVM;
_currentUser = employee as UserVM;
_employeeDetailsUserControlVM = new EmployeeDetailsUserControlVM(employee, lastScreen);
DataContext = _employeeDetailsUserControlVM;
LoadSkills();
}
开发者ID:Vsailor,项目名称:ProjectManager,代码行数:10,代码来源:EmployeeDetailsUserControl.xaml.cs
示例18: EmployeeViewModel
/// <summary>
/// Initializes a new instance of the <see cref="EmployeeViewModel" /> class.
/// </summary>
/// <param name="employee">The employee.</param>
/// <param name="messageMediator">The message mediator.</param>
/// <param name="departmentRepository">The department repository.</param>
/// <exception cref="ArgumentNullException">The <paramref name="employee" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="messageMediator" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="departmentRepository" /> is <c>null</c>.</exception>
public EmployeeViewModel(IEmployee employee, IMessageMediator messageMediator, IDepartmentRepository departmentRepository)
: base(messageMediator)
{
Argument.IsNotNull(() => employee);
Argument.IsNotNull(() => messageMediator);
Employee = employee;
AvailableDepartments = new FastObservableCollection<IDepartment>(departmentRepository.GetAllDepartments());
}
开发者ID:ruisebastiao,项目名称:Catel.Examples,代码行数:19,代码来源:EmployeeViewModel.cs
示例19: GetSalaryPercentage
private decimal GetSalaryPercentage(IEmployee employee, Company company)
{
decimal salaryPrecentage = 0.15m;
if (employee.Department == null)
{
return salaryPrecentage;
}
salaryPrecentage = GetSalaryPercentage(employee.Department.Manager, company) - 0.01m;
return salaryPrecentage;
}
开发者ID:bulgariamitko,项目名称:SoftUniHomeWordsAndMore,代码行数:10,代码来源:SalaryManager.cs
示例20: CountEmployeesinternal
public int CountEmployeesinternal(IEmployee e)
{
int result = 1;
if (e is Manager)
foreach (IEmployee c in ((Manager)e).ReportsList)
{
result += CountEmployeesinternal(c);
}
return result;
}
开发者ID:huoxudong125,项目名称:Windows-universal-samples,代码行数:10,代码来源:Functions.xaml.cs
注:本文中的IEmployee类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论