private void timAff_Tick(object sender, EventArgs e) { if (Main.hoverShop != null && (lastShopHover == null || lastShopHover.id != Main.hoverShop.id)) { lastShopHover = Main.hoverShop; flowReviewShop.Controls.Clear(); List <clReview> r = Main.hoverShop.getReviews().OrderBy(X => X.user.name).ToList(); foreach (var item in r) { ucReview ucR = new ucReview(); flowReviewShop.Controls.Add(ucR); ucR.init(item, false, true); } } if (Main.hoverUser != null && (lastUserHover == null || lastUserHover.id != Main.hoverUser.id)) { lastUserHover = Main.hoverUser; flowReviews.Controls.Clear(); List <clReview> r = Main.hoverUser.getReviews().OrderBy(X => X.shop.name).ToList(); foreach (var item in r) { ucReview ucR = new ucReview(); flowReviews.Controls.Add(ucR); ucR.init(item, true, false); } } }
private void butPastUrl_Click(object sender, EventArgs e) { txtURL.Text = Clipboard.GetText(); chromeBrowser.Load(txtURL.Text); clUser c = Main.data.users.Find(X => X.contrib == Main.findContrib(txtURL.Text)); butProcess.Visible = c == null; butSave.Visible = c == null; }
internal clAffinity(clUser u1, clUser u2) { this.u1 = u1; this.u2 = u2; List <clReview> r1 = u1.getReviews(); List <clReview> r2 = u2.getReviews(); foreach (var item in r1) { if (r2.Find(X => X.idShop == item.idShop) != null) { score++; } } }
internal void update(clUser newUser = null) { if (newUser != null) { user = newUser; } if (user == null) { return; } lblName.Text = user.name; lblLevel.Text = user.percentFake.ToString("0"); lblNbRating.Text = user.nbRating.ToString(); lblNbReview.Text = user.nbReview.ToString(); lblPoints.Text = user.points.ToString(); lblName.BackColor = user.fakeForSure ? Color.LightGreen : SystemColors.Control; }
internal void init() { user = Main.data.getUserById(idUser); shop = Main.data.getShopById(idShop); }
public clReview(string in_date, clUser in_user, clShop in_shop) { try { in_date = in_date.Replace("★★★★★", "").Trim(); if (in_date.EndsWith("months ago")) { in_date = in_date.Replace("months ago", "").Trim(); date = DateTime.Now.AddMonths(-int.Parse(in_date)); } else if (in_date.EndsWith("weeks ago")) { in_date = in_date.Replace("weeks ago", "").Trim(); date = DateTime.Now.AddDays(-int.Parse(in_date) * 7); } else if (in_date.EndsWith("days ago")) { in_date = in_date.Replace("days ago", "").Trim(); date = DateTime.Now.AddDays(-int.Parse(in_date)); } else if (in_date.EndsWith("hours ago")) { in_date = in_date.Replace("hours ago", "").Trim(); date = DateTime.Now.AddHours(-int.Parse(in_date)); } else if (in_date.EndsWith("years ago")) { in_date = in_date.Replace("years ago", "").Trim(); date = DateTime.Now.AddDays(-int.Parse(in_date) * 360); } else if (in_date.Contains("a week ago")) { date = DateTime.Now.AddDays(-5); } else if (in_date.Contains("a month ago")) { date = DateTime.Now.AddDays(-30); } else if (in_date.Contains("a year ago")) { date = DateTime.Now.AddDays(-365); } else if (in_date.Contains("a day ago")) { date = DateTime.Now.AddDays(-1); } else { return; } user = in_user; shop = in_shop; idShop = shop.id; idUser = user.id; rating = 5; loadOK = true; } catch (Exception ex) { Main.lastText = ex.Message; } }