Exemplo n.º 1
0
 public void Init(CommentParameter commentParameter)
 {
     Message          = commentParameter.Message;
     Likes            = commentParameter.Likes;
     SocialMedia      = commentParameter.SocialMedia;
     CreatedTime      = commentParameter.CreatedTime;
     ExtractedAt      = commentParameter.ExtractedAt;
     ExtractedAtSince = commentParameter.ExtractedAtSince;
     AuthorName       = commentParameter.AuthorName;
     AuthorPhoto      = commentParameter.AuthorPhoto;
     Sentiment        = commentParameter.Sentiment;
     Violence         = commentParameter.Violence;
     Drugs            = commentParameter.Drugs;
     Bullying         = commentParameter.Bullying;
     Adult            = commentParameter.Adult;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets all CommentReplies.
        /// </summary>
        /// <param name="BenefitsParameter">The Comment Reply parameters.</param>
        /// <returns></returns>
        public async Task <PagedList <Entity> > GetAllComments(CommentParameter commentParameter)
        {
            {
                {
                    var getCommentReplyParams = new object[] {
                        new MySqlParameter("@p_ReviewType", commentParameter.ReviewType),
                        new MySqlParameter("@p_ReferenceId", commentParameter.ReferenceId),
                        new MySqlParameter("@p_ApprovalStatus", commentParameter.ApprovalStatus)
                    };
                    var CommentReply = await FindAll("CALL SpSelectActiveComments(@p_ReviewType, @p_ReferenceId,@p_ApprovalStatus)", getCommentReplyParams).ToListAsync();

                    var mappedCommentReply = CommentReply.AsQueryable().ProjectTo <CommentReplyResponse>(mapper.ConfigurationProvider);
                    var sortedCommentReply = sortHelper.ApplySort(mappedCommentReply, commentParameter.OrderBy);
                    var shapedCommentReply = dataShaper.ShapeData(sortedCommentReply, commentParameter.Fields);

                    return(await PagedList <Entity> .ToPagedList(shapedCommentReply, commentParameter.PageNumber, commentParameter.PageSize));
                }
            }
        }
Exemplo n.º 3
0
        public void Check_LeaveType(string typeCode, decimal hours, int?billID)
        {
            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;
            IDBOperate m_dbOperate         = CommentParameter.GetDBOperatorOfDepotManagement();

            HR_LeaveType leaveType = GetLeaveType(ctx, typeCode);

            Hashtable paramTable = new Hashtable();

            paramTable.Add("@TypeCode", leaveType.TypeCode);
            paramTable.Add("@Hours", hours);
            paramTable.Add("@WorkID", BasicInfo.LoginID);
            paramTable.Add("@BillID", billID == null ? 0 : billID);

            Dictionary <OperateCMD, object> dicOperateCMD = m_dbOperate.RunProc_CMD("HR_LeaveBill_Type_Check", paramTable);

            if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
            {
                throw new Exception(Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]));
            }
        }
        /// <summary>
        /// 台帐
        /// </summary>
        /// <param name="productName">查询方式</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="storageID">库房ID</param>
        /// <param name="showTable">返回table数据集</param>
        /// <param name="error">出错时返回错误信息,无错时返回null</param>
        /// <returns>操作成功返回True,操作失败返回False</returns>
        public bool GetAllGather(string productName, DateTime startDate, DateTime endDate, string storageID,
                                 out DataTable showTable, out string error)
        {
            IDBOperate dbOperate = CommentParameter.GetDBOperatorOfDepotManagement();

            error     = null;
            showTable = null;

            try
            {
                Hashtable paramTable = new Hashtable();

                if (productName == "pro_B_GoodsListGather")
                {
                    paramTable.Add("@StartDate", startDate);
                    paramTable.Add("@EndDate", endDate);
                }

                DataSet ds = new DataSet();
                Dictionary <OperateCMD, object> dicOperateCMD = dbOperate.RunProc_CMD(productName, ds, paramTable);

                if (!Convert.ToBoolean(dicOperateCMD[OperateCMD.Return_OperateResult]))
                {
                    error = Convert.ToString(dicOperateCMD[OperateCMD.Return_Errmsg]);
                    return(false);
                }

                showTable = ds.Tables[0];

                return(true);
            }
            catch (Exception ex)
            {
                error = ex.Message;
                return(false);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetAllCommentRepliesQuery"/> class.
 /// </summary>
 /// <param name="commentReplyParameter">The Comment Reply parameters.</param>
 public GetAllCommentsQuery(CommentParameter commentParameter)
 {
     CommentParameter = commentParameter;
 }