Example #1
0
        private void FilterFileds()
        {
            ServiceReference1.FiledsOfScience curFos = (ServiceReference1.FiledsOfScience)cmbFOS.SelectedItem;
            ltmpProjects = new List <ServiceReference1.Projects>();
            foreach (ServiceReference1.Projects pP in lProjects)
            {
                int Pid = pP.id_project;
                if (lProjectFos.Where(p => p.id_project == Pid).FirstOrDefault().id_fos == curFos.id_fos) // если направление науки проекта совпадает с выбранным направлением
                {
                    ltmpProjects.Add(pP);
                }
            }
            dgProjectList.ItemsSource = null;
            dgProjectList.ItemsSource = ltmpProjects;

            ltmpExperts = new List <ServiceReference1.Experts>();
            foreach (ServiceReference1.Experts pE in lExperts)
            {
                int Eid = pE.id_expert;
                foreach (ServiceReference1.ExpertFos pEFOS in lExpertFos)
                {
                    if (pEFOS.id_expert == Eid)
                    {
                        if (pEFOS.id_fos == curFos.id_fos)
                        {
                            ltmpExperts.Add(pE);                                // если направление науки эксперта совпадает с выбранным направлением
                        }
                    }
                }
            }
            dgExpertList.ItemsSource = null;
            dgExpertList.ItemsSource = ltmpExperts;
        }
Example #2
0
        private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ServiceReference1.FiledsOfScience temp = comboBox.SelectedItem as ServiceReference1.FiledsOfScience;

            Boolean triger = true;

            if (comboBox.SelectedIndex != -1)
            {
                for (int i = 0; i < listFOSCurrentExpert.Count; i++)
                {
                    if (listFOSCurrentExpert[i].id_fos == temp.id_fos)
                    {
                        MessageBox.Show("Вы уже выбрали данный раздел");
                        triger = false;
                    }
                }

                if (triger == true)
                {
                    j = j + 1;
                    textBlock.Text += j + " " + temp.name_fos + "\r\n";
                    listFOSCurrentExpert.Add(temp);
                }
            }
        }
Example #3
0
        //=======================================================================================
        private void Client_GetTabelsForEditExpertiseByIDCompleted(object sender, ServiceReference1.GetTabelsForEditExpertiseByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (!e.Result.Err)
                {
                    lFOS        = e.Result.lFOS.ToList();
                    lProjects   = e.Result.lProjects.ToList();
                    lProjectFos = e.Result.lProjectFos.ToList();
                    lCatigories = e.Result.lCatigories.ToList();
                    lCatCrit    = e.Result.lCatCrit.ToList();
                    lCriterions = e.Result.lCriterions.ToList();
                    lCritValues = e.Result.lCritValues.ToList();
                    lExperts    = e.Result.lExperts.ToList();
                    lExpertFos  = e.Result.lExpertFos.ToList();

                    ExpertiseName = e.Result.Expertise.name_expertise;
                    ExpertiseFOS  = lFOS.Where(p => p.id_fos == e.Result.Expertise.id_fos).FirstOrDefault();

                    lExpertiseProjects = new List <ServiceReference1.Projects>();
                    foreach (ServiceReference1.ProjectExpertise pPE in e.Result.lProjectExpertise)
                    {
                        ServiceReference1.Projects tmpP = e.Result.lProjects.Where(o => o.id_project == pPE.id_project).FirstOrDefault();
                        lExpertiseProjects.Add(tmpP);
                    }

                    lExpertiseCrit = new List <ServiceReference1.Criterions>();
                    foreach (ServiceReference1.ExpCrit pEC in e.Result.lExpCrit)
                    {
                        ServiceReference1.Criterions tmpC = e.Result.lCriterions.Where(z => z.id_crit == pEC.id_crit).FirstOrDefault();
                        lExpertiseCrit.Add(tmpC);
                    }

                    Count_proj_expertise = e.Result.Expertise.count_proj_expertise;

                    lExpertiseExperts = new List <ServiceReference1.Experts>();
                    foreach (ServiceReference1.ExpertiseExpert pE in e.Result.lExpertiseExpert)
                    {
                        ServiceReference1.Experts tmpE = e.Result.lExperts.Where(x => x.id_expert == pE.id_expert).FirstOrDefault();
                        lExpertiseExperts.Add(tmpE);
                    }

                    ltmpProjects = lProjects;
                    ltmpExperts  = lExperts;
                    FirstFillFileds();

                    Waiting(false);
                }
                else
                {
                    Waiting(false);
                }
            }
            else
            {
                Waiting(false);
            }
        }
