/// <summary>
 /// Добавить текущему работнику дополнительный предпочтительный тип занятости
 /// На основе этих данных будут подбираться предложения
 /// </summary>
 /// <param name="type">Предпочтительный тип занятости</param>
 public void AddPriorEmploymentType(EmploymentType type)
 {
     try
     {
         //Проверка существующей записи
         String query = "SELECT * FROM " + DataBase.GetShema() + ".ETOF "
                        + "WHERE TYPEID = " + (int)type + " "
                        + "AND EMPLOYEEPASSPORT = '" + this.PassportNumber + "'";
         if (ExecuteSelect(query).Count > 0)
         {
             return;                                 //Запись уже существует
         }
         //Добавление записи о предпочтительном типе занятости
         query = "INSERT INTO " + DataBase.GetShema() + ".ETOF (TYPEID, EMPLOYEEPASSPORT) VALUES ( "
                 + (int)type + ", "
                 + "'" + this.PassportNumber + "')";
         ExecuteNonSelectQuery(query);
         Console.WriteLine("Предпочтительный тип занятости добавлен для работника");
     }
     catch (Exception e)
     {
         Console.WriteLine("Не удается добавить приоритетное направление специальности. Возможно уже существует в базе данных.");
         throw e;
     }
 }
Exemplo n.º 2
0
        public List <EmploymentType> GetEmploymentType()
        {
            List <EmploymentType> employmentTypeList = new List <EmploymentType>();

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand command = new SqlCommand(connectionString);
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "GetEmploymentType";
                command.Connection  = connection;

                connection.Open();

                SqlDataReader reader = command.ExecuteReader();

                // Call Read before accessing data.
                while (reader.Read())
                {
                    EmploymentType employmentType = new EmploymentType();
                    employmentType.Id = reader["ETPK"] != null?Convert.ToInt32(reader["ETPK"]) : 0;

                    employmentType.Type = Convert.ToString(reader["ET"]);
                    employmentTypeList.Add(employmentType);
                }

                // Call Close when done reading.
                reader.Close();
            }

            return(employmentTypeList);
        }
 internal EmploymentDetails(Guid employeeId, RoleType roleType, EmploymentType employmentType, DateTime commencementDate)
 {
     Key              = $"{roleType.ToString()}_{employmentType.ToString()}_{commencementDate.ToString("yyyyMMdd")}_{employeeId}";
     RoleType         = roleType;
     EmploymentType   = employmentType;
     CommencementDate = commencementDate;
 }
 /// <summary>
 /// Удалить приоритетное направление специальности
 /// </summary>
 /// <param name="type">Тип занятости который больше не хочет искать работник</param>
 public void DeletePriorEmploymentType(EmploymentType type)
 {
     try
     {
         //Проверка существующей записи
         String query = "SELECT * FROM " + DataBase.GetShema() + ".ETOF "
                        + "WHERE TYPEID = " + (int)type + " "
                        + "AND EMPLOYEEPASSPORT = '" + this.PassportNumber + "'";
         if (ExecuteSelect(query).Count == 0)
         {
             Console.WriteLine("Предпочитаемый тип занятости удален из списка работника");
             return; //Удалять нечего
         }
         query = "DELETE FROM " + DataBase.GetShema() + ".ETOF WHERE "
                 + "TYPEID = " + (int)type + " "
                 + "AND EMPLOYEEPASSPORT = '" + this.PassportNumber + "'";
         ExecuteNonSelectQuery(query);
         Console.WriteLine("Предпочитаемый тип занятости удален из списка работника");
     }
     catch (Exception e)
     {
         Console.WriteLine("Во время удаления приоритетного направления специальности возникли ошибки");
         throw e;
     }
 }
        public async Task <IActionResult> PutEmploymentType(int id, EmploymentType employmentType)
        {
            if (id != employmentType.Id)
            {
                return(BadRequest());
            }

            _context.Entry(employmentType).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EmploymentTypeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 public EmploymentTypeDetailUI()
 {
     InitializeComponent();
     lId              = "";
     lOperation       = GlobalVariables.Operation.Add;
     loEmploymentType = new EmploymentType();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StaffHr"/> class.
 /// </summary>
 /// <param name="employmentType">Type of the employment.</param>
 /// <param name="titleName">Name of the title.</param>
 /// <param name="supervisorStaff">The supervisor staff.</param>
 /// <param name="confidentialNote">The confidential note.</param>
 protected internal StaffHr(EmploymentType employmentType, string titleName, Staff supervisorStaff, string confidentialNote)
 {
     EmploymentType   = employmentType;
     TitleName        = titleName;
     SupervisorStaff  = supervisorStaff;
     ConfidentialNote = confidentialNote;
 }
Exemplo n.º 8
0
 public Employee(string id, string firstName, string lastName, EmploymentType employmentType)
 {
     Id                  = id;
     FirstName           = firstName;
     LastName            = lastName;
     this.employmentType = employmentType;
 }
Exemplo n.º 9
0
        private void gridViewEmployees_UserAddingRow(object sender, GridViewRowCancelEventArgs e)
        {
            if (e.Rows[0].Cells["colName"].Value != null && e.Rows[0].Cells["colHireDate"].Value != null && e.Rows[0].Cells["colAccType"].Value != null)
            {
                if (e.Rows[0].Cells["colBirthDate"].Value == null)
                {
                    e.Rows[0].Cells["colBirthDate"].Value = "01.01.2000";
                }
                if (e.Rows[0].Cells["colMobile"].Value == null)
                {
                    e.Rows[0].Cells["colMobile"].Value = "(000)000-00-00";
                }

                string         name     = e.Rows[0].Cells["colName"].Value.ToString();
                DateTime       date     = (DateTime)e.Rows[0].Cells["colHireDate"].Value;
                EmploymentType type     = (EmploymentType)Enum.Parse(typeof(EmploymentType), e.Rows[0].Cells["colAccType"].Value.ToString());
                DateTime       birthday = (DateTime)e.Rows[0].Cells["colBirthDate"].Value;
                string         mobile   = e.Rows[0].Cells["colMobile"].Value.ToString();
                int            id       = employeeManager.AddEmployee(name, date, type, false, birthday, mobile);
                e.Rows[0].Cells["colID"].Value = id;
                UpdateVacationDays(id, e.Rows[0]);
                UpdateStatusStrip();
            }
            else
            {
                MessageBox.Show("Заполните все данные о сотруднике!");
                e.Cancel = true;
            }
        }
Exemplo n.º 10
0
 public User()
 {
     TwoStepAuthentication = TwoStepAuthentication.None;
     EmploymentType        = EmploymentType.NotSet;
     PhoneNumbers          = new List <PhoneNumber>();
     Emails = new List <EmailAddress>();
 }
Exemplo n.º 11
0
        private void tsmEmploymentType_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (TabPage _tab in this.tbcNSites_V.TabPages)
                {
                    if (_tab.Text == "EmploymentType List")
                    {
                        tbcNSites_V.SelectedTab = _tab;
                        return;
                    }
                }

                EmploymentType _EmploymentType = new EmploymentType();
                Type           _Type           = typeof(EmploymentType);
                ListFormHRISUI _ListForm       = new ListFormHRISUI((object)_EmploymentType, _Type);
                TabPage        _ListFormTab    = new TabPage();
                _ListFormTab.ImageIndex = 24;
                _ListForm.ParentList    = this;
                displayControlOnTab(_ListForm, _ListFormTab);
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "tsmEmploymentType_Click");
                em.ShowDialog();
                return;
            }
        }
