/// <summary> /// 测试之前初始化, 初始化3条ContactModel数据 /// </summary> public void Init() { //初始化SiteContactModel数据项 sm = new SiteContactModel() { ContactId = 1, SiteId = 1 }; //暂不插入数据库,测试时使用 lc = new List <ContactModel> { new ContactModel { Contact_name = "Tom", Contact_email = "*****@*****.**" }, new ContactModel { Contact_name = "Rain", Contact_email = "*****@*****.**" }, new ContactModel { Contact_name = "Jerry", Contact_email = "*****@*****.**" } }; }
/// <summary> /// 插入一条绑定记录 /// </summary> /// <param name="connect">待插入的绑定记录</param> /// <returns>此次操作影响的数据行数</returns> public int InsertConnect(SiteContactModel connect) { int result = -1; using (SQLiteConnection conn = new SQLiteConnection(new SQLitePlatformWinRT(), DataBaseControlImpl.DBPath)) { result = conn.Insert(connect); } return(result); }