本文整理汇总了C#中OpenCBS.CoreDomain.Clients.Group.AddMember方法的典型用法代码示例。如果您正苦于以下问题:C# Group.AddMember方法的具体用法?C# Group.AddMember怎么用?C# Group.AddMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.CoreDomain.Clients.Group
的用法示例。
在下文中一共展示了Group.AddMember方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddGroup
private static Group AddGroup(bool active, string city, District district, string name, Member leader, int NbOfMembers)
{
Group group = new Group {Active = active, City = city, District = district, Name = name, Leader = leader};
for (int i = 0; i < NbOfMembers; i++)
{
group.AddMember(new Member { Tiers = new Person(), LoanShareAmount = 1000 + i, CurrentlyIn = true, IsLeader = true, JoinedDate = TimeProvider.Today });
}
return group;
}
示例2: TestIfClientCanBeAddToAGroupWhenClientAlreadyInThisGroup
public void TestIfClientCanBeAddToAGroupWhenClientAlreadyInThisGroup()
{
Person person = new Person {Id = 1};
Group group = new Group();
group.AddMember(new Member { Tiers = person, LoanShareAmount = 1000, CurrentlyIn = true, IsLeader = true, JoinedDate = TimeProvider.Today });
clientServices.ClientCanBeAddToAGroup(person, group);
}
示例3: TestUpdateGroup
public void TestUpdateGroup()
{
AddDataForTestingTransaction addDataForTesting = new AddDataForTestingTransaction();
clientManagement = new ClientManager(DataUtil.TESTDB);
clientServices = new ClientServices(clientManagement);
DeleteAllData();
Person leader = addDataForTesting.AddPerson();
Person members = addDataForTesting.AddPersonBis();
Person membersTer = addDataForTesting.AddPersonTer();
Person membersQuater = addDataForTesting.AddPersonQuater();
Group group = new Group
{
Active = true,
City = "Dushambe",
District = leader.District,
LoanCycle = 2,
Name = "SCG",
Leader =new Member{Tiers = leader,LoanShareAmount = 1000,CurrentlyIn = true,IsLeader = true,JoinedDate = TimeProvider.Today},
Branch = _branch
};
group.AddMember(new Member { Tiers = members, LoanShareAmount = 200, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
group.AddMember(new Member { Tiers = membersTer, LoanShareAmount = 400, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
group.AddMember(new Member { Tiers = membersQuater, LoanShareAmount = 700, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
Assert.AreEqual(String.Empty, clientServices.SaveSolidarityGroup(ref group));
group.Name = "SCG2";
Assert.AreEqual(String.Empty, clientServices.SaveSolidarityGroup(ref group));
}
示例4: TestSelectGroupIdsByPersonId
public void TestSelectGroupIdsByPersonId()
{
_person.Id = _cltManagement.AddPerson(_person);
Group group1 = new Group {Active = true, City = "Dushambe", District = _district, Name = "SCG1", Branch = _branch};
group1.AddMember(new Member { Tiers = _person, LoanShareAmount = 1000, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
_cltManagement.AddNewGroup(group1);
Group group2 = new Group {Active = true, City = "Dushambe", District = _district, Name = "SCG2", Branch = _branch};
group2.AddMember(new Member { Tiers = _person, LoanShareAmount = 2000, CurrentlyIn = true, IsLeader = true, JoinedDate = TimeProvider.Today });
_cltManagement.AddNewGroup(group2);
Assert.AreEqual(2,_cltManagement.SelectGroupIdsByPersonId(_person.Id).Count);
}
示例5: TestSelectGroup
public void TestSelectGroup()
{
Person leader = new Person
{
FirstName = "Nicolas",
LastName = "MANGIN",
Sex = 'M',
IdentificationData = "12345",
LoanCycle = 1,
BadClient = false,
Address = "NotSet",
City = "NotSet",
DateOfBirth = TimeProvider.Today,
District = _district,
Activity = _agriculture,
Branch = _branch
};
leader.Id = _cltManagement.AddPerson(leader);
Person member1 = new Person
{
FirstName = "Mariam",
LastName = "MANGIN",
Sex = 'M',
IdentificationData = "123456",
LoanCycle = 1,
BadClient = false,
Address = "NotSet",
City = "NotSet",
DateOfBirth = TimeProvider.Today,
District = _district,
Activity = _agriculture,
Branch = _branch
};
member1.Id = _cltManagement.AddPerson(member1);
Person member2 = new Person
{
FirstName = "Vincent",
LastName = "MANGIN",
Sex = 'M',
IdentificationData = "1234567",
LoanCycle = 1,
BadClient = false,
Address = "NotSet",
City = "NotSet",
DateOfBirth = TimeProvider.Today,
District = _district,
Activity = _agriculture,
Branch = _branch
};
member2.Id = _cltManagement.AddPerson(member2);
Person member3 = new Person
{
FirstName = "Rudy",
LastName = "MANGIN",
Sex = 'M',
IdentificationData = "12345678",
LoanCycle = 1,
BadClient = false,
Address = "NotSet",
City = "NotSet",
DateOfBirth = TimeProvider.Today,
District = _district,
Activity = _agriculture,
Branch = _branch
};
member3.Id = _cltManagement.AddPerson(member3);
Group grp = new Group
{
Leader = new Member { Tiers = leader, LoanShareAmount = 0, CurrentlyIn = true, IsLeader = true, JoinedDate = TimeProvider.Today },
EstablishmentDate = TimeProvider.Today,
Name = "GroupTest",
Branch = _branch
};
grp.AddMember(new Member { Tiers = member1, LoanShareAmount = 100, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
grp.AddMember(new Member { Tiers = member2, LoanShareAmount = 100, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
grp.AddMember(new Member { Tiers = member3, LoanShareAmount = 100, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
grp.District = _district;
grp.Address = "NotSet";
grp.City = "NotSet";
grp.Id = _cltManagement.AddNewGroup(grp);
Group newGroup = _cltManagement.SelectGroupById(grp.Id);
Assert.AreEqual("Nicolas MANGIN", newGroup.Leader.Tiers.Name);
}
示例6: TestGetTotalLoanAmount
public void TestGetTotalLoanAmount()
{
Group group = new Group();
Person pers1 = new Person {Id = 1};
Person pers2 = new Person {Id = 2};
group.AddMember(new Member { Tiers = pers1, LoanShareAmount = 100, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
group.AddMember(new Member { Tiers = pers2, LoanShareAmount = 76.78m, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
Assert.AreEqual(176.78m,group.GetTotalLoanAmount.Value);
}
示例7: TestNumberOfMemberCorrectlyGet
public void TestNumberOfMemberCorrectlyGet()
{
Group group = new Group();
Assert.AreEqual(0,group.GetNumberOfMembers);
group.AddMember(new Member { Tiers = new Person(), LoanShareAmount = 10, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
Assert.AreEqual(1,group.GetNumberOfMembers);
}
示例8: TestSaveGroupWhenCityIsNotMandatory
public void TestSaveGroupWhenCityIsNotMandatory()
{
AddDataForTestingTransaction addDataForTesting = new AddDataForTestingTransaction();
clientManagement = new ClientManager(DataUtil.TESTDB);
clientServices = new ClientServices(clientManagement);
branchManager = new BranchManager(DataUtil.TESTDB);
//List<Branch> branchs = branchManager.SelectAll();
ApplicationSettings dataParam = ApplicationSettings.GetInstance("");
dataParam.DeleteAllParameters();
dataParam.AddParameter(OGeneralSettings.GROUPMINMEMBERS, 4);
dataParam.AddParameter(OGeneralSettings.GROUPMAXMEMBERS, 10);
dataParam.AddParameter(OGeneralSettings.CITYMANDATORY, false);
DeleteAllData();
Person leader = addDataForTesting.AddPerson();
Person members = addDataForTesting.AddPersonBis();
Person membersTer = addDataForTesting.AddPersonTer();
Person membersQuater = addDataForTesting.AddPersonQuater();
Group group = new Group
{
Active = true,
City = null,
District = leader.District,
Name = "SCG",
Leader = new Member { Tiers = leader, LoanShareAmount = 1000, CurrentlyIn = true, IsLeader = true, JoinedDate = TimeProvider.Today },
LoanCycle = 3,
Branch = _branch
};
group.AddMember(new Member { Tiers = members, LoanShareAmount = 200, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
group.AddMember(new Member { Tiers = membersTer, LoanShareAmount = 400, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
group.AddMember(new Member { Tiers = membersQuater, LoanShareAmount = 700, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
Assert.AreEqual(String.Empty, clientServices.SaveSolidarityGroup(ref group));
}