public SignedOffersForm(Applicant applicant, EmploymentCenter center)
        {
            InitializeComponent();
            OffersSource = new BindingSource
            {
                DataSource = applicant.ConsideredOffers
            };
            OffersDG.AutoGenerateColumns = false;
            OffersDG.DataSource          = OffersSource;

            var column = new DataGridViewTextBoxColumn();

            column.DataPropertyName = "CompanyName";
            column.Name             = "Название компании";
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Name";
            column.Name             = "Название";
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Salary";
            column.Name             = "Зарплата";
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "RequiredQualification";
            column.Name             = "Необходимая квалификация";
            OffersDG.Columns.Add(column);

            OffersDG.Update();
            OffersDG.Refresh();
        }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EmploymentCenter center = new EmploymentCenter();

            try
            {
                using (StreamReader sr = new StreamReader("applicants.json"))
                {
                    center.Applicants = JsonConvert.DeserializeObject <List <Applicant> >(sr.ReadToEnd());
                }
            }
            catch (Exception)
            {
                // ignored
            }
            try
            {
                using (StreamReader sr = new StreamReader("offers.json"))
                {
                    center.AvailableOffers = JsonConvert.DeserializeObject <List <WorkOffer> >(sr.ReadToEnd());
                }
            }
            catch (Exception)
            {
                // ignored
            }

            Application.Run(new MainForm(center));
        }
Example #3
0
 public ApplicantDetailForm(Applicant applicant, EmploymentCenter center, BindingSource applicantSource)
 {
     InitializeComponent();
     Applicant                      = applicant;
     Center                         = center;
     ApplicantSource                = applicantSource;
     FullNameField.Text             = applicant.FullName;
     ExperienceField.Value          = applicant.Experience;
     AddressField.Text              = applicant.Address;
     OnlyQualificationField.Checked = applicant.WantOnlyQualificationWork;
     QualificationCB.DataSource     = Enum.GetValues(typeof(Qualification));
     QualificationCB.SelectedItem   = applicant.Qualification;
 }
Example #4
0
        public AvailableOffersForm(Applicant applicant, EmploymentCenter center)
        {
            InitializeComponent();
            Applicant    = applicant;
            OffersSource = new BindingSource
            {
                DataSource = applicant.GetWorkOffers(center).Where(offer => !applicant.ConsideredOffers.Contains(offer))
            };
            OffersDG.AutoGenerateColumns = false;
            OffersDG.AllowUserToAddRows  = false;
            OffersDG.DataSource          = OffersSource;

            DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();

            checkColumn.Name = "Выбрать";
            OffersDG.Columns.Add(checkColumn);

            // Initialize and add a text box column.
            DataGridViewColumn column = new DataGridViewTextBoxColumn();

            column.DataPropertyName = "Name";
            column.Name             = "Название";
            column.ReadOnly         = true;
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "CompanyName";
            column.Name             = "Название компании";
            column.ReadOnly         = true;
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Salary";
            column.Name             = "Зарплата";
            column.ReadOnly         = true;
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "RequiredQualification";
            column.Name             = "Необходимая квалификация";
            column.ReadOnly         = true;
            OffersDG.Columns.Add(column);

            OffersDG.Update();
            OffersDG.Refresh();
        }
        public MainForm(EmploymentCenter center)
        {
            InitializeComponent();
            Center          = center;
            ApplicantSource = new BindingSource {
                DataSource = center.Applicants
            };
            ApplicantsDG.AutoGenerateColumns = false;
            ApplicantsDG.DataSource          = ApplicantSource;
            OffersSource = new BindingSource {
                DataSource = center.AvailableOffers
            };
            OffersDG.AutoGenerateColumns = false;
            OffersDG.DataSource          = OffersSource;

            var column = new DataGridViewTextBoxColumn();

            column.DataPropertyName = "CompanyName";
            column.Name             = "Название компании";
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Name";
            column.Name             = "Название";
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Salary";
            column.Name             = "Зарплата";
            OffersDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "RequiredQualification";
            column.Name             = "Необходимая квалификация";
            OffersDG.Columns.Add(column);

            OffersDG.Update();
            OffersDG.Refresh();

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "FullName";
            column.Name             = "Фамилия имя";
            ApplicantsDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Experience";
            column.Name             = "Опыт работы";
            ApplicantsDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Address";
            column.Name             = "Адрес";
            ApplicantsDG.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Qualification";
            column.Name             = "Квалификация";
            ApplicantsDG.Columns.Add(column);

            DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();

            checkColumn.DataPropertyName = "WantOnlyQualificationWork";
            checkColumn.Name             = "Только по своей квалификации";
            ApplicantsDG.Columns.Add(checkColumn);

            ApplicantsDG.Update();
            ApplicantsDG.Refresh();

            MessageBox.Show("Тема: 'Центр занятости'\nАвтор: студент группы 18ВП1 Ключников Андрей",
                            "Информация о программе", MessageBoxButtons.OK);
        }
Example #6
0
 /// <summary>
 /// Возвращает список доступных претенденту вакансий
 /// </summary>
 /// <param name="center"></param>
 /// <returns></returns>
 public List <WorkOffer> GetWorkOffers(EmploymentCenter center)
 {
     return(center.AvailableOffers.Where(this.CheckWorkOffer).ToList());
 }