예제 #1
0
 public int ModifyContact(ContactInfo Contact)
 {
     return contactManage.UpDate(Contact);
 }
예제 #2
0
 public int CreateContact(ContactInfo Contact)
 {
     return contactManage.Insert(Contact);
 }
예제 #3
0
 private SQLiteParameter[] Parameter(ContactInfo Contact)
 {
     return new SQLiteParameter[] {
        new SQLiteParameter("@Id",Contact.Id),
        new SQLiteParameter("@UserId",Contact.UserId),
        new SQLiteParameter("@Name",Contact.Name),
        new SQLiteParameter("@Address",Contact.Address)
        };
 }
예제 #4
0
 public int Insert(ContactInfo Contact)
 {
     try
     {
         return SqliteHelper.ExecuteNoQuery(System.Data.CommandType.Text, "insert into hm_contact (UserId,Name,Address)values(@UserId,@Name,@Address)", Parameter(Contact));
     }
     catch
     {
         return -1;
     }
 }
예제 #5
0
 public int UpDate(ContactInfo Contact)
 {
     try
     {
         return SqliteHelper.ExecuteNoQuery(System.Data.CommandType.Text, "update hm_contact set UserId = @UserId,Name = @Name,Address = @Address where Id = @Id", Parameter(Contact));
     }
     catch
     {
         return -1;
     }
 }