ListContacts() public méthode

public ListContacts ( ) : List
Résultat List
        public void TestProjectEventContactCreate()
        {
            bool PrimaryContact = true;
            var ProjectEventContact_bll = new sp_ProjectEventContact_BLL();
            var ProjectEventContact_dm = new sp_ProjectEventContact_DM();
            var ProjectEvent_bll = new sp_ProjectEvent_BLL();
            var Contact_bll = new sp_Contact_BLL();
            ProjectEventContact_dm.PrimaryContact = PrimaryContact;

            var allProjectEvents = ProjectEvent_bll.ListEvents();
            Assert.IsTrue(allProjectEvents.Count > 0, "The ListEvents() is broken, or no data in DB");
            ProjectEventContact_dm.EventID = allProjectEvents[0].EventID;

            var allContacts = Contact_bll.ListContacts();
            Assert.IsTrue(allContacts.Count > 0, "The ListContacts() is broken, or no data in DB");
            ProjectEventContact_dm.ContactID = allContacts[0].ContactID;

            ProjectEventContact_bll.InsertProjectEventContactContext(ProjectEventContact_dm);

            var ProjectEventContact_dm_selected = ProjectEventContact_bll.ListEventsContacts(
                                                                ProjectEventContact_dm.EventID,
                                                                ProjectEventContact_dm.ContactID);
            Assert.AreEqual(1, ProjectEventContact_dm_selected.Count);
            Assert.IsTrue(Equals(ProjectEventContact_dm, ProjectEventContact_dm_selected[0]));
        }
Exemple #2
0
 public void TestContactDelete()
 {
     DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "Contact.xlsx"));
         foreach (DataRow row in dt.Rows) // Loop over the rows.
         {
             string contactID = row["ContactID"].ToString();
             sp_Contact_DM data = new sp_Contact_DM();
             data.ContactID = new Guid(contactID);
             sp_Contact_BLL contact = new sp_Contact_BLL();
             contact.DeleteContactContext(data.ContactID);
             data = contact.ListContacts(new Guid(contactID));
             Assert.AreEqual(false, data.ActiveFlg, "ActiveFlag not set as expected");
         }
 }
Exemple #3
0
        public void TestContactReadAll()
        {
            //Pull our data from the excel file
            string helperDir = cExcel.GetHelperFilesDir();
            DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(helperDir, "Contact.xlsx"));
            //Pull our data directly from the DB
            var numRows = cExcel.getNumRecordsFromDB("[Vend].[tblContact]");

            //Pull our data from the DB through the BLL
            sp_Contact_BLL contact = new sp_Contact_BLL();
            var allContacts = contact.ListContacts();

            //Test the data from the BLL
            Assert.AreEqual(numRows, allContacts.Count);
        }
Exemple #4
0
 public void TestContactRead()
 {
     //Test Our Read
     DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(cExcel.GetHelperFilesDir(), "Contact.xlsx"));
     foreach (DataRow row in dt.Rows) // Loop over the rows.
     {
         string contactID = row["ContactID"].ToString();
         sp_Contact_BLL contact = new sp_Contact_BLL();
         sp_Contact_DM data = contact.ListContacts(new Guid(contactID));
         Assert.AreEqual(row["ContactFirstName"].ToString(), data.ContactFirstName, "Contact First Name Not Set As Expected");
         Assert.AreEqual(row["ContactMiddleName"].ToString(), data.ContactMiddleName, "Contact Middle Name Not Set As Expected");
         Assert.AreEqual(row["ContactLastName"].ToString(), data.ContactLastName, "Contact Last Name Not Set As Expected");
     }
 }
        protected void getContacts()
        {
            sp_VendContact_BLL vendContactBLL = new sp_VendContact_BLL();
            sp_Contact_BLL contactBLL = new sp_Contact_BLL();
            List<sp_VendContact_DM> vendContacts = vendContactBLL.ListVendContacts((Guid)currentUser.ProviderUserKey, null);
            foreach (sp_VendContact_DM vendCont in vendContacts)
            {
                contacts.Add(contactBLL.ListContacts(vendCont.ContactID));

            }

            //Uncomment to see that the combobox loads correctly
            /*sp_Contact_DM newCont = new sp_Contact_DM();
            newCont.ContactID = Guid.NewGuid();
            newCont.ContactFirstName = "Daniel";
            newCont.ContactMiddleName = "Lees";
            newCont.ContactLastName = "Barker";
            newCont.ActiveFlg = true;
            contacts.Add(newCont);*/
        }