本文整理汇总了C#中OpenCBS.CoreDomain.Clients.Person类的典型用法代码示例。如果您正苦于以下问题:C# Person类的具体用法?C# Person怎么用?C# Person使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Person类属于OpenCBS.CoreDomain.Clients命名空间,在下文中一共展示了Person类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveProject_CodeNull_ThrowException
public void SaveProject_CodeNull_ThrowException()
{
var project = new Project("NotSet") {Code = null};
IClient client = new Person {Id = 1};
new ProjectServices(new User()).SaveProject(project, client);
}
示例2: TestTiersCorrectlySetAndRetrieved
public void TestTiersCorrectlySetAndRetrieved()
{
Person person = new Person();
person.LastName = "TOTO";
guarantor.Tiers = person;
Assert.AreEqual("TOTO",((Person)guarantor.Tiers).LastName);
}
示例3: SaveProject_AimEmpty_ThrowException
public void SaveProject_AimEmpty_ThrowException()
{
var project = new Project("NotSet") {Name = "NotSet", Code = "NotSet", Aim = String.Empty};
IClient client = new Person { Id = 1 };
new ProjectServices(new User()).SaveProject(project, client);
}
示例4: TestAddDeleteLeftDate
public void TestAddDeleteLeftDate()
{
Person person = new Person {Id = 1};
VillageMember member = new VillageMember {Tiers = person, JoinedDate = TimeProvider.Now, CurrentlyIn = true, IsLeader = false};
_village.AddMember(member);
_village.DeleteMember(member);
Assert.IsTrue(TimeProvider.Now.Equals(member.LeftDate));
}
示例5: Projects_Add_Get
public void Projects_Add_Get()
{
Person pers = new Person {Id = 1, LoanCycle = 3};
pers.AddProject();
Assert.AreEqual(1, pers.Projects.Count);
Assert.AreEqual("3/1", pers.Projects[0].ClientCode);
}
示例6: TestAddDelete
public void TestAddDelete()
{
Person person = new Person {Id = 1};
VillageMember member = new VillageMember {Tiers = person, JoinedDate = TimeProvider.Now, CurrentlyIn = true, IsLeader = false};
_village.AddMember(member);
Assert.AreEqual(1, _village.Members.Count);
_village.DeleteMember(member);
Assert.AreEqual(0, _village.Members.Count);
}
示例7: TestAddDeleteDifferent
public void TestAddDeleteDifferent()
{
Person person1 = new Person {Id = 1};
Person person2 = new Person {Id = 2};
VillageMember member1 = new VillageMember {Tiers = person1, JoinedDate = TimeProvider.Now, CurrentlyIn = true, IsLeader = false};
VillageMember member2 = new VillageMember {Tiers = person2, JoinedDate = TimeProvider.Now, CurrentlyIn = true, IsLeader = false};
_village.AddMember(member1);
_village.DeleteMember(member2);
Assert.AreEqual(1, _village.Members.Count);
}
示例8: ShowPictureForm
public ShowPictureForm(Person person, int photoSubId, PersonUserControl personUserControl)
{
InitializeComponent();
CaptionText = MultiLanguageStrings.GetString(Ressource.ClientForm, "Person.Text")+": "+ person.Name;
this.person = person;
this.photoSubId = photoSubId;
this.personUserControl = personUserControl;
addPhotoButton.Text = MultiLanguageStrings.GetString(Ressource.ShowPictureForm, "captionAdd.Text");
changePhotoButton.Text = MultiLanguageStrings.GetString(Ressource.ShowPictureForm, "captionChange.Text");
ShowPicture();
InitializeButtons();
}
示例9: PersonUserControl
public PersonUserControl(Person person, Form pMdiParent)
{
_mdiParent = pMdiParent;
Initialization();
_tempPerson = person;
InitializePerson();
InitializeGroup();
DisplayProjects(person.Projects);
DisplaySavings(person.Savings);
_tempPerson.DateOfBirth = person.DateOfBirth; //new DateTime(1980,1,1);
tabControlEconomicInfo.TabPages.Remove(tabPage1FollowUp);
textBoxIdentificationData.ReadOnly = ServicesProvider.GetInstance().GetGeneralSettings().IsAutomaticID;
if (ServicesProvider.GetInstance().GetGeneralSettings().IsAutomaticID)
textBoxIdentificationData.BackColor = Color.WhiteSmoke;
}
示例10: Copy_MembersAreCopied
public void Copy_MembersAreCopied()
{
Person person = new Person {Id = 1, Active = true, BadClient = true};
Member member = new Member {Tiers = person, IsLeader = true, CurrentlyIn = true};
Group group = new Group {Id = 3,BadClient = false, Active = true, Members = new List<Member> {member}};
Group clonedGroup = (Group)group.Copy();
Assert.AreEqual(3, clonedGroup.Id);
clonedGroup.Id = 7;
Assert.AreEqual(3,group.Id);
Assert.AreEqual(true, clonedGroup.Members[0].Tiers.BadClient);
clonedGroup.Members[0].Tiers.BadClient = false;
Assert.AreEqual(true, group.Members[0].Tiers.BadClient);
}
示例11: PersonUserControl
public PersonUserControl(Person person, Form pMdiParent, IApplicationController applicationController)
{
_applicationController = applicationController;
_mdiParent = pMdiParent;
Initialization();
_tempPerson = person;
InitPrintButton();
InitializePerson();
InitializeGroup();
DisplayProjects(person.Projects);
DisplaySavings(person.Savings);
_tempPerson.DateOfBirth = person.DateOfBirth;
textBoxIdentificationData.ReadOnly = ServicesProvider.GetInstance().GetGeneralSettings().IsAutomaticID;
if (ServicesProvider.GetInstance().GetGeneralSettings().IsAutomaticID)
textBoxIdentificationData.BackColor = Color.WhiteSmoke;
}
示例12: PersonUserControl
public PersonUserControl(Person person, Form pMdiParent, IExtensionActivator extensionActivator)
: base(extensionActivator)
{
_mdiParent = pMdiParent;
Initialization();
_tempPerson = person;
InitializePerson();
_InitializeGroup();
DisplayProjects(person.Projects);
DisplaySavings(person.Savings);
_tempPerson.DateOfBirth = person.DateOfBirth; //new DateTime(1980,1,1);
tabControlEconomicInfo.TabPages.Remove(tabPage1FollowUp);
textBoxIdentificationData.ReadOnly = ServicesProvider.GetInstance().GetGeneralSettings().IsAutomaticID;
if (ServicesProvider.GetInstance().GetGeneralSettings().IsAutomaticID)
textBoxIdentificationData.BackColor = Color.WhiteSmoke;
if (_tempPerson != null && _tempPerson.Id != 0)
InitializeAdvancedCustomizableFields(_tempPerson.Id);
else
InitializeAdvancedCustomizableFields(null);
}
示例13: TestIdSecondaryAddressPartiallyFilled
public void TestIdSecondaryAddressPartiallyFilled()
{
Person person = new Person();
District district = new District(1,"tress",new Province(1,"Sugh"));
person.SecondaryDistrict = null;
person.SecondaryCity = null;
Assert.IsFalse(person.SecondaryAddressPartiallyFilled);
person.SecondaryDistrict = district;
Assert.IsTrue(person.SecondaryAddressPartiallyFilled);
person.SecondaryCity = "city";
Assert.IsFalse(person.SecondaryAddressPartiallyFilled);
person.SecondaryDistrict = null;
person.SecondaryCity = null;
Assert.IsFalse(person.SecondaryAddressPartiallyFilled);
person.SecondaryCity = "paris";
Assert.IsTrue(person.SecondaryAddressPartiallyFilled);
}
示例14: TestSavingIsValid_InitialAmountCorrect
public void TestSavingIsValid_InitialAmountCorrect()
{
// Assert.Ignore();
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User { Id = 6 },
TimeProvider.Today,
_savingsProduct,
null)
{
InterestRate = 0.13,
FlatWithdrawFees = 3,
FlatTransferFees = 3,
DepositFees = 5,
CloseFees = 6,
ManagementFees = 7,
AgioFees = 6
};
Client client = new Person { Id = 6, LastName = "El Fanidi", Branch = new Branch()};
_savingManagerMock = new DynamicMock(typeof(SavingManager));
_savingEventManagerMock = new DynamicMock(typeof(SavingEventManager));
DynamicMock connectionMock = new DynamicMock(typeof(SqlConnection));
DynamicMock transactionMock = new DynamicMock(typeof(SqlTransaction));
connectionMock.SetReturnValue("BeginTransaction", transactionMock.MockInstance);
_savingManagerMock.SetReturnValue("GetConnection", connectionMock.MockInstance);
_savingManagerMock.ExpectAndReturn("GetNumberOfSavings", 1, 6);
_savingManagerMock.ExpectAndReturn("Add", 1, saving, client, transactionMock.MockInstance);
_savingServices = new SavingServices(
(SavingManager)_savingManagerMock.MockInstance,
(SavingEventManager)_savingEventManagerMock.MockInstance,
new User { Id = 6 }
);
try
{
Assert.GreaterOrEqual(_savingServices.SaveContract(saving, client), 0);
saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User { Id = 6 },
TimeProvider.Today,
_savingsProduct,
null)
{
InterestRate = 0.13,
FlatWithdrawFees = 3,
FlatTransferFees = 3,
DepositFees = 5,
CloseFees = 6,
ManagementFees = 7,
AgioFees = 6
};
_savingManagerMock.ExpectAndReturn("GetNumberOfSavings", 2, 6);
_savingManagerMock.ExpectAndReturn("Add", 2, saving, client, transactionMock.MockInstance);
Assert.GreaterOrEqual(_savingServices.SaveContract(saving, client), 0);
}
catch (OpenCbsSavingException exception)
{
Assert.Fail(exception.Code.ToString());
}
}
示例15: TestSavingIsValid_InitialAmountTooSmall
public void TestSavingIsValid_InitialAmountTooSmall()
{
Assert.Ignore();
SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(), TimeProvider.Today, null)
{ InterestRate = 0.13, Product = _savingsProduct };
_savingServices = new SavingServices(null, null, new User { Id = 6 });
try
{
Client client = new Person { Id = 1 };
_savingServices.SaveContract(saving, client);
saving.FirstDeposit(1, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);
Assert.Fail("Saving Contract shouldn't pass validation test before save (initial amount < product.min).");
}
catch (OpenCbsSavingException exception)
{
Assert.AreEqual((int)OpenCbsSavingExceptionEnum.EntryFeesIsInvalid, (int)exception.Code);
}
}