public AddApplicant(ApplicantViewModels applicant, ObservableCollection <PositionViewModels> position, ObservableCollection <AgentViewModels> agent) : this() { this.applicant = applicant; cbPosition.ItemsSource = position; cbAgent.ItemsSource = agent; this.DataContext = applicant; }
public ApplicantViewModels Get(int id) { var applicantEntity = dataBase.Applicants.Get(id); ApplicantViewModels applicantsModel = Mapper.Map <ApplicantViewModels>(applicantEntity); return(applicantsModel); }
public ResumeApplicant(ApplicantViewModels applicant) : this() { //Binding binding = new Binding(); //binding.ElementName = "last"; // элемент-источник //binding.Path = new PropertyPath("NameEmployer"); // свойство элемента-источника //tbName.SetBinding(TextBlock.TextProperty, binding); // установка привязки для элемента-приемника this.applicant = applicant; this.DataContext = applicant; // lastNamePatrApplicant.Text = applicant.LastNameAp + " " + applicant.NameAp + " " + applicant.PatronymicAp; int age = DateTime.Now.Year - applicant.DateBirth.Year; if (DateTime.Now.Month < applicant.DateBirth.Month || (DateTime.Now.Month == applicant.DateBirth.Month && DateTime.Now.Day < applicant.DateBirth.Day)) { age--; } // ageAp.Text = Convert.ToString(age); /*DateTime birth = new DateTime(1920, 10, 15); * int age = DateTime.Now.Year - birth.Year; * if (DateTime.Now.Month < birth.Month || * (DateTime.Now.Month == birth.Month && DateTime.Now.Day < birth.Day)) age--; * Console.WriteLine(age); */ }
public void AddApplicantToDeal(int dealsId, ApplicantViewModels applicant) { //var deal = dataBase.Applicants.Get(dealsId); //// Конфигурирование AutoMapper //Mapper.Initialize(cfg => cfg.CreateMap<ApplicantViewModels, Applicant>()); //// Отображение обьекта ApplicantsViewModels на обьект Applicants //var appl = Mapper.Map<Applicant>(applicant); ///*/----------*/ //dataBase.Save(); throw new NotImplementedException(); }
public FormVacancie(ApplicantViewModels applicant, ObservableCollection <VacancieViewModels> vacancies, EmployerViewModels employer, DealViewModels deal /*, AgentViewModels agent*/) : this() { this.applicant = applicant; tbNameAppl.DataContext = this.applicant; tbapplicantIdInfo.DataContext = this.applicant; tbAgentApp.DataContext = this.applicant; dGridVacancies1.DataContext = vacancies.Where(p => p.PositionId == applicant.PositionId).ToList(); this.deal = deal; //this.agent = agent; this.employer = employer; // fd.DataContext = this.applicant; this.DataContext = deal; }
public void CreateApplicant(ApplicantViewModels applicantModel) { //throw new NotImplementedException(); Applicant aplicantEntityDB = dataBase.Applicants.Get(applicantModel.ApplicantId); Mapper.Reset(); Mapper.Initialize(cfg => cfg.CreateMap <ApplicantViewModels, Applicant>()); var applicantsEntity = Mapper.Map <Applicant>(applicantModel); //добавить запись на прием dataBase.Applicants.Create(applicantsEntity); //Сохранить изменения dataBase.Save(); }
//Info Applicant private void bt_Info_Applicant_Click(object sender, RoutedEventArgs e) { ApplicantViewModels applicantModel = dGridApplicants.SelectedItem as ApplicantViewModels; int Index = dGridApplicants.SelectedIndex; var a = new ResumeApplicant(applicantModel); a.Title = "Резюме"; a.Owner = this; var result = a.ShowDialog(); if (result == true) { a.Close(); } }
//Edit applicat private void bt_Edit_Applicant_Click(object sender, RoutedEventArgs e) { ApplicantViewModels applicantModel = dGridApplicants.SelectedItem as ApplicantViewModels; int Index = dGridApplicants.SelectedIndex; var ap = new EditApplicant(applicantModel, positionsModel, agentsModel); ap.Title = "Изменить запись"; ap.Owner = this; var result = ap.ShowDialog(); if (result == true) { applicantService.UpdateApplicant(applicantModel); ResetCollection("ApplicantViewModel"); ap.Close(); } }
private void btAddApplicant_Click(object sender, RoutedEventArgs e) { ApplicantViewModels applicantModel = new ApplicantViewModels(); AddApplicant aa = new AddApplicant(applicantModel, positionsModel, agentsModel); aa.Title = "Добавление Соискателя"; aa.Owner = this; var result = aa.ShowDialog(); if (result == true) { applicantService.CreateApplicant(applicantModel); ResetCollection("ApplicantViewModel"); ResetCollection("AgentsViewModel"); int Index = applicantsModel.Count - 1; dGridApplicants.SelectedIndex = Index; aa.Close(); } }
public void AddDeal(ApplicantViewModels applicantmodel, DealViewModels dealmodel, VacancieViewModels vacanciemodel) { //throw new NotImplementedException(); Applicant app = dataBase.Applicants.Get(applicantmodel.ApplicantId); Vacancie vac = dataBase.Vacancies.Get(vacanciemodel.VacancieId); dealmodel.Applicant = app; dealmodel.Vacancie = vac; Deal dealEntityDB = dataBase.Deals.Get(dealmodel.DealId); Mapper.Reset(); Mapper.Initialize(cfg => cfg.CreateMap <DealViewModels, Deal>()); var dealEntity = Mapper.Map <Deal>(dealmodel); //добавить deal dataBase.Deals.Create(dealEntity); //Сохранить изменения dataBase.Save(); }
public void UpdateApplicant(ApplicantViewModels applicantModel) { Applicant applicantEntityDB = dataBase.Applicants.Get(applicantModel.ApplicantId); // Appointment appointmentEntity = Mapper.Map<Appointment>(appointmentModel); applicantEntityDB.LastNameAp = applicantModel.LastNameAp; applicantEntityDB.NameAp = applicantModel.NameAp; applicantEntityDB.PatronymicAp = applicantModel.PatronymicAp; applicantEntityDB.DateBirth = applicantModel.DateBirth; applicantEntityDB.Gender = applicantModel.Gender; applicantEntityDB.Education = applicantModel.Education; applicantEntityDB.ForeignLanguage = applicantModel.ForeignLanguage; applicantEntityDB.EstimatedSalary = applicantModel.EstimatedSalary; applicantEntityDB.OtherInformation = applicantModel.OtherInformation; applicantEntityDB.DateFilling = applicantModel.DateFilling; // вторичный ключ обновление ??? applicantEntityDB.PositionId = applicantModel.PositionId; dataBase.Applicants.Update(applicantEntityDB); dataBase.Save(); }
public void AddApplicantToAgent(int agentId, ApplicantViewModels applicant) { throw new NotImplementedException(); }