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


C# DataBase.PersonInfoGetAll方法代码示例

本文整理汇总了C#中DataBase.PersonInfoGetAll方法的典型用法代码示例。如果您正苦于以下问题:C# DataBase.PersonInfoGetAll方法的具体用法?C# DataBase.PersonInfoGetAll怎么用?C# DataBase.PersonInfoGetAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataBase的用法示例。


在下文中一共展示了DataBase.PersonInfoGetAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeletePersonOnlyName

 public void DeletePersonOnlyName()
 {
     DataBase dataBase = new DataBase();
     string name = Guid.NewGuid().ToString();
     PersonInfo personInfo = new PersonInfo {Name = name};
     int rowsInserted = dataBase.PersonInfoInsert(personInfo);
     Assert.AreEqual(1, rowsInserted, "Person not inserted!");
     List<PersonInfo> list = dataBase.PersonInfoGetAll();
     Assert.IsNotNull(list, "At least one person info was expected!");
     PersonInfo info = list.Find(p => p.Name == name);
     Assert.AreEqual(name, info.Name, "PersonInfo not found! '{0}'", name);
     int rowsDeleted = dataBase.PersonInfoDelete(info.Id);
     Assert.AreEqual(1, rowsDeleted, "Person not deleted!");
 }
开发者ID:trippleflux,项目名称:jezatools,代码行数:14,代码来源:DataBaseTests.cs

示例2: UpdatePersonInfo

 public void UpdatePersonInfo()
 {
     DataBase dataBase = new DataBase();
     string name = Guid.NewGuid().ToString();
     PersonInfo personInfo = new PersonInfo
                             {
                                 Name = name,
                                 SurName = "surname",
                                 NickName = "nickname",
                                 Description = "description",
                                 Address = "adddress",
                                 PostNumber = 123,
                                 City = "city",
                                 Email = "[email protected]",
                                 Telephone = "00386 2 876 1234",
                                 TelephoneMobile = "++386 40 123 456",
                                 Fax = "+386 2 8761 211"
                             };
     int rowsInserted = dataBase.PersonInfoInsert(personInfo);
     Assert.AreEqual(1, rowsInserted, "Person not inserted!");
     List<PersonInfo> list = dataBase.PersonInfoGetAll();
     Assert.IsNotNull(list);
     PersonInfo find = list.Find(p => p.Name == name);
     Assert.IsNotNull(find);
     string newName = Guid.NewGuid().ToString();
     find.Name = newName;
     int rowsUpdated = dataBase.PersonInfoUpdate(find);
     Assert.AreEqual(1, rowsUpdated);
     PersonInfo updatedPersonInfo = dataBase.PersonInfoGet(find.Id);
     Assert.AreEqual(newName, updatedPersonInfo.Name);
     Assert.AreEqual(personInfo.SurName, updatedPersonInfo.SurName);
     Assert.AreEqual(personInfo.NickName, updatedPersonInfo.NickName);
     Assert.AreEqual(personInfo.Description, updatedPersonInfo.Description);
     Assert.AreEqual(personInfo.Address, updatedPersonInfo.Address);
     Assert.AreEqual(personInfo.PostNumber, updatedPersonInfo.PostNumber);
     Assert.AreEqual(personInfo.City, updatedPersonInfo.City);
     Assert.AreEqual(personInfo.Email, updatedPersonInfo.Email);
     Assert.AreEqual(personInfo.Telephone, updatedPersonInfo.Telephone);
     Assert.AreEqual(personInfo.TelephoneMobile, updatedPersonInfo.TelephoneMobile);
     Assert.AreEqual(personInfo.Fax, updatedPersonInfo.Fax);
 }
开发者ID:trippleflux,项目名称:jezatools,代码行数:41,代码来源:DataBaseTests.cs


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