public void Function_Dau_Vao() { try { List <string> file_name = doc.Title.Split('_').ToList(); project_number = doc.ProjectInformation.Number; block = doc.ProjectInformation.BuildingName; Class = doc.ProjectInformation.LookupParameter("Class") == null ? "" : doc.ProjectInformation.LookupParameter("Class").AsString(); if (string.IsNullOrEmpty(Class)) { MessageBox.Show("Share Parameter Class not found", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); } if (file_name.Count() > 3) { List <string> format = new List <string>(); if (project_number != file_name[0]) { format.Add("Project Number"); } if (block != file_name[1]) { format.Add("Block"); } if (Class != file_name[3]) { format.Add("Class"); } if (format.Count() == 0) { F_GetData.search_material_project = search_material_project; F_GetData.Them_Data_Vao_List_View(list_data, doc, number, thong_tin_parameter); } else { MessageBox.Show(string.Format("Data is incorrect.\nPlease check {0} and try again!", string.Join(",", format)), "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); this.Close(); } } else { MessageBox.Show("File name is incorrect. Please check and try again!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//-------------------------------------------------------------------------------------------------------------------------------------------------------------- private void Refresh_Data(object sender, RoutedEventArgs e) { F_GetData.search_material_project = search_material_project; F_GetData.Them_Data_Vao_List_View(list_data, doc, number, thong_tin_parameter); }