Exemplo n.º 12
0
        public async Task <ActionResult <EmploymentType> > PostEmploymentType(EmploymentType employmentType)
        {
            _context.EmploymentTypes.Add(employmentType);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEmploymentType", new { id = employmentType.Id }, employmentType));
        }
Exemplo n.º 13
0
        private void UpdateGrids()
        {
            gridViewFired.Rows.Clear();
            gridViewEmployees.Rows.Clear();
            Dictionary <int, Employee> employees = employeeManager.GetAllEmployees();

            foreach (int empID in employees.Keys)
            {
                Employee       emp      = employees[empID];
                string         name     = emp.Name;
                DateTime       date     = emp.HireDate;
                EmploymentType type     = emp.AccountType;
                int            vacation = emp.calculator.VacationDaysLeft;
                DateTime       birth    = emp.BirthDate;
                string         mobile   = emp.MobilePhone;
                object[]       row      = { empID, name, date, type, vacation, birth, mobile };
                if (!emp.IsFired)
                {
                    gridViewEmployees.Rows.Add(row);
                }
                else
                {
                    gridViewFired.Rows.Add(row);
                }
            }
        }
Exemplo n.º 14
0
        public int AddEmployee(string _name, DateTime _hireDate, EmploymentType _accType, bool _fired, DateTime _birthday, string _mobile)
        {
            int      id       = GetNewID();
            Employee employee = new Employee(_name, _hireDate, _accType, _fired, _birthday, _mobile, ref holidayManager);

            Employees.Add(id, employee);
            return(id);
        }
Exemplo n.º 15
0
        public void TestSetup()
        {
            employmentType_testObject = new EmploymentType();
            busEmployment             = new BEmployment();


            personTA.Insert("0000", null, null, "", null, "", null, null, null, ADOEmploymentType1.ID, null, "", "", null, "", null);
        }
 public EmploymentTypeDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lId              = "";
     lOperation       = GlobalVariables.Operation.Edit;
     loEmploymentType = new EmploymentType();
     lRecords         = pRecords;
 }
Exemplo n.º 17
0
        public void Hire(Person person, EmploymentType employmentType)
        {
            var employee = new Employee {
                Person = person, EmploymentType = employmentType, StartDate = DateTime.UtcNow
            };
            var employmentContract = EmploymentContract.CreateNew(employee, this, employmentType);

            Emit(new EmploymentStarted(this, employee, default));
        }
Exemplo n.º 18
0
 public static IHaveToken<Employee> DepartmentHasEmployeeOfType(this ITokenRegister register,
     IHaveToken<Department> department,
     EmploymentType employmentType)
 {
     var employee = register.For(department)
                            .Exists(dep => dep.Employees);
     register.For(employee)
             .IsTrue(emp => emp.EmploymentType == employmentType);
     return employee;
 }
 public EmployeeDetailUI()
 {
     InitializeComponent();
     lId              = "";
     lOperation       = GlobalVariables.Operation.Add;
     loEmployee       = new Employee();
     loEmploymentType = new EmploymentType();
     loDesignation    = new Designation();
     loDepartment     = new Department();
 }
Exemplo n.º 20
0
 public DailyTimeRecordUI()
 {
     InitializeComponent();
     loEmployee           = new Employee();
     loEmploymentType     = new EmploymentType();
     loDailyTimeRecord    = new DailyTimeRecord();
     loDepartment         = new Department();
     ldtDailyTimeRecord   = new DataTable();
     loDailyTimeRecordRpt = new DailyTimeRecordRpt();
     loReportViewer       = new ReportViewerUI();
 }
 /// <summary>
 /// Создает вакансию, но не добавляет запись в базу данных. Необходимо вызвать метод SetEmployer()
 /// для записи данных в базу.
 /// </summary>
 /// <param name="name">Имя вакансии - уникально для каждого работодателя</param>
 /// <param name="specialty">Специальность для вакансии</param>
 /// <param name="type">Тип занятости для вакансии</param>
 /// <param name="description">Описание вакансии, может быть null</param>
 /// <param name="salary">Заработная плата</param>
 /// <param name="requiredExperience">Требуемый уровень для вакансии</param>
 public Vacancy(String name, Specialty specialty, EmploymentType type,
                String description, uint salary, uint requiredExperience)
 {
     this.Name                  = name;
     this.CurrentSpecialty      = specialty;
     this.CurrentEmploymentType = type;
     this.Description           = description;
     this.Salary                = salary;
     this.RequiredExperience    = requiredExperience;
     this.EmployerItn           = null;
 }
 /// <summary>
 /// Создает вакансию, но не добавляет запись в базу данных. Необходимо вызвать метод SetEmployer()
 /// для записи данных в базу.
 /// </summary>
 /// <param name="name">Имя вакансии - уникально для каждого работодателя</param>
 /// <param name="specialtyName">Специальность для вакансии.
 /// Должно существовать в базе данных</param>
 /// <param name="type">Тип занятости для вакансии</param>
 /// <param name="description">Описание вакансии, может быть null</param>
 /// <param name="salary">Заработная плата</param>
 /// <param name="requiredExperience">Требуемый уровень для вакансии</param>
 public Vacancy(String name, String specialtyName, EmploymentType type,
                String description, uint salary, uint requiredExperience)
 {
     this.Name                  = name;
     this.CurrentSpecialty      = Specialty.GetByName(specialtyName); //Установка специальности с проверкой в базе
     this.CurrentEmploymentType = type;
     this.Description           = description;
     this.Salary                = salary;
     this.RequiredExperience    = requiredExperience;
     this.EmployerItn           = null;
 }
