当前位置: 首页>>代码示例>>C#>>正文


C# Group.AddMember方法代码示例

本文整理汇总了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;
        }
开发者ID:won21kr,项目名称:opencbs,代码行数:10,代码来源:TestClientServices.cs

示例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);
        }
开发者ID:won21kr,项目名称:opencbs,代码行数:8,代码来源:TestClientServices.cs

示例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));
        }
开发者ID:won21kr,项目名称:opencbs,代码行数:32,代码来源:TestClientServices.cs

示例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);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:15,代码来源:TestClientManager.cs

示例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);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:90,代码来源:TestClientManager.cs

示例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);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:10,代码来源:TestGroup.cs

示例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);
 }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:7,代码来源:TestGroup.cs

示例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));
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:36,代码来源:TestClientServices.cs


注:本文中的OpenCBS.CoreDomain.Clients.Group.AddMember方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。