47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using Marco.Pms.Model.Dtos.Directory;
|
|
using Microsoft.Win32;
|
|
using System.Windows;
|
|
|
|
namespace Marco.Pms.UtilityApplication
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
DirectoryHelper helper = new DirectoryHelper();
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btnFileUpload_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
openFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|CSV files (*.csv)|*.csv"; // Optional: filter file types
|
|
|
|
if (openFileDialog.ShowDialog() == true)
|
|
{
|
|
string filePath = openFileDialog.FileName;
|
|
// Now you can use filePath to read or process the selected file
|
|
txtFilePath.Text = filePath;
|
|
//MessageBox.Show($"Selected file: {filePath}");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private async void btnSubmit_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
List<Contacts> contactsData = null;
|
|
List<TagsMaster> tagsMaster = null;
|
|
List<ProjectMaster> projectMaster = null;
|
|
List<CategoryMaster> categoryMasters = null;
|
|
|
|
|
|
(contactsData, categoryMasters, tagsMaster, projectMaster) = await helper.ReadExcelData(txtFilePath.Text);
|
|
|
|
List<CreateContactDto> createContactDto = await helper.GenerateCreateContactDto(contactsData, categoryMasters, tagsMaster, projectMaster);
|
|
}
|
|
}
|
|
} |