public int InsertComment(CommentDTO cm) { int kq = 0; try { data.sp_ins_com(cm.NOIDUNG1, cm.THOIGIAN1, cm.TKCOMMENT1, cm.MAVOUCHERCOMMENT1); data.SubmitChanges(); kq = 1; } catch (Exception ex) { } return kq; }
public List<CommentDTO> SelectComment_Voucher(int v) { List<CommentDTO> listComment = new List<CommentDTO>(); List<Comment> listcm = data.sp_CommentXemVoucher(v).ToList(); foreach (Comment cm in listcm) { CommentDTO cmDto = new CommentDTO(cm); listComment.Add(cmDto); } return listComment; }
public List<CommentDTO> SelectAllComment() { List<CommentDTO> listComment = new List<CommentDTO>(); List<Comment> listcm = data.sp_CommentXem().ToList(); foreach (Comment cm in listcm) { CommentDTO cmDto = new CommentDTO(cm); listComment.Add(cmDto); } return listComment; }