private void view_SaveLinkman(Linkman linkman) { try { _contactService.SaveLinkman(CompanyConfig.SYSTEMID, _view.UserId, 0, linkman); } catch (Exception ex) { throw ex; } }
public void AddEvent() { try { int companyId = _IEmployeeFacade.GetEmployeeByAccountID(LoginUser.Id).EmployeeDetails.Work.Company.DepartmentID; //userid为0,代表为公司 _contactService.SaveLinkman(CompanyConfig.SYSTEMID, 0, companyId, CompleteLogData()); _View.ActionSuccess = true; } catch (Exception ae) { _View.Message = ae.Message; } }
public void SaveLinkmanTest() { Contact testContact = CreateTestContact(); contactServices.SaveLinkman(testContact.SysNo, testContact.UserId, testContact.Linkmans[0]); Guid testLinkmanId = testContact.Linkmans[0].Id; Guid testDetailId = testContact.Linkmans[0].Details[0].Id; _LinkMans.Add(testContact.Linkmans[0]); Contact getContat = contactServices.LoadAllContact(testContact.SysNo, testContact.UserId, true); Assert.AreEqual(1, getContat.Linkmans.Count); Assert.AreEqual(2, getContat.GetLinkmanById(testLinkmanId).Details.Count); Assert.AreEqual(testContact.Linkmans[0].Id, getContat.GetLinkmanById(testLinkmanId).Id); Assert.AreEqual("linkman1", getContat.GetLinkmanById(testLinkmanId).Name); Assert.AreEqual(InfoType.Num_General, getContat.GetLinkmanById(testLinkmanId).GetLinkmanDetailById(testDetailId).Type); Assert.AreEqual("123456", getContat.GetLinkmanById(testLinkmanId).GetLinkmanDetailById(testDetailId).Value); }