public IBenefitsPackage GetPackageCost(IEmployee employee) { return new BenefitsPackage() { EmployeeCost = _configuration.AnnualEmployeeBenefitsCost }; }
public TeacherViewModel (IEmployee model, IEduProgramProfile eduProgramProfile, EmployeeDirectoryTeachersViewModel rootViewModel, ViewModelIndexer indexer) : base (model) { RootViewModel = rootViewModel; EduProgramProfile = eduProgramProfile; Indexer = indexer; }
public override void OnStart(object param) { var employeeId = new Guid((param as object[])[0].ToString()); CurrentEmployee = System.GetEmployee(Company.Id, employeeId); if ((param as object[]).Count() > 1) { var tableId = new Guid((param as object[])[1].ToString()); var tableAreaId = new Guid((param as object[])[2].ToString()); if ((param as object[]).Count() > 3) { var currentSaleId = new Guid((param as object[])[3].ToString()); } if ((param as object[]).Count() > 4) { wantToMoveTable = (bool)((param as object[])[4] as bool?); } CurrentTable = System.GetTable(Company.Id, Store.Id, tableAreaId, tableId); } Navigator.ActivateView(Tables); }
public PhoneWrapItem(IPhone phone, IEmployee employee = null) { if (phone == null) throw new ArgumentException("Phone is null!"); this.PhoneItem = phone; this.EmployeeItem = employee; }
public void AddEmployee(IEmployee employee) { if (employee == null) throw new ArgumentNullException(nameof(employee)); database.StaffRepository.Create(new Employee(employee)); database.Save(); }
public IBenefitsPackage GetPackageCost(IEmployee employee) { return new BenefitsPackage() { EmployeeCost = _configuration.AnnualEmployeeBenefitsCost, DependentCost = GetEmployeeDependentBenefitsCost(employee) }; }
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); }
public Employee(IEmployee employee) { Id = employee.Id; Name = employee.Name; Position = employee.Position; Status = employee.Status; Salary = employee.Salary; }
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(); }
public void AddEmployee(IEmployee employee) { if (employee.Depratment != this.Depratment) { throw new InvalidOperationException(CompanyConstants.WrongEmployee); } this.employees.Add(employee); }
public EmployeeWrapperItem(IEmployee item, IUserInfo userInfo = null) { if (item == null) { throw new ArgumentException("Item is null"); } this.Item = item; this.UserInfo = userInfo; }
public void AddEmployee(IEmployee employee) { if (employee.DepartmentName != this.DepartmentName) { throw new InvalidOperationException(EmployeeError); } this.employees.Add(employee); }
/// <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); }
public void AddEmployee(IEmployee employee) { if (employee.Department != this.Department) { throw new InvalidOperationException("Wrong employee"); } this.employees.Add(employee); }
/// <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); } }
/// <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); } }
//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; }
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(); }
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; }
public int CountEmployeesinternal(IEmployee e) { int result = 1; if (e is Manager) foreach (IEmployee c in ((Manager)e).ReportsList) { result += CountEmployeesinternal(c); } return result; }
/// <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()); }
public void AddAdditionalPay(decimal additionalPay, IEmployee employee) { if (additionalPay <= employee.Salary * (decimal)0.49) { employee.AmountDue += additionalPay; } else { throw new InvalidOperationException(ErrorMessages.ExcessiveAdditionalPay); } }
public decimal RetrieveAmount(decimal amount, IEmployee employee) { if (amount <= employee.AmountDue) { employee.AmountDue -= amount; return amount; } else { throw new InvalidOperationException(ErrorMessages.InsufficientAmount); } }
public void Save(IEmployee employee) { if (IsExists(employee.EmployeeID)) { Update(employee); } else { Insert(employee); } }
public PayrollCalculator(IEmployee employee) { if (employee == null) { throw new ArgumentNullException("employee"); } this.employee = employee; this.timeSheetPersistance = new TimeSheetPersistance(); this.salaryPersistance = new SalaryPersistance(); }
public ICompensationSummary CreatePackage(IEmployee employee) { IBenefitsCostStrategy benefitCostStrategy = _benefitsCostStrategyFactory.GetStrategy(employee); IBenefitsPackage benefitsPackage = benefitCostStrategy.GetPackageCost(employee); benefitsPackage = _benefitsPackageDiscountChain.ApplyDiscount(benefitsPackage, employee); var grossSalary = _configuration.PaycheckNetAmmount* Convert.ToDecimal(_configuration.TotalPaycheckPeriodsPerYear); return new CompensationSummary { GrossSalary = _configuration.PaycheckNetAmmount * _configuration.TotalPaycheckPeriodsPerYear, BenefitsPackage = benefitsPackage, NetSalary = grossSalary - benefitsPackage.EmployeeCost - benefitsPackage.DependentCost }; }
public IBenefitsPackage ApplyDiscount(IBenefitsPackage benefitsPackage, IEmployee employee) { var dependentDiscount = employee.Dependents .Where(x => x.Name.StartsWith(_configuration.DiscountNamePrefix, StringComparison.InvariantCultureIgnoreCase)) .Select(x => _configuration.StandardBenefitPackageDiscount) .Sum(); if (dependentDiscount > 0) { benefitsPackage.DependentCost = DiscountUtility.GetDiscount(benefitsPackage.DependentCost, dependentDiscount); } return benefitsPackage; }
public IBenefitsPackage ApplyDiscount(IBenefitsPackage benefitsPackage, IEmployee employee) { benefitsPackage = _dependentBenefitsPackageDiscountChain.ApplyDiscount(benefitsPackage, employee); var employeeDiscount = employee.Name.StartsWith(_configuration.DiscountNamePrefix, StringComparison.InvariantCultureIgnoreCase) ? _configuration.StandardBenefitPackageDiscount : 0; if (employeeDiscount > 0) { benefitsPackage.EmployeeCost = DiscountUtility.GetDiscount(benefitsPackage.EmployeeCost, employeeDiscount); } return benefitsPackage; }
public static bool CreateReservation(IEmployee employee, IMachine machine, DateTime day, DateTime start, DateTime end, string jamType, string description) { bool result; try { ReservationEntity reservationEntity = new ReservationEntity(employee.Id, machine.Id, day, start, end, jamType, description); result = Persistens.CreateReservationEntity(reservationEntity); return result; } catch (Exception) { return false; } }
public HttpResponseMessage Put(IEmployee employee) { try { var updatedEmployee = _repository.UpdateEmployee(employee); var response = Request.CreateResponse(HttpStatusCode.OK, updatedEmployee); string uri = Url.Link("DefaultApi", new { id = employee.EmployeeId }); response.Headers.Location = new Uri(uri); return response; } catch (Exception e) { return Request.CreateResponse(HttpStatusCode.InternalServerError, e.Message); } }
public virtual void Remove(IEmployee employee) { throw new NotSupportedException(); }
public void Fire(IEmployee employee) { employee.Fire(); _department.RemoveEmployee(employee); }
public static void HireEmployee(this IDepartment department, IEmployee employee) { var dm = _dmProvider.GetManager(department); dm.Hire(employee); }
public BankAccount(string name, IEmployee responsibleEmployee, string uniqueNumber, DateTime registrationDate) : base(name, responsibleEmployee, uniqueNumber) { this.Balance = 0; this.RegistrationDate = registrationDate; this.criticalLimit = 300; }
public async Task <ActionResult <Manager> > PostManager(IEmployee employee) { await _employeesRepostiory.PostEmployeeAsync(employee); return(CreatedAtAction("GetManager", new { id = employee.Id }, employee)); }
public EmployeeController(IEmployee employees) { _employees = employees; }
public EmployeeController(IEmployee _objemployee) { objemployee = _objemployee; }
public async Task <object> UpdateEmployee(IEmployee employee) { var employeeCalc = CalculateBenefitCost(employee); return(await _benefitsRepository.UpdateEmployee(employeeCalc)); }
public IT(IEmployee employee) : base(employee) { this.ITEmployee = employee; }
public Job(string name, int workHoursRequired, IEmployee employee) { this.Name = name; this.WorkHoursRequired = workHoursRequired; this.Employee = employee; }
public Job(string name, int workHours, IEmployee employee) { this.name = name; this.workHours = workHours; this.Employee = employee; }
public ActionResult DeleteEmployee(int EmployeeId) { IEmployee model = _employeeRepository.GetById(EmployeeId); return(View(model)); }
/// <summary> /// Получить срок задания на обработку. /// </summary> /// <param name="assignee">Исполнитель задания.</param> /// <returns>Срок задания на обработку документа из сервиса обмена.</returns> public override DateTime GetProcessingTaskDeadline(IEmployee assignee) { return(_obj.Responsible != null && _obj.Status == ExchangeCore.DepartmentBox.Status.Active ? base.GetProcessingTaskDeadline(assignee) : Functions.BoxBase.GetProcessingTaskDeadline(_obj.ParentBox, assignee)); }
public EmployeeController(IEmployee employeeRepository) { EmployeeRepository = employeeRepository; }
/// <summary> /// Статический метод. Преобразует объект типа IEmployee в объект типа Employee /// </summary> public static Employee IEmployeeToEmployeeConverter(IEmployee employee) { return((Employee)employee); }
protected EmployeeViewModelBase(IEmployee employee) { Employee = employee; }
public DependencyInjectionServiceCallInClientWeb(IEmployee employee) { _employee = employee; }
public PEmployee(IEmployee view) => this.vEmployee = view;
/// <summary> /// Initializes a new instance of the <see cref="EmployeeController" /> class. /// </summary> /// <param name="employee"></param> public EmployeeController(IEmployee employee) { _employee = employee; }
public bool RemoveEmployee(IEmployee employee) { _employees.Remove(employee); return(true); }
public void Hire(IEmployee employee) { employee.Hire(); _department.AddEmployee(employee); }
public virtual bool SetManager(IEmployee employee) { Manager = employee; return(true); }
public EmpNode(IEmployee aemp) : base(aemp.getName()) { emp = aemp; }
private bool IsInGrade(IEmployee employee, params EmployeeGrade[] grades) { return(grades.Contains(employee.Grade)); }
public void Add(IEmployee emp) { //not applicable }
/// <summary> /// Adds the employee info. /// Expected input is userId, SearchTitle /// </summary> /// <param name="employee">The employee.</param> /// <param name="employeeInfo">The employee info.</param> public void AddEmployeeInfo(IEmployee employee, (int, string) employeeInfo)
public ActionResult Login(LoginModel model, string returnUrl) { if (ModelState.IsValid) { if (Membership.ValidateUser(model.UserName, model.Password)) { using (DirectoryEntry de = new DirectoryEntry(ConfigurationManager.ConnectionStrings[ConfigurationKey.ActiveDirectoryConnectionString].ToString(), model.UserName, model.Password)) { using (DirectorySearcher adSearch = new DirectorySearcher(de)) { const string _filterFormat = "(sAMAccountName={0})"; adSearch.Filter = string.Format(_filterFormat, model.UserName); SearchResult adSearchResult = adSearch.FindOne(); if (adSearchResult.Properties.Count != 0) { const string _employeeIdkey = "employeeid"; const string _emailkey = "userprincipalname"; model.EmployeeId = adSearchResult.Properties[_employeeIdkey][0].ToString(); model.Email = adSearchResult.Properties[_emailkey][0].ToString(); Session[SessioKey.LoginCredential] = model; if (model.Email == null || string.IsNullOrEmpty(model.Email)) { ModelState.AddModelError(string.Empty, Resources.Pms.Login_InvalidLogin); } else { IList <CodeMessage> messages = new List <CodeMessage>(); this._userManagementRepository.ServiceHeaders = PresentationUtility.GetBasicHeaders(new string[] { ServiceHeaderKey.EmployeeId, ServiceHeaderKey.UserName, ServiceHeaderKey.Email }); IEmployee employee = _userManagementRepository.EmployeeGet(SearchKey.Email, model.Email, out messages); if (employee == null) { Session[SessioKey.LoginCredential] = null; foreach (CodeMessage message in messages) { ModelState.AddModelError(string.Empty, message.Name); } return(View(model)); } else { model.PersonId = employee.PersonId; model.EmployeeId = employee.EmployeeId; model.AccountState = string.IsNullOrEmpty(employee.PersonObject.PersonStatus) ? 1 : Int16.Parse(employee.PersonObject.PersonStatus); Session[SessioKey.LoginCredential] = model; FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); } } } } } if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") && !returnUrl.StartsWith("//") && !returnUrl.StartsWith(@"\//")) { return(Redirect(returnUrl)); } else { return(RedirectToAction(ControllerActionString.Index, ControllerString.Home)); } } else { ModelState.AddModelError(string.Empty, Resources.Pms.Login_InvalidLogin); } } return(View(model)); }
public void AddSubordinate(IEmployee employee) { subordinate.Add(employee); }
public void AssignManager(IEmployee employee) { Manager = employee; }
public EmployeeController(IEmployee emp, IWebHostEnvironment hostingEnvironment) { _employee = emp; this.hostingEnvironment = hostingEnvironment; }