Exemplo n.º 1
0
        private void grdReviews_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            ReviewInfo reviewInfo = e.Item.DataItem as ReviewInfo;

            if (reviewInfo != null)
            {
                // Update edit link using this item's ID
                HyperLink linkEdit = (e.Item.FindControl("linkEdit") as HyperLink);
                if (linkEdit != null)
                {
                    StringDictionary replaceParams = new StringDictionary
                    {
                        ["ReviewID"] = reviewInfo.ReviewID.ToString()
                    };
                    linkEdit.NavigateUrl = _nav.GetNavigationUrl(replaceParams);
                }

                // Add rating images
                PlaceHolder phRating = (e.Item.FindControl("phRating") as PlaceHolder);
                if (phRating != null)
                {
                    phRating.Controls.Add(GetRatingImages(reviewInfo.Rating));
                }
            }
        }
        public string PostReview(ReviewInfo review)
        {
            ReviewDatabase db     = ReviewDatabase.getInstance();
            JObject        status = db.addReview(review);

            return(status.ToString());
        }
    public List <ReviewInfo> GetReviewsByAuthor(string authorName)
    {
        List <ReviewInfo> reviews = new List <ReviewInfo>();

        var revs = from r in brde.Reviews
                   from a in r.Book.Authors
                   where a.AuthorName.Equals(authorName)
                   select new
        {
            r.Book.BookTitle,
            r.Reviewer.ReviewerLastName,
            r.ReviewTitle,
            r.ReviewDate,
            r.ReviewRating,
            r.ReviewText
        };

        foreach (var v in revs)
        {
            ReviewInfo info = new ReviewInfo();
            info.BookTitle    = v.BookTitle;
            info.ReviewTitle  = v.ReviewTitle;
            info.ReviewerName = v.ReviewerLastName;
            info.ReviewDate   = v.ReviewDate;
            info.BookRating   = v.ReviewRating;
            info.ReviewBody   = v.ReviewText;
            reviews.Add(info);
        }

        return(reviews);
    }
Exemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(FishEntity.OutboundOrderEntity model, string name)
        {
            Hashtable SQLString = new Hashtable( );

            SQLString = ReviewInfo.getSQLString(name, model.code, string.Empty, SQLString);
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("insert into t_outboundorder(");
            strSql.Append("seNumber,code,unit,type,shipName,weight,pileNum,codeNum,codeNumContract,date,waseHouse,speci,billName,pageNum,remark,notice,ware,receive,FishMealId,Country,Brands)");
            strSql.Append(" values (");
            strSql.Append("@seNumber,@code,@unit,@type,@shipName,@weight,@pileNum,@codeNum,@codeNumContract,@date,@waseHouse,@speci,@billName,@pageNum,@remark,@notice,@ware,@receive,@FishMealId,@Country,@Brands)");
            MySqlParameter [] parameters =
            {
                new MySqlParameter("@seNumber",        MySqlDbType.VarChar,  45),
                new MySqlParameter("@code",            MySqlDbType.VarChar,  45),
                new MySqlParameter("@unit",            MySqlDbType.VarChar,  45),
                new MySqlParameter("@type",            MySqlDbType.VarChar,  45),
                new MySqlParameter("@shipName",        MySqlDbType.VarChar,  45),
                new MySqlParameter("@weight",          MySqlDbType.Decimal,  10),
                new MySqlParameter("@pileNum",         MySqlDbType.VarChar,  45),
                new MySqlParameter("@codeNum",         MySqlDbType.VarChar,  45),
                new MySqlParameter("@codeNumContract", MySqlDbType.VarChar,  45),
                new MySqlParameter("@date",            MySqlDbType.Date),
                new MySqlParameter("@waseHouse",       MySqlDbType.VarChar,  45),
                new MySqlParameter("@speci",           MySqlDbType.VarChar,  45),
                new MySqlParameter("@billName",        MySqlDbType.VarChar,  45),
                new MySqlParameter("@pageNum",         MySqlDbType.Int32,    11),
                new MySqlParameter("@remark",          MySqlDbType.VarChar, 225),
                new MySqlParameter("@notice",          MySqlDbType.VarChar,  45),
                new MySqlParameter("@ware",            MySqlDbType.Decimal,  10),
                new MySqlParameter("@receive",         MySqlDbType.VarChar,  45),
                new MySqlParameter("@FishMealId",      MySqlDbType.VarChar,  50),
                new MySqlParameter("@Country",         MySqlDbType.VarChar,  50),
                new MySqlParameter("@Brands",          MySqlDbType.VarChar, 50)
            };
            parameters [0].Value  = model.seNumber;
            parameters [1].Value  = model.code;
            parameters [2].Value  = model.unit;
            parameters [3].Value  = model.type;
            parameters [4].Value  = model.shipName;
            parameters [5].Value  = model.weight;
            parameters [6].Value  = model.pileNum;
            parameters [7].Value  = model.codeNum;
            parameters [8].Value  = model.codeNumContract;
            parameters [9].Value  = model.date;
            parameters [10].Value = model.waseHouse;
            parameters [11].Value = model.speci;
            parameters [12].Value = model.billName;
            parameters [13].Value = model.pageNum;
            parameters [14].Value = model.remark;
            parameters [15].Value = model.notice;
            parameters [16].Value = model.ware;
            parameters [17].Value = model.receive;
            parameters [18].Value = model.FishMealId;
            parameters [19].Value = model.Country;
            parameters [20].Value = model.Brands;
            SQLString.Add(strSql, parameters);

            return(MySqlHelper.ExecuteSqlTran(SQLString));
        }
Exemplo n.º 5
0
 public void InsertReview(ReviewInfo review)
 {
     try
     {
         Conn.Open();
         string query =
             "INSERT INTO [VolunteerReview] (CareRecipientID, VolunteerID, Content, Rating, RatingTime) VALUES (@recipientId, @volunteerId, @content, @rating, @ratingTime)";
         using (SqlCommand insertReview = new SqlCommand(query, Conn))
         {
             insertReview.Parameters.AddWithValue("@recipientId", review.CareRecipientId);
             insertReview.Parameters.AddWithValue("@volunteerId", review.VolunteerId);
             insertReview.Parameters.AddWithValue("@content", review.Review ?? "");
             insertReview.Parameters.AddWithValue("@rating", review.StarAmount);
             insertReview.Parameters.AddWithValue("@ratingTime", DateTime.Now);
             insertReview.ExecuteNonQuery();
         }
     }
     catch (SqlException ex)
     {
         throw new ArgumentException("Insert review failed.");
     }
     finally
     {
         Conn.Close();
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Grant the reviewer review experience for the review
 /// </summary>
 private void GrantReviewerExperience(ReviewInfo info)
 {
     foreach (ReviewAlgorithmBase reviewAlgorithm in Algorithms.OfType <ReviewAlgorithmBase>())
     {
         reviewAlgorithm.AddReviewScore(info.Reviewer, info.Filenames, info.When);
     }
 }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                autoId = Request["AutoId"];
                if (!string.IsNullOrEmpty(autoId))
                {
                    reviewInfo = bll.Get <BLLJIMP.Model.ReviewInfo>(string.Format(" AutoId={0}", autoId));
                    if (reviewInfo != null)
                    {
                        reviewInfo.Pv++;
                        bll.Update(reviewInfo);
                    }
                }

                ForwardingRecord record = bll.Get <BLLJIMP.Model.ForwardingRecord>(string.Format(" FUserID='{0}' AND RUserID='{1}' AND WebsiteOwner='{2}' AND TypeName='话题赞'", bll.GetCurrentUserInfo().UserID, autoId, bll.WebsiteOwner));
                if (record != null)
                {
                    isPraise = true;
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
                Response.End();
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 增加数据
        /// </summary>
        /// <param name="_model"></param>
        /// <param name="_modelsList"></param>
        /// <returns></returns>
        public bool Add(FishEntity.BatchSheetEntity _model, List <FishEntity.BatchSheetsEntity> _modelsList, string name)
        {
            Hashtable SQLString = new Hashtable( );

            SQLString = ReviewInfo.getSQLString(name, _model.code, string.Empty, SQLString);
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("insert into t_batchsheet(");
            strSql.Append("code,productionDate)");
            strSql.Append(" values (");
            strSql.Append("@code,@productionDate)");
            MySqlParameter [] parameters =
            {
                new MySqlParameter("@code",           MySqlDbType.VarChar, 45),
                new MySqlParameter("@productionDate", MySqlDbType.Date)
            };
            parameters [0].Value = _model.code;
            parameters [1].Value = _model.productionDate;
            SQLString.Add(strSql, parameters);

            foreach (FishEntity.BatchSheetsEntity model in _modelsList)
            {
                add(SQLString, strSql, model);
            }

            return(MySqlHelper.ExecuteSqlTran(SQLString));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Store in DB that the reviewer is a possible reviewer in this bug/change.
        /// </summary>
        protected void ProcessReviewInfo(ReviewInfo info)
        {
            using (ExpertiseDBEntities repository = new ExpertiseDBEntities())
            {
                Bug theBug = repository.Bugs.Single(bug => bug.ChangeId == info.ChangeId && bug.RepositoryId == RepositoryId);

                bool fBugDirty = false;
                foreach (string primaryName in NameConsolidator.DeanonymizeAuthor(info.Reviewer))   // this is usually just one
                {
                    if (theBug.ActualReviewers.Any(reviewer => string.Equals(reviewer.Reviewer, primaryName, StringComparison.InvariantCultureIgnoreCase)))
                    {
                        continue;     //  the reviewer is already in the list
                    }
                    theBug.ActualReviewers.Add(new ActualReviewer()
                    {
                        ActivityId = info.ActivityId,
                        Bug        = theBug,
                        Reviewer   = primaryName
                    });
                    fBugDirty = true;
                }

                if (fBugDirty)
                {
                    repository.SaveChanges();
                }
            }
        }
Exemplo n.º 10
0
        public void ProcessRequest(HttpContext context)
        {
            string autoId = context.Request["id"];

            if (string.IsNullOrEmpty(autoId))
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                apiResp.msg  = "id 为必填项,请检查";
                bllReview.ContextResponse(context, apiResp);
                return;
            }
            ReviewInfo model = bllReview.GetReviewByAutoId(int.Parse(autoId));

            if (model == null)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                apiResp.msg  = "评论已经删除";
                bllReview.ContextResponse(context, apiResp);
                return;
            }
            if (bllReview.Delete(new ReviewInfo(), string.Format(" WebsiteOwner='{0}' AND AutoID={1}", bllReview.WebsiteOwner, int.Parse(autoId))) > 0)
            {
                apiResp.status = true;
                apiResp.msg    = "ok";
                int reviewCount = bllReview.GetReviewCount(BLLJIMP.Enums.ReviewTypeKey.AppointmentComment, model.ForeignkeyId, model.UserId);
                bllJuActivity.Update(new JuActivityInfo(), string.Format(" CommentCount={0} AND CommentAndReplayCount='{0}' ", reviewCount), string.Format(" JuActivityID={0}", model.ForeignkeyId));
            }
            else
            {
                apiResp.msg  = "删除评论失败";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            bllReview.ContextResponse(context, apiResp);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Receives a ReviewInfo object as a parameter and
        /// Saves the review to the database with the company name as the key
        /// </summary>
        /// <param name="review">The review to be saved</param>
        /// <returns>returns a JSON object indicating if it was successful or not</returns>
        public JObject addReview(ReviewInfo review)
        {
            string jsonstring = "{'companyName':'" + review.companyName + "','username':'******','review':'" + review.review
                                + "','stars':" + review.stars + ",'timestamp':" + review.timestamp + "}";
            JObject newReview = new JObject(JObject.Parse(jsonstring));

            string query = "INSERT INTO " + dbname + ".companyReviews(companyName, reviews) " + "VALUES ('" + review.companyName + "','" + newReview + "');";

            if (openConnection() == true)
            {
                MySqlCommand command = new MySqlCommand(query, connection);
                command.ExecuteNonQuery();

                command.CommandText = "SELECT * FROM " + dbname + ".companyReviews WHERE id = LAST_INSERT_ID();";

                MySqlDataReader reader = command.ExecuteReader();

                if (reader.Read() == true)
                {
                    reader.Close();
                    closeConnection();
                    return(JObject.Parse("{\"response\":\"success\"}"));
                }
                else
                {
                    reader.Close();
                    closeConnection();
                    return(JObject.Parse("{\"response\":\"failure\"}"));
                }
            }
            else
            {
                throw new Exception("Could not connect to database");
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 删除回复
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string DelReview(HttpContext context)
        {
            string        ids    = context.Request["ids"];
            List <string> IdList = ids.Split(',').Distinct().ToList();

            for (int i = 0; i < IdList.Count; i++)
            {
                if (string.IsNullOrWhiteSpace(IdList[i]))
                {
                    continue;
                }
                ReviewInfo re = bllReview.GetReviewInfo(int.Parse(IdList[i]));
                if (bllReview.DelReview(IdList[i]))
                {
                    if (re.ReviewType == "Answer")
                    {
                        bllUser.AddUserScoreDetail(re.UserId, EnumStringHelper.ToString(ScoreDefineType.DelAnswer), bll.WebsiteOwner, null, null);
                    }
                    else if (re.ReviewType == "ArticleComment" || re.ReviewType == "CommentReply")
                    {
                        bllUser.AddUserScoreDetail(re.UserId, EnumStringHelper.ToString(ScoreDefineType.DelReview), bll.WebsiteOwner, null, null);
                    }
                }
            }
            resp.Status = 1;
            resp.Msg    = "删除完成";
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Exemplo n.º 13
0
        public ActionResult Review()
        {
            string     username = Request.QueryString["username"];
            ReviewInfo Model    = new ReviewInfo();

            Model.username = username;
            return(View(Model));
        }
        protected virtual void OnReviewInfoImported(ReviewInfo d)
        {
            EventHandler <ReviewInfo> handler = ReviewInfoImported;

            if (handler != null)
            {
                handler(this, d);
            }
        }
Exemplo n.º 15
0
        public void InsertReview()
        {
            Assert.AreEqual(0, _reviewLogic.GetAllReviewsWithVolunteerId(1).Count);

            ReviewInfo reviewInfo = new ReviewInfo(1, 1, 1, "test", 5);

            _reviewLogic.InsertReview(reviewInfo);
            Assert.AreEqual(1, _reviewLogic.GetAllReviewsWithVolunteerId(1).Count);
        }
 public ReviewViewModel(ReviewInfo review)
 {
     ReviewId          = review.ReviewId;
     VolunteerId       = review.VolunteerId;
     CareRecipientId   = review.CareRecipientId;
     Review            = review.Review;
     StarAmount        = review.StarAmount;
     VolunteerName     = review.VolFirstName + " " + review.VolLastName;
     CareRecipientName = review.CareFirstName + " " + review.CareLastName;
 }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _nav = new AdminNavigation(Request.QueryString);

            try
            {
                // Get the Review ID
                ReviewInfo review = new ReviewInfo();

                if (!Page.IsPostBack)
                {
                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    if (_nav.ReviewID != Null.NullInteger)
                    {
                        ReviewController controller = new ReviewController();
                        review = controller.GetReview(PortalId, _nav.ReviewID);
                        if (review != null)
                        {
                            cmdDelete.Visible       = true;
                            divApproval.Visible     = true;
                            cmbRating.SelectedValue = review.Rating.ToString();
                            txtComments.Text        = review.Comments;
                            chkAuthorized.Checked   = review.Authorized;
                            txtUserName.Text        = review.UserName;
                        }
                        else
                        {
                            if (UserId != -1)
                            {
                                txtUserName.Text = UserInfo.DisplayName;
                            }
                            else
                            {
                                txtUserName.Text = Localization.GetString("Anonymous.Text", LocalResourceFile);
                            }
                        }
                    }
                }

                // Which controls do we display?
                if (CanManageReviews())
                {
                    txtUserName.Enabled   = false;
                    cmbRating.Enabled     = false;
                    divAuthorized.Visible = true;
                    divApproval.Visible   = false;
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Exemplo n.º 18
0
        public void ProcessRequest(HttpContext context)
        {
            string title   = context.Request["Title"];
            string content = context.Request["Context"];

            if (string.IsNullOrEmpty(title))
            {
                apiResp.msg = "标题不能为空";
                context.Response.Write(Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            if (string.IsNullOrEmpty(content))
            {
                apiResp.msg = "内容不能为空";
                context.Response.Write(Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            currentWebsteInfo = bllUser.GetWebsiteInfoModelFromDataBase();
            if (currentWebsteInfo.IsEnableUserReleaseReview == 0)
            {
                apiResp.msg = "暂不开放发布话题功能";
                context.Response.Write(Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            ReviewInfo model = new ReviewInfo
            {
                ForeignkeyId   = bllUser.WebsiteOwner,
                ForeignkeyName = bllUser.WebsiteOwner,
                UserId         = CurrentUserInfo.UserID,
                UserName       = CurrentUserInfo.TrueName,
                ReviewPower    = 0,
                InsertDate     = DateTime.Now,
                ReviewTitle    = title,
                ReviewContent  = content,
                WebsiteOwner   = bllUser.WebsiteOwner,
                PraiseNum      = 0,
                StepNum        = 0,
                ReviewType     = "话题",
                CategoryType   = "",
                ReplyDateTiem  = DateTime.Now
            };

            if (bllReview.Add(model))
            {
                BLLRedis.ClearReviewList(bllUser.WebsiteOwner);
                apiResp.status = true;
            }
            else
            {
                apiResp.msg = "发布失败";
            }
            context.Response.Write(Common.JSONHelper.ObjectToJson(apiResp));
        }
Exemplo n.º 19
0
        /// <summary>
        /// 填充回复信息相关关系数据
        /// </summary>
        /// <param name="item">回复数据</param>
        /// <param name="currUserId">用户id</param>
        /// <returns></returns>
        public ReviewInfo FilterReviewInfo(ReviewInfo item, string currUserId, bool showStatistic = true, bool showReplayToUser = true)
        {
            if (item == null)
            {
                return(null);
            }

            if (showStatistic)
            {
                if (!string.IsNullOrWhiteSpace(currUserId))
                {
                    //当前用户是否收藏和点赞
                    item.CurrUserIsFavorite = bLLCommRelation.ExistRelation(Enums.CommRelationType.ReviewFavorite, item.ReviewMainId.ToString(), currUserId);
                    item.CurrUserIsPraise   = bLLCommRelation.ExistRelation(Enums.CommRelationType.ReviewPraise, item.ReviewMainId.ToString(), currUserId);
                }

                //回复数,点赞数,收藏数

                if (item.ReviewType == CommonPlatform.Helper.EnumStringHelper.ToString(Enums.ReviewTypeKey.ArticleComment))
                {
                    item.ReplyCount = GetCount <ReviewInfo>(string.Format(" ForeignkeyId = '{0}' AND ReviewType = '{1}' ",
                                                                          item.ReviewMainId,
                                                                          CommonPlatform.Helper.EnumStringHelper.ToString(Enums.ReviewTypeKey.CommentReply))
                                                            );
                }

                if (item.ReviewType == CommonPlatform.Helper.EnumStringHelper.ToString(Enums.ReviewTypeKey.CommentReply))
                {
                    item.ReplyCount = GetCount <ReviewInfo>(string.Format(" ParentId = '{0}' AND ReviewType = '{1}' ",
                                                                          item.ReviewMainId,
                                                                          CommonPlatform.Helper.EnumStringHelper.ToString(Enums.ReviewTypeKey.CommentReply))
                                                            );
                }

                item.PraiseCount   = bLLCommRelation.GetRelationCount(Enums.CommRelationType.ReviewPraise, item.ReviewMainId.ToString(), "");
                item.FavoriteCount = bLLCommRelation.GetRelationCount(Enums.CommRelationType.ReviewFavorite, item.ReviewMainId.ToString(), "");
            }

            item.PubUser = bllUser.GetUserInfo(item.UserId);

            if (showReplayToUser && item.ParentId > 0)
            {
                var reviewInfo = GetReviewInfo(item.ParentId);

                if (reviewInfo != null)
                {
                    item.ReplayToUser = bllUser.GetUserInfo(reviewInfo.UserId);
                }
            }

            return(item);
        }
Exemplo n.º 20
0
        private string GetReviewContent(ReviewInfo review)
        {
            string result = "";

            result += review.Name + "\r\n";

            result += review.ShortDesc + "\r\n";
            result += review.LongDesc + "\r\n";

            result += "标签是:" + review.Labels + "\r\n";

            return(result);
        }
Exemplo n.º 21
0
        private static ReviewInfo ToDB(Review r)
        {
            ReviewInfo rInfo = new ReviewInfo
            {
                ReviewId     = r.ReviewId,
                RestaurantId = r.RestaurantId,
                Name         = r.Name,
                Summary      = r.Summary,
                Rating       = r.Rating
            };

            return(rInfo);
        }
Exemplo n.º 22
0
        private void lstReviews_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            ReviewInfo reviewInfo = e.Item.DataItem as ReviewInfo;

            if (reviewInfo != null)
            {
                PlaceHolder phRating = (e.Item.FindControl("plhRating") as PlaceHolder);
                if (phRating != null)
                {
                    phRating.Controls.Add(GetRatingImages(reviewInfo.Rating));
                }
            }
        }
Exemplo n.º 23
0
        private static Review ToWeb(ReviewInfo rInfo)
        {
            Review r = new Review
            {
                ReviewId     = rInfo.ReviewId,
                RestaurantId = rInfo.RestaurantId,
                Name         = rInfo.Name,
                Summary      = rInfo.Summary,
                Rating       = rInfo.Rating,
            };

            return(r);
        }
Exemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Request["ReviewId"]))
     {
         Response.Write("ReviewId 参数必传");
         Response.End();
     }
     Review = bllReview.Get <ReviewInfo>(string.Format(" AutoId={0}", Request["ReviewId"]));
     if (Review == null)
     {
         Response.Write("ReviewId 参数错误");
         Response.End();
     }
 }
Exemplo n.º 25
0
        public EmpWithRevInfo_Cat(ReviewInfo b, Employee employee)
        {
            // TODO: Complete member initialization
            try
            {
                this.Rating = (int)b.Rating;
                this.Name = employee.Name;
                this.Comment = b.Comments;
                this.ID = employee.EmpID;

            }
            catch
            { }
        }
Exemplo n.º 26
0
        public ActionResult IdentityReviewList(int pageIndex, int state)
        {
            string     state1 = state.ToString();
            ReviewInfo Model  = new ReviewInfo();

            Model.pageIndex = pageIndex;
            int clientPlatform = 4;

            viewLite viewLite = new viewLite {
                frameName = "EcrpMain", viewName = "InspectView"
            };
            sortInfo sortInfo = new sortInfo {
                sortType = 6
            };
            ConditionInfo ConditionInfo = new ConditionInfo {
                columnName = "state", conditionKind = 0, columnValue = state1
            };
            List <ConditionInfo> conditions = new List <ConditionInfo>();

            conditions.Add(ConditionInfo);
            searchInfo searchInfo = new searchInfo {
                allowDrop = false, pageCount = 4, pageIndex = pageIndex, sortInfo = sortInfo, conditions = conditions
            };;
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("clientPlatform", clientPlatform);
            parameters.Add("viewLite", viewLite);
            parameters.Add("searchInfo", searchInfo);
            string jsonStr   = ToJson.ScriptSerialize(parameters);
            string url       = "Http://61.155.203.29:60214/service.svc/ReadDatasBySearchInfo2";
            string resultStr = HttpCode.Post(url, jsonStr);
            Dictionary <string, object> obj = JsonTo.ScriptDeserialize(resultStr);
            object objvalue = obj["value"];

            if (objvalue == null)
            {
                Model.list = null; Model.count = 0;
            }
            else
            {
                string value = obj["value"].ToString();
                List <Dictionary <string, object> > val = JsonTo.ScriptDeserializeList(value);
                Model.list  = val;
                Model.count = val.Count();
            }


            return(PartialView(Model));
        }
        public void SetReview([NotNull] IMitigation mitigation, [NotNull] ReviewInfo info)
        {
            ReviewInfo result = null;

            var propertyType = GetReviewPropertyType();

            if (propertyType != null)
            {
                var property = mitigation.GetProperty(propertyType) ?? mitigation.AddProperty(propertyType, null);
                if (property is IPropertyJsonSerializableObject jsonSerializableObject)
                {
                    jsonSerializableObject.Value = info;
                }
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 增加评论接口
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddComment(HttpContext context)
        {
            if (!bllUser.IsLogin)
            {
                resp.errcode = (int)APIErrCode.UserIsNotLogin;
                resp.errmsg  = "请先登录";
                return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            }
            else
            {
                currentUserInfo = bllUser.GetCurrentUserInfo();
            }
            string voteObjectId   = context.Request["vote_object_id"];  //选手id
            string commentContent = context.Request["comment_content"]; //评论内容

            if (string.IsNullOrEmpty(voteObjectId))
            {
                resp.errcode = 1;
                resp.errmsg  = "选手id不能为空";
                return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            }
            if (string.IsNullOrEmpty(commentContent))
            {
                resp.errcode = 1;
                resp.errmsg  = "评论内容不能为空";
                return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
            }
            ReviewInfo model = new ReviewInfo();

            model.ReviewType    = "todaybeautify";
            model.ForeignkeyId  = voteObjectId;
            model.Expand1       = currentUserInfo.WXHeadimgurlLocal;
            model.Ex2           = currentUserInfo.WXNickname;
            model.ReviewContent = commentContent;
            model.WebsiteOwner  = bllVote.WebsiteOwner;
            model.InsertDate    = DateTime.Now;
            if (bllVote.Add(model))
            {
                resp.errcode = 0;
                resp.errmsg  = "ok";
            }
            else
            {
                resp.errcode = 1;
                resp.errmsg  = "评论失败";
            }
            return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
Exemplo n.º 29
0
            public override bool Equals(object obj)
            {
                if (obj == null)
                {
                    return(false);
                }

                if (obj.GetType() != this.GetType())
                {
                    return(false);
                }

                ReviewInfo other = (ReviewInfo)obj;

                return(Id.Equals(other.Id) && string.Compare(Uri.AbsoluteUri, other.Uri.AbsoluteUri, true) == 0);
            }
Exemplo n.º 30
0
        /// <summary>
        /// 保存初审信息
        /// </summary>
        /// yaoy    16.08.29
        /// <param name="data"></param>
        /// <returns></returns>
        public bool SaveCreditExamineReportData(string data)
        {
            var result         = true;
            var _review        = new Finance.Review();
            var _finance       = new Finance.Finance();
            var _creditExamine = new Finance.CreditExamineReport();

            JObject jo = (JObject)JsonConvert.DeserializeObject(data);

            StringReader            sr1           = new StringReader(jo["D3"]["CreditExamineReportInfo"].ToString());
            CreditExamineReportInfo creditExamine = (CreditExamineReportInfo)_serializer.Deserialize(new JsonTextReader(sr1), typeof(CreditExamineReportInfo));

            StringReader sr2        = new StringReader(jo["D4"]["ReviewInfo"].ToString());
            ReviewInfo   reviewInfo = (ReviewInfo)_serializer.Deserialize(new JsonTextReader(sr2), typeof(ReviewInfo));

            using (TransactionScope scope = new TransactionScope())
            {
                if (_creditExamine.Get(creditExamine.FinanceId) == null)
                {
                    result &= _creditExamine.Add(creditExamine);
                }
                else
                {
                    result &= _creditExamine.Modify(creditExamine);
                }

                reviewInfo.ReviewType = (byte)ReviewType.初审;

                if (_review.Get(reviewInfo.FinanceId) == null)
                {
                    // 初审添加
                    result &= _review.Add(reviewInfo);
                }
                else
                {
                    // 初审修改
                    result &= _review.Modify(reviewInfo);
                }

                if (result)
                {
                    scope.Complete();
                }
            }

            return(result);
        }
        public void ImportReviewInfoData(ReviewInfo d)
        {
            string filepath = Path.Combine(projectFolder, @"review.import.sqlite.sql");
            string sql      = File.ReadAllText(filepath);

            SQLiteCommand cmd = new SQLiteCommand(sql, m_dbConnection);

            cmd.Parameters.AddWithValue("@docno", d.DocumentNumber);
            cmd.Parameters.AddWithValue("@version", d.DocumentVersion);
            cmd.Parameters.AddWithValue("@review_date", d.ReviewDate);
            cmd.Parameters.AddWithValue("@review_status", d.ReviewStatus);
            cmd.Parameters.AddWithValue("@review_note", d.ReviewNote);
            cmd.Parameters.AddWithValue("@reviewed_by", d.ReviewedBy);

            cmd.ExecuteNonQuery();
            cmd.Dispose();
        }
Exemplo n.º 32
0
    public List<ReviewInfo> GetShowByVenue(string venueName)
    {
        List<ReviewInfo> review = new List<ReviewInfo>();
        var rev = from ve in ste.Shows
                   where ve.Venue.VenueName.Equals(venueName)
                   select new { ve.ShowName, ve.ShowDate, ve.ShowTime };
        foreach (var v in rev)
        {
            ReviewInfo info = new ReviewInfo();
            info.ShowName = v.ShowName;
            info.ShowDate = v.ShowDate.ToString();
            info.ShowTime = v.ShowTime.ToString();
            review.Add(info);
        }

        return review;
    }
Exemplo n.º 33
0
    public List<ReviewInfo> GetShowByArtist(string artistName)
    {
        List<ReviewInfo> review = new List<ReviewInfo>();
        var rev = from s in ste.Shows
                  from sd in ste.ShowDetails
                  from ve in ste.Venues
                  where sd.Artist.ArtistName.Equals(artistName)
                  select new { s.ShowName, s.ShowDate, s.ShowTime, ve.VenueName };
        foreach (var v in rev)
        {
            ReviewInfo info = new ReviewInfo();
            info.ShowName = v.ShowName;
            info.ShowDate = v.ShowDate.ToString();
            info.ShowTime = v.ShowTime.ToString();
            info.VenueName = v.VenueName;
            review.Add(info);

        }

        return review;
    }
Exemplo n.º 34
0
        public bool InsertReviewInfo(ReviewInfo r)
        {
            try
               {

                   if (context.ReviewInfoes.Any(e => (e.ReviewId == r.ReviewId && e.CategoryID == r.CategoryID)))
                   {
                       context.ReviewInfoes.Attach(r);
                       context.ObjectStateManager.ChangeObjectState(r, EntityState.Modified);
                   }
                   else
                   {
                       context.ReviewInfoes.AddObject(r);
                   }

               context.SaveChanges();
               return true;
               }
               catch (Exception ex)
               {

               //Include catch blocks for specific exceptions first,
               //and handle or log the error as appropriate in each.
               //Include a generic catch block like this one last.
               throw ex;
               return false;
               }
        }
Exemplo n.º 35
0
 public CommonStepDefinitions(ReviewInfo reviewInfo, CommonContext contextContext)
     : base(reviewInfo, contextContext)
 {
 }