Esempio n. 1
0
    private static void smethod_12(ArrayList arrayList_0, GoodsComment gclass27_0)
    {
        bool flag = false;
        //using (IEnumerator enumerator = arrayList_0.GetEnumerator())
        IEnumerator enumerator = arrayList_0.GetEnumerator();

        {
            while (enumerator.MoveNext())
            {
                GoodsComment current = (GoodsComment)enumerator.Current;
                if (current.string_3.Equals(gclass27_0.string_3))
                {
                    goto Label_0038;
                }
            }
            goto Label_0050;
Label_0038:
            flag = true;
        }
Label_0050:
        if (!flag)
        {
            arrayList_0.Add(gclass27_0);
        }
    }
Esempio n. 2
0
        public ActionResult GoodsDetails(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Goods        goods         = db.Goods.Find(id);
            GoodsComment goodsComments = db.GoodsComment.Find(id);

            if (goods == null)
            {
                return(HttpNotFound());
            }

            var goodsComment = from m in db.GoodsComment.Where(p => p.GID == id).OrderByDescending(p => p.GCTime) select m;
            var goodsReply   = from m in db.GoodsReply.OrderByDescending(r => r.GRTime) select m;
            var index        = new App.Models.GoodsViewModel
            {
                Goods2        = goods,
                GoodsComment  = goodsComments,
                GoodsComment1 = goodsComment,
                GoodsReply1   = goodsReply,
            };

            return(View(index));
        }
        /// <summary>
        /// 添加商品评论
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public IActionResult AddComment(GoodsCommentView model)
        {
            var userId = CurrentUser.Id;

            GoodsComment goodsComment = new GoodsComment()
            {
                Comment    = model.Comment,
                CreateBy   = userId,
                CreateTime = model.CreateTime,
                DescScore  = model.DescScore,
                GoodsId    = model.GoodsId,
                UpdateBy   = userId,
                UpdateTime = model.UpdateTime,
                WlScore    = model.WlScore
            };

            var bo = _goodsCommentRepository.AddComment(goodsComment, model.ImgList);

            if (bo)
            {
                return(JsonOk(""));
            }
            else
            {
                return(JsonError());
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            GoodsComment goodsComment = db.GoodsComment.Find(id);

            db.GoodsComment.Remove(goodsComment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "GoodsCommentID,ComContent,ComImage,Video,ImageOrNot,VideoOrNot,UserID,GoodsID,ComTime,ThumbNum")] GoodsComment goodsComment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(goodsComment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GoodsID = new SelectList(db.Goods, "GoodsID", "Name", goodsComment.GoodsID);
     ViewBag.UserID  = new SelectList(db.Users, "UserID", "Password", goodsComment.UserID);
     return(View(goodsComment));
 }
        // GET: GoodsComments/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GoodsComment goodsComment = db.GoodsComment.Find(id);

            if (goodsComment == null)
            {
                return(HttpNotFound());
            }
            return(View(goodsComment));
        }
        // GET: GoodsComments/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GoodsComment goodsComment = db.GoodsComment.Find(id);

            if (goodsComment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GoodsID = new SelectList(db.Goods, "GoodsID", "Name", goodsComment.GoodsID);
            ViewBag.UserID  = new SelectList(db.Users, "UserID", "Password", goodsComment.UserID);
            return(View(goodsComment));
        }
Esempio n. 8
0
        public void AddGoodsComment(string com, int userid, int goodsid, DateTime datetime, int num)
        {
            //db.GoodsComment.Add(goodscomment);
            //db.SaveChanges();
            var Comment = new GoodsComment()
            {
                ComContent = com,
                UserID     = userid,
                GoodsID    = goodsid,
                ComTime    = datetime,
                ThumbNum   = num
            };

            db.GoodsComment.Add(Comment);
            db.SaveChanges();
        }
Esempio n. 9
0
        public ActionResult Comment(GoodsComment goodsComment)
        {
            string Commenttextarea = Request["Commenttextarea"];
            int    gid             = Convert.ToInt32(Request["gid"]);
            int    UserID          = Convert.ToInt32(Session["UserID"].ToString());
            Users  users           = db.Users.Find(UserID);
            int    id = gid;

            if (ModelState.IsValid)
            {
                goodsComment.GID       = gid;
                goodsComment.UserID    = Convert.ToInt32(Session["UserID"].ToString());
                goodsComment.GCContent = Commenttextarea;
                goodsComment.GCTime    = System.DateTime.Now;
                db.GoodsComment.Add(goodsComment);
                db.SaveChanges();
            }

            return(RedirectToAction("GoodsDetails", "Goods", new { id }));
        }
Esempio n. 10
0
    private static void smethod_11(bool bool_0, ArrayList arrayList_0, string string_1, string string_2)
    {
        // This item is obfuscated and can not be translated.
        string str = StringUtil.subString(string_1, 0, bool_0 ? "\"rateList\":[{\"" : "\"comments\":[{\"", "\"");

        str = "\"" + str + "\":";
        for (int i = 0; (i = string_1.IndexOf(str, i)) != -1; i++)
        {
            string str3;
            int    index = string_1.IndexOf(str, (int)(i + 1));
            if (index == -1)
            {
                index = string_1.Length;
            }
            string str2       = string_1.Substring(i, index - i);
            int    startIndex = 0;
            while (true)
            {
                if (bool_0)
                {
                }
                startIndex = str2.IndexOf("\"rateContent\":\"", startIndex);
                if (startIndex != -1)
                {
                    if (bool_0)
                    {
                        startIndex += 15;
                    }
                    else
                    {
                        startIndex += 11;
                    }
                    int num5 = str2.IndexOf("\",", startIndex);
                    int num6 = str2.IndexOf("\"},", startIndex);
                    int num7 = num5;
                    if ((num7 > num6) && (num6 != -1))
                    {
                        num7 = num6;
                    }
                    str3 = toText(str2.Substring(startIndex, num7 - startIndex));
                    if (!str3.Contains("评价方未及时做出评价") && !str3.Equals("好评!"))
                    {
                        if (str3.Length >= int.Parse(string_2))
                        {
                            break;
                        }
                        startIndex++;
                    }
                }
            }
            string str4 = StringUtil.subString(str2, 0, bool_0 ? "\"id\":" : "\"rateId\":", ",");
            string str5 = StringUtil.subString(str2, 0, bool_0 ? "\"displayUserNick\":\"" : "\"nick\":\"", "\"");
            string str6 = StringUtil.subString(str2, 0, bool_0 ? "\"rateDate\":\"" : "\"date\":\"", "\"");
            if (!bool_0)
            {
                str6 = str6.Replace("年", "-").Replace("月", "-").Replace("日", "") + ":00";
            }
            GoodsComment class2 = new GoodsComment();
            class2.string_0 = str4;
            class2.string_1 = str6;
            class2.string_2 = str5;
            class2.string_3 = str3;
            smethod_12(arrayList_0, class2);
        }
    }