示例#1
0
 public List <ContactSummary> FindAll()
 {
     foreach (var item in contactSummaryDB)
     {
         ContactSummary contactSummaryItem = new ContactSummary(item);
         contactSummary.Add(contactSummaryItem);
     }
     return(contactSummary);
 }
        private void taskStackPanel_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Model.ContactSummary selectedContactSummary = _applicationPresenter.ContactSummaryRepository.FindSelected(ApplicationPresenter.SelectedContactSummaryId);
            ImportsAtAGlance.DataContext = selectedContactSummary;
            QuickInsight.DataContext     = selectedContactSummary;

            List <KeyValuePair <string, int> > contactValues = new List <KeyValuePair <string, int> >();

            contactValues.Add(new KeyValuePair <string, int>("Contacts Imported", selectedContactSummary.ContactsImported));
            contactValues.Add(new KeyValuePair <string, int>("Companies Imported", selectedContactSummary.CompaniesImported));
            contactValues.Add(new KeyValuePair <string, int>("Lacked Email", selectedContactSummary.LackedEmail));
            contactValues.Add(new KeyValuePair <string, int>("Lacked Phone", selectedContactSummary.LackedPhone));

            PieChart.DataContext = contactValues;

            DataService ds = new DataService();

            TableView.DataContext = ds.GetContactDetails(selectedContactSummary.ContactSummaryId);
        }
示例#3
0
        public ContactSummary OpenFileToImport()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = "d:\\";
            openFileDialog.Filter           = "csv files (*.csv)|*.csv";
            DialogResult   result         = openFileDialog.ShowDialog();
            ContactSummary contactSummary = new ContactSummary();

            //To Do Make sure excel file not opened
            if (result == DialogResult.OK)
            {
                if (openFileDialog.FileName != "")
                {
                    contactSummary.ImportedFile = openFileDialog.FileName;
                    FileConsumption fileprocessing = new FileConsumption(contactSummary);
                }
            }
            contactSummary.ImportedFile = openFileDialog.FileName;
            return(contactSummary);
        }
示例#4
0
        public ContactSummary FindSelected(int contactSummaryId)
        {
            ContactSummary contactSummary = FindAll().Where(contact => contact.ContactSummaryId == contactSummaryId).FirstOrDefault();

            return(contactSummary);
        }