Exemplo n.º 23
0
 public Employee(string _name, DateTime _hireDate, EmploymentType _type, bool _fired, DateTime _birth, string _mobile)
 {
     name         = _name;
     hireDate     = _hireDate;
     accountType  = _type;
     fired        = _fired;
     birthDate    = _birth;
     mobilePhone  = _mobile;
     vacationList = new List <Vacation>();
     calculator   = new DaysCalculator(this);
 }
Exemplo n.º 24
0
        public static IHaveToken <Employee> DepartmentHasEmployeeOfType(this ITokenRegister register,
                                                                        IHaveToken <Department> department,
                                                                        EmploymentType employmentType)
        {
            var employee = register.For(department)
                           .Exists(dep => dep.Employees);

            register.For(employee)
            .IsTrue(emp => emp.EmploymentType == employmentType);
            return(employee);
        }
Exemplo n.º 25
0
 public PersonalDetail(int employeeID, string firstName, string lastName, string zipCode, string city, EmploymentType employmentType, AuditDetails auditDetails, ProfessionalDetails professionalDetails)
 {
     this.employeeID          = employeeID;
     this.firstName           = firstName;
     this.lastName            = lastName;
     this.zipCode             = zipCode;
     this.city                = city;
     this.employmentType      = employmentType;
     this.auditDetails        = auditDetails;
     this.professionalDetails = professionalDetails;
 }
 /// <summary>
 /// Создает вакансию и добавляет информацию о ней в базу данных
 /// </summary>
 /// <param name="name">Имя вакансии - уникально для каждого работодателя</param>
 /// <param name="employerItn">ИНН работодателя, для которого создается вакансия.
 /// Работодатель должен существовать в базе данных</param>
 /// <param name="specialtyName">Имя специальности для вакансии. Должно существовать в базе данных</param>
 /// <param name="type">Тип занятости для вакансии</param>
 /// <param name="description">Описание вакансии, может быть null</param>
 /// <param name="salary">Заработная плата</param>
 /// <param name="requiredExperience">Требуемый уровень для вакансии</param>
 public Vacancy(String name, String employerItn, String specialtyName, EmploymentType type,
                String description, uint salary, uint requiredExperience)
 {
     this.Name                  = name;
     this.EmployerItn           = employerItn;                        //Проверка введенного имени работодателя
     this.CurrentSpecialty      = Specialty.GetByName(specialtyName); //Установка специальности с проверкой в базе
     this.CurrentEmploymentType = type;
     this.Description           = description;
     this.Salary                = salary;
     this.RequiredExperience    = requiredExperience;
     AddEntityToDB();
 }
Exemplo n.º 27
0
 public void WhenINeedDepartmentToEitherBeTypeOrHaveEmployeeOrHaveProjectWithBudjetOrMore(string departmentName, 
     DepartmentType departmentType, 
     EmploymentType employeeType,
     int amount)
 {
     IHaveToken<Employee> employee = null;
     var department = context.GetToken<Department>(departmentName);
     context.Either(x => x.DepartmentHasType(department, departmentType),
                x => employee = x.DepartmentHasEmployeeOfType(department, employeeType),
                x => x.DepartmentHasProjectWithBudget(department, amount));
     context.Storage.Set(employee);
 }