Example #4
0
        private void UpdateExpertise()
        {
            if (CheckVars())
            {
                ExpertiseName        = tbxExpertiseName.Text;
                ExpertiseFOS         = cmbFOS.SelectedItem as ServiceReference1.FiledsOfScience;
                Count_proj_expertise = int.Parse(tbxCountExpertiseProjects.Text);

                List <ServiceReference1.ProjectExpertise> lprojects = new List <ServiceReference1.ProjectExpertise>();
                foreach (ServiceReference1.Projects pP in lExpertiseProjects)
                {
                    ServiceReference1.ProjectExpertise tP = new ServiceReference1.ProjectExpertise();
                    tP.id_project = pP.id_project;
                    lprojects.Add(tP);
                }

                List <ServiceReference1.ExpCrit> lcrits = new List <ServiceReference1.ExpCrit>();
                foreach (ServiceReference1.Criterions pC in lExpertiseCrit)
                {
                    ServiceReference1.ExpCrit tC = new ServiceReference1.ExpCrit();
                    tC.id_crit = pC.id_crit;
                    lcrits.Add(tC);
                }

                List <ServiceReference1.ExpertiseExpert> lexperts = new List <ServiceReference1.ExpertiseExpert>();
                foreach (ServiceReference1.Experts pE in lExpertiseExperts)
                {
                    ServiceReference1.ExpertiseExpert tE = new ServiceReference1.ExpertiseExpert();
                    tE.id_expert = pE.id_expert;
                    lexperts.Add(tE);
                }

                if (Count_proj_expertise >= lprojects.Count())
                {
                    MessageBox.Show("Количество поддерживаемых проектов не должно ровняться количеству участвуюцих проектов и привышать его!");
                }
                else
                {
                    client.EditExpertiseByIDAsync(id_expertise, ExpertiseName, DateTime.Now, ExpertiseFOS.id_fos, Count_proj_expertise, lprojects.ToArray(), lcrits.ToArray(), lexperts.ToArray());

                    Waiting(true);
                    tblWait.Padding = new Thickness(100, 200, 200, 200);
                    tblWait.Text    = string.Format("Редактирование \n экспертизы...");
                }
            }
            else
            {
                MessageBox.Show("Выделенные поля заполнены неправильно!");
            }
        }
 private void bt_updatefos_Click(object sender, RoutedEventArgs e)
 {
     ServiceReference1.FiledsOfScience temp = dataGrid.SelectedItem as ServiceReference1.FiledsOfScience;
     _FOSCard                = new FOSCard();
     _FOSCard.Owner          = this;
     _FOSCard.id_fos         = temp.id_fos;
     _FOSCard.textBox.Text   = temp.name_fos;
     _FOSCard.button.Content = "Изменить";
     if (_FOSCard.ShowDialog() == true)
     {
         client.GetListFOSAsync();
     }
     else
     {
         client.GetListFOSAsync();
     }
 }
Example #6
0
        private void CreateNewExpertise()
        {
            if (CheckVars())
            {
                ExpertiseName        = tbxExpertiseName.Text;
                ExpertiseFOS         = cmbFOS.SelectedItem as ServiceReference1.FiledsOfScience;
                Count_proj_expertise = int.Parse(tbxCountExpertiseProjects.Text);

                List <int> projectsId = new List <int>();
                foreach (ServiceReference1.Projects pP in lExpertiseProjects)
                {
                    projectsId.Add(pP.id_project);
                }

                List <int> critsId = new List <int>();
                foreach (ServiceReference1.Criterions pC in lExpertiseCrit)
                {
                    critsId.Add(pC.id_crit);
                }

                List <int> expertsId = new List <int>();
                foreach (ServiceReference1.Experts pE in lExpertiseExperts)
                {
                    expertsId.Add(pE.id_expert);
                }

                if (Count_proj_expertise >= projectsId.Count())
                {
                    MessageBox.Show("Количество поддерживаемых проектов не должно ровняться количеству участвуюцих проектов и привышать его!");
                }
                else
                {
                    client.CreateNewExpertiseAsync(ExpertiseName, DateTime.Now, ExpertiseFOS.id_fos, Count_proj_expertise, projectsId.ToArray(), critsId.ToArray(), expertsId.ToArray());

                    Waiting(true);
                    tblWait.Text = string.Format("Создание \n экспертизы...");
                }
            }
            else
            {
                MessageBox.Show("Выделенные поля заполнены неправильно!");
            }
        }
 private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ServiceReference1.FiledsOfScience temp = comboBox1.SelectedItem as ServiceReference1.FiledsOfScience;
     fos = (temp.id_fos);
 }