Exemple #1
0
        public void SaveLinkman(string sysNo, int userId, int companyId, Linkman linkman)
        {
            string msg;

            if (!Validation(linkman, out msg))
            {
                throw new Exception(msg);
            }

            _IContactDA.DeleteLinkman(linkman.Id);
            _IContactDA.AddLinkman(sysNo, userId, companyId, linkman);
        }
        public void GetAllLinkmansTest()
        {
            Contact testContact = CreateTestContact();

            _IContactDA.AddLinkman(testContact.SysNo, testContact.UserId, 0, testContact.Linkmans[0]);

            _LinkMan.Add(testContact.Linkmans[0].Id);

            Guid testLinkmanId = testContact.Linkmans[0].Id;

            Contact getContact = _IContactDA.GetAllLinkmans(testContact.SysNo, 0, testContact.UserId, false);

            Assert.AreEqual(testContact.Linkmans[0].Id, getContact.GetLinkmanById(testLinkmanId).Id);
            Assert.AreEqual(testContact.Linkmans[0].Name, getContact.GetLinkmanById(testLinkmanId).Name);
        }