Exemplo n.º 28
0
 public static EmploymentType Save(EmploymentType obj, EntityState state)
 {
     if (state == EntityState.Added)
     {
         obj.EmploymentTypeID = _container.Resolve <IEmploymentTypeRepository>().Insert(obj);
     }
     else
     {
         _container.Resolve <IEmploymentTypeRepository>().Update(obj, obj.EmploymentTypeID);
     }
     return(obj);
 }
 /// <summary>
 /// Создает вакансию и добавляет информацию о ней в базу данных
 /// </summary>
 /// <param name="name">Имя вакансии - уникально для каждого работодателя</param>
 /// <param name="employer">Работодатель, для которого создается вакансия.</param>
 /// <param name="specialty">Специальность для вакансии</param>
 /// <param name="type">Тип занятости для вакансии</param>
 /// <param name="description">Описание вакансии, может быть null</param>
 /// <param name="salary">Заработная плата</param>
 /// <param name="requiredExperience">Требуемый уровень для вакансии</param>
 public Vacancy(String name, Employer employer, Specialty specialty, EmploymentType type,
                String description, uint salary, uint requiredExperience)
 {
     this.Name                  = name;
     this.EmployerItn           = employer.GetItn();
     this.CurrentSpecialty      = specialty;                     //Установка специальности с проверкой в базе
     this.CurrentEmploymentType = type;
     this.Description           = description;
     this.Salary                = salary;
     this.RequiredExperience    = requiredExperience;
     AddEntityToDB();
 }
        // POST: odata/EmploymentTypes
        public IHttpActionResult Post(EmploymentType employmentType)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EmploymentTypes.Add(employmentType);
            db.SaveChanges();

            return(Created(employmentType));
        }
Exemplo n.º 31
0
        private void BindEmploymentType()
        {
            DropDownListEmploymentType.DataSource     = EmploymentType.GetEmploymentTypeList();
            DropDownListEmploymentType.DataTextField  = "Description";
            DropDownListEmploymentType.DataValueField = "EmploymentTypeId";
            DropDownListEmploymentType.DataBind();

            if (DropDownListEmploymentType.Items.Count > 1)
            {
                DropDownListEmploymentType.Items.Insert(0, new ListItem("Please select", "0"));
            }
        }
Exemplo n.º 32
0
        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override int GetHashCode()
        {
            unchecked
            {
                int result = EmploymentType != null?EmploymentType.GetHashCode() : 0;

                result = (result * 397) ^ (TitleName != null ? TitleName.GetHashCode() : 0);
                result = (result * 397) ^ (SupervisorStaff != null ? SupervisorStaff.GetHashCode() : 0);
                result = (result * 397) ^ (ConfidentialNote != null ? ConfidentialNote.GetHashCode() : 0);
                return(result);
            }
        }
Exemplo n.º 33
0
 public void WhenINeedDepartmentToNOTHaveAllThreeTypeEmployeeProjectBudjetOrMore(string departmentName,
     DepartmentType departmentType,
     EmploymentType employeeType,
     int amount)
 {
     IHaveToken<Employee> employee = null;
     var department = context.GetToken<Department>(departmentName);
     context.Not(x =>
     {
         x.DepartmentHasType(department, departmentType);
         employee = x.DepartmentHasEmployeeOfType(department, employeeType);
         x.DepartmentHasProjectWithBudget(department, amount);
     });
     context.Storage.Set(employee);
 }
Exemplo n.º 34
0
 /// <summary>
 /// Assigns the type of the employment.
 /// </summary>
 /// <param name="employmentType">Type of the employment.</param>
 /// <returns>A StaffHrBuilder.</returns>
 public StaffHrBuilder WithEmploymentType(EmploymentType employmentType)
 {
     _employmentType = employmentType;
     return this;
 }