//======================================================================================= 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); } }
// =================================================================== private void Client_AuthorizationCompleted(object sender, ServiceReference1.AuthorizationCompletedEventArgs e) { try { if (e.Error != null) // например проблемы с интернетом { if (MessageBox.Show("Нет доступа к базе данных", "Повторить попытку?", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { client.AuthorizationAsync(Login, Password); } else { this.Close(); } } else { User = e.Result; switch (User.id_expert) { case -1: Waiting(false); MessageBox.Show("Логин и/или пароль введены неверно."); break; case -2: Waiting(false); if (MessageBox.Show("Ошибка!", "Повторить попытку?", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { client.AuthorizationAsync(Login, Password); } else { this.Close(); } break; default: Waiting(false); DialogResult = true; break; } } } catch { if (MessageBox.Show("Нет доступа к сервису", "Повторить попытку?", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { client.AuthorizationAsync(Login, Password); } else { this.Close(); } } }
public ExpertRoom(ServiceReference1.Experts User) { InitializeComponent(); client.GetListExpertisesForExpertCompleted += Client_GetListExpertisesForExpertCompleted; this.User = User; tblExpertFullName.Text = string.Format("Эксперт: {0} {1} {2} ", User.surname_expert, User.name_expert, User.patronymic_expert); client.GetListExpertisesForExpertAsync(User.id_expert); Waiting(true); }
private void dgExpertiseExpertList_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e) { try { CurrentExpertiseExpert = dgExpertiseExpertList.CurrentCell.Item as ServiceReference1.Experts; CheckExpertbtn(); } catch { } }
public ExpertiseCard(int id_expertise, ServiceReference1.Experts expert) { InitializeComponent(); this.id_expertise = id_expertise; this.expert = expert; client.GetMyExpertiseForCardByIDCompleted += Client_GetMyExpertiseForCardByIDCompleted; client.GetListAuthorsForProjectCompleted += Client_GetListAuthorsForProjectCompleted; client.GetMyExpertiseForCardByIDAsync(id_expertise); Waiting(true); ShowResultExpertiseTable(false); }
private void dgExpertList_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e) { try { CurrentExpert = dgExpertList.SelectedCells[0].Item as ServiceReference1.Experts; tmpExpert = new ServiceReference1.Experts(); tmpExpert = CurrentExpert; CheckExpertbtn(); } catch { } }
double[] MultiplyMarkMtrix; // Перемноженое OwnVector и AvgMarkMatrixForProject // ========== public EspertiseResult(ServiceReference1.myExpertiseForCard Expertise, ServiceReference1.Experts expert) { InitializeComponent(); client.SupportProjectCompleted += Client_SupportProjectCompleted; this.Expertise = Expertise; this.expert = expert; CountExpert = Expertise.ListExperts.Count(); CountCriterions = Expertise.ListCriterions.Count(); CountProject = Expertise.ListProjects.Count(); MultiplyMatrix(); FirstFillFileds(); Waiting(false); }
private void btnAddExpert_Click(object sender, RoutedEventArgs e) { ServiceReference1.Experts E = new ServiceReference1.Experts(); E = tmpExpert; if (lExpertiseExperts.Where(p => p.id_expert == E.id_expert).FirstOrDefault() == null) // если этого эксперта ещё не добавляли { lExpertiseExperts.Add(E); dgExpertiseExpertList.ItemsSource = null; dgExpertiseExpertList.ItemsSource = lExpertiseExperts; CheckProjbtn(); } else { MessageBox.Show(string.Format("Эксперт с id = {0} уже был добавлен ранее!", E.id_expert)); } }
// авторизация private void button11_Click(object sender, RoutedEventArgs e) { if (User != null) { User = null; ShowUserInfo(); } else { _Authorization = new Authorization(); _Authorization.Owner = this; _Authorization.ShowDialog(); if (_Authorization.DialogResult == true) { this.User = _Authorization.User; ShowUserInfo(); } } }