//-------------------------------------------------------------------------------------------------------------------------------------------------------------- #region Show_Khoi_Luong_Len_ListView //---------------------------------------------------------- private void get_quantity_all_Click(object sender, RoutedEventArgs e) { try { List <string> file_name = doc.Title.Split('_').ToList(); if (file_name.Count() > 3 && file_name[0] == project_number && file_name[1] == block && file_name[3] == Class) { my_element_link = new ObservableCollection <data_element_link>(); my_quantity_total = new ObservableCollection <data_quantity>(); my_quatity_item = new ObservableCollection <data_quantity>(); my_quantity_detail = new ObservableCollection <data_quantity>(); my_file_link = new ObservableCollection <data_file_link>(); F_GetElement.Get_ELement_Link_Or_NoLink(doc, my_element_link); Show_Khoi_Luong_Len_ListView(); material_of_element_in_project = my_quantity_total.Select(x => x.ma_cong_tac).ToList(); F_Chart.Show_Du_Lieu_Len_Chart(bieu_do_category, DataContext, this, my_element_link); Search(); } else { MessageBox.Show("Thông tin dự án không đồng nhất. Vui lòng kiểm tra lại!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); this.Close(); } }
//---------------------------------------------------------- public void Khoi_Luong_Cua_Link_File() { try { List <data_element_link> list_remove = new List <data_element_link>(); foreach (data_file_link file in my_file_link) { Document doc1 = uiapp.Application.Documents.Cast <Document>().First(x => x.Title == file.ten_file); if (file.chon_file_link == true) { if (my_element_link.Any(x => x.doc.Title == doc1.Title) == false) { my_element_link.Where(x => x.doc.Title == doc1.Title).ToList().ForEach(y => list_remove.Add(y)); F_GetElement.Get_ELement_Link_Or_NoLink(doc1, my_element_link); } } else { my_element_link.Where(x => x.doc.Title == doc1.Title).ToList().ForEach(y => list_remove.Add(y)); } } list_remove.ForEach(x => my_element_link.Remove(x)); if (my_file_link.Count() > 0) { Show_Khoi_Luong_Len_ListView(); F_Chart.Show_Du_Lieu_Len_Chart(bieu_do_category, DataContext, this, my_element_link); } e_visible_link.Raise(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }