public int Insert(AttachmentInfo Attachment) { try { return SqliteHelper.ExecuteNoQuery(System.Data.CommandType.Text, "insert into hm_mailinfo_Attachment (MailId,FileName,ContentType,Encoding,FileBuufer)values(@MailId,@FileName,@ContentType,@Encoding,@FileBuufer)", Parameter(Attachment)); } catch { return -1; } }
public int UpDate(AttachmentInfo Attachment) { try { return SqliteHelper.ExecuteNoQuery(System.Data.CommandType.Text, "update hm_mailinfo_Attachment set MailId = @MailId,FileName = @FileName, = @ContentType,Encoding = @Encoding,FileBuufer = @FileBuufer where Id = @Id", Parameter(Attachment)); } catch { return -1; } }
private SQLiteParameter[] Parameter(AttachmentInfo Attachment) { return new SQLiteParameter[] { new SQLiteParameter("@Id",Attachment.Id), new SQLiteParameter("@MailId",Attachment.MailId), new SQLiteParameter("@FileName",Attachment.FileName), new SQLiteParameter("@ContentType",Attachment.ContentType), new SQLiteParameter("@Encoding",Attachment.Encoding), new SQLiteParameter("@FileBuufer",Attachment.FileBuffer) }; }
public int CreateAttactment(AttachmentInfo attachment) { return attachmentService.Insert(attachment); }