Exemplo n.º 1
0
        private void bt_criterion_Click(object sender, RoutedEventArgs e) //карточка критерия
        {
            //ServiceReference1.Categories temp = dataGrid.SelectedItem as ServiceReference1.Categories;
            //ServiceReference1.Criterions temp2 = dataGrid1.SelectedItem as ServiceReference1.Criterions;
            //_AddCriterions_categories = new AddCriterions_categories();
            //_AddCriterions_categories.Owner = this;
            //_AddCriterions_categories.tabControl.SelectedIndex = 1;
            //_AddCriterions_categories.textBox1.Text = temp2.name_crit;

            //if (temp2.qualit_crit == true)//количественный
            //{

            //    _AddCriterions_categories.comboBox.SelectedIndex = 0;
            //}
            //else if(temp2.qualit_crit == false)
            //{

            //    _AddCriterions_categories.comboBox.SelectedIndex = 1;
            //}
            //_AddCriterions_categories.id_cat = temp.id_category;
            //_AddCriterions_categories.id_crit = temp2.id_crit;

            //client.GetListCritValuesAsync(temp2.id_crit);

            CurrentCriterions     = dataGrid1.SelectedItem as ServiceReference1.Criterions;
            _CriterionsCard       = new CriterionsCard(CurrentCriterions.id_crit);
            _CriterionsCard.Owner = this;
            _CriterionsCard.Show();
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
 private void dgExpertiseCritList_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
 {
     try
     {
         CurrentExpertiseCrit = dgExpertiseCritList.CurrentCell.Item as ServiceReference1.Criterions;
         CheckCritbtn();
     }
     catch { }
 }
Exemplo n.º 4
0
        private void dgCritList_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
        {
            try
            {
                CurrentCrit = dgCritList.SelectedCells[0].Item as ServiceReference1.Criterions;
                tmpCrit     = new ServiceReference1.Criterions();
                tmpCrit     = CurrentCrit;

                CheckCritbtn();
            }
            catch { }
        }
Exemplo n.º 5
0
        private void btnAddCrit_Click(object sender, RoutedEventArgs e)
        {
            ServiceReference1.Criterions C = new ServiceReference1.Criterions();
            C = tmpCrit;
            if (lExpertiseCrit.Where(p => p.id_crit == C.id_crit).FirstOrDefault() == null) // если этот критерий ещё не добавляли
            {
                lExpertiseCrit.Add(C);
                dgExpertiseCritList.ItemsSource = null;
                dgExpertiseCritList.ItemsSource = lExpertiseCrit;

                CheckCritbtn();
            }
            else
            {
                MessageBox.Show(string.Format("Критерий с id = {0} уже был добавлен ранее!", C.id_crit));
            }
        }
Exemplo n.º 6
0
        private void btnDeleteCrit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                for (int i = 0; i < lExpertiseCrit.Count; i++)
                {
                    if (lExpertiseCrit[i].id_crit == CurrentExpertiseCrit.id_crit)
                    {
                        lExpertiseCrit.RemoveAt(i);
                    }
                }
                dgExpertiseCritList.ItemsSource = null;
                dgExpertiseCritList.ItemsSource = lExpertiseCrit;

                CurrentExpertiseCrit = null;
            }
            catch { }
        }
        //==============================================================================================
        void CreateExaminationGrid(int CurrCritIndex)
        {
            btnNext.IsEnabled = false;
            ServiceReference1.Criterions CurrCrit = arrCriterions[CurrCritIndex];

            tblCritName.Text = string.Format("Критерий: {0}", CurrCrit.name_crit);
            gContent.Children.Clear();
            gContent.RowDefinitions.Clear();

            if (!CurrCrit.qualit_crit) // если критерий количественный
            {
                List <string> ltmpValidValues = CurrCrit.CritValues[0].valid_values.Split(new char[] { ';' }).ToList();
                int           C = ltmpValidValues.Count();
                ltmpValidValues.RemoveAt(C - 1);
                C = ltmpValidValues.Count();

                List <string> lValidValues = new List <string>();
                string        UOM          = "";
                for (int i = 0; i < C; i++)
                {
                    if (i != C - 1)
                    {
                        lValidValues.Add(ltmpValidValues[i]);
                    }
                    else
                    {
                        UOM = ltmpValidValues[i];
                    }
                }

                List <MarkForExaminationProject> lM = new List <MarkForExaminationProject>();
                for (int i = 0; i < lValidValues.Count(); i++)
                {
                    MarkForExaminationProject M = new MarkForExaminationProject(lValidValues[i].ToString(), i + 1);
                    lM.Add(M);
                }

                for (int i = 0; i < CountProjects + CountProjects - 1; i++)
                {
                    int x;
                    Math.DivRem(i, 2, out x);

                    RowDefinition rd = new RowDefinition();
                    if (x == 0)
                    {
                        rd.Height = new GridLength(55);
                    }
                    else
                    {
                        rd.Height = new GridLength(5);
                    }
                    gContent.RowDefinitions.Add(rd);
                }

                int curGridLine = 0;
                for (int i = 0; i < CountProjects; i++)
                {
                    TextBlock tbl = new TextBlock();
                    tbl.Text          = arrProjects[i].name_project;
                    tbl.TextWrapping  = TextWrapping.Wrap;
                    tbl.TextAlignment = TextAlignment.Right;
                    Grid.SetRow(tbl, curGridLine);
                    Grid.SetColumn(tbl, 0);
                    gContent.Children.Add(tbl);

                    ComboBox cmb = new ComboBox();
                    cmb.ItemsSource       = lM;
                    cmb.DisplayMemberPath = "fuzzyvalue";
                    cmb.Height            = 30;
                    cmb.SelectionChanged += Cmb_SelectionChanged;
                    cmb.VerticalAlignment = VerticalAlignment.Top;
                    Grid.SetRow(cmb, curGridLine);
                    Grid.SetColumn(cmb, 2);
                    gContent.Children.Add(cmb);

                    TextBlock tbl2 = new TextBlock();
                    tbl2.Text         = UOM;
                    tbl2.TextWrapping = TextWrapping.Wrap;
                    Grid.SetRow(tbl2, curGridLine);
                    Grid.SetColumn(tbl2, 4);
                    gContent.Children.Add(tbl2);

                    curGridLine = curGridLine + 2;
                }
            }
            else // если критерий качественный
            {
                List <string> lValidValues = CurrCrit.CritValues[0].valid_values.Split(new char[] { ';' }).ToList();
                int           C            = lValidValues.Count();
                lValidValues.RemoveAt(C - 1);
                C = lValidValues.Count();

                List <MarkForExaminationProject> lM = new List <MarkForExaminationProject>();
                for (int i = 0; i < lValidValues.Count(); i++)
                {
                    MarkForExaminationProject M = new MarkForExaminationProject(lValidValues[i].ToString(), i + 1);
                    lM.Add(M);
                }

                for (int i = 0; i < CountProjects + CountProjects - 1; i++)
                {
                    int x;
                    Math.DivRem(i, 2, out x);

                    RowDefinition rd = new RowDefinition();
                    if (x == 0)
                    {
                        rd.Height = new GridLength(40);
                    }
                    else
                    {
                        rd.Height = new GridLength(5);
                    }
                    gContent.RowDefinitions.Add(rd);
                }

                int curGridLine = 0;
                for (int i = 0; i < CountProjects; i++)
                {
                    TextBlock tbl = new TextBlock();
                    tbl.Text          = arrProjects[i].name_project;
                    tbl.TextWrapping  = TextWrapping.Wrap;
                    tbl.Tag           = "Left";
                    tbl.TextAlignment = TextAlignment.Right;
                    Grid.SetRow(tbl, curGridLine);
                    Grid.SetColumn(tbl, 0);
                    gContent.Children.Add(tbl);

                    ComboBox cmb = new ComboBox();
                    cmb.ItemsSource       = lM;
                    cmb.DisplayMemberPath = "fuzzyvalue";
                    cmb.Height            = 30;
                    cmb.SelectionChanged += Cmb_SelectionChanged2;
                    cmb.VerticalAlignment = VerticalAlignment.Top;
                    Grid.SetRow(cmb, curGridLine);
                    Grid.SetColumn(cmb, 2);
                    gContent.Children.Add(cmb);

                    TextBlock tbl2 = new TextBlock();
                    tbl2.Text         = "Числовое значение: ";
                    tbl2.TextWrapping = TextWrapping.Wrap;
                    tbl2.Tag          = "Right";
                    Grid.SetRow(tbl2, curGridLine);
                    Grid.SetColumn(tbl2, 4);
                    gContent.Children.Add(tbl2);

                    curGridLine = curGridLine + 2;
                }
            }
        }