Vikas Nale 9acb9974a0 Add a WPF project for utility application
- Import Director contact is implemented
2025-07-25 13:05:59 +05:30

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);
}
}
}