Пример #1
0
        public string Execute(string[] inputArgs)
        {
            string firstName = inputArgs[0];

            string lastName = inputArgs[1];

            decimal salary = decimal.Parse(inputArgs[2]);

            //TODO Validate

            var employee = new Emlpoyee
            {
                FirstName = firstName,
                LastName  = lastName,
                Salary    = salary
            };

            this.context.Employees.Add(employee);
            this.context.SaveChanges();

            var employeeDto = this.mapper.CreateMappedObject <EmployeeDto>(employee);

            string result = $"Registered successfully: {employeeDto.FirstName} {employeeDto.LastName} - {employeeDto.Salary}";

            return(result);
        }
Пример #2
0
 private void Child_Fetch(Emlpoyee employee)
 {
     LoadProperty(EmlpoyeeIDProperty, employee.EmlpoyeeID);
     LoadProperty(EmployeeStatusIDProperty, employee.EmployeeStatusID);
     LoadProperty(FirstNameProperty, employee.FirstName);
     LoadProperty(LastNameProperty, employee.LastName);
     LoadProperty(CompanyIDProperty, employee.CompanyID);
 }
Пример #3
0
 internal static EmlpoyeeEdit GetEmlpoyeeEdit(Emlpoyee employee)
 {
     return(DataPortal.FetchChild <EmlpoyeeEdit>(employee));
 }