/// <summary> /// This method inserts a new relationship between representant and user /// </summary> /// <param name="representantUser"> can't be null</param> public void InsertRepresentantUser(RepresentantUser representantUser) { DbContext.RepresentantUsers.InsertOnSubmit(representantUser); DbContext.SubmitChanges(); }
/// <summary> /// This method adds a representant to user /// </summary> /// <param name="companyId"></param> /// <param name="userId"></param> /// <param name="representantId"></param> public void AddRepresentantToUser(Int32 companyId, Int32 userId, Int32 representantId) { var representantManager = new RepresentantManager(this); var representantUser = new RepresentantUser { CompanyId = companyId, UserId = userId, RepresentantId = representantId }; representantManager.InsertRepresentantUser(representantUser); }