protected void InsertPageIstatik(long userId, long questionId) { string ip = GetIpAddress(); string browser = Request.Browser.Browser; string http_agent = Request.ServerVariables["HTTP_USER_AGENT"]; string referr = Request.ServerVariables["HTTP_REFERER"]; RepositoryQuestionVisit _repoIst = new RepositoryQuestionVisit("", DbType.SqLite); //bool referanFromAramaMoturu = (referr.Contains("mayestro.net") || referr.Contains("yandex.com") || referr.Contains("gooogle.com") || referr.Contains("yahoo.com") || // referr.Contains("bing.com")); bool referanFromAramaMoturu = (!string.IsNullOrEmpty(referr) || questionId == AnaSayfaId); bool aramaMotoruBot = (!http_agent.Contains("YandexBot") && !http_agent.Contains("bingbot") && !browser.Contains("msnbot") && !browser.Contains("Unknown")); bool beforeConnectWitIp = _repoIst.IsBeforeConnectedWithIp(questionId, DateTime.Today, ip); //bool botControl=(!beforeConnect && (string.IsNullOrEmpty(referr) && referr. ) ); if (referanFromAramaMoturu && aramaMotoruBot && !IsBoot(ip) && !beforeConnectWitIp) { //bool beforeConnect = _repoIst.IsBeforeConnected(ip, DateTime.Today); //if(string.IsNullOrEmpty(referr)) // referr=""; //if (!beforeConnect && referr.Contains("mayestro.net")) //{ // return; //} QuestionVisit ist = new QuestionVisit(); ist.Date = DateTime.Now; ist.IPAddress = GetIpAddress(); ist.QuestionId = questionId; ist.UserId = userId; ist.Referans = Request.ServerVariables["HTTP_REFERER"]; if (string.IsNullOrEmpty(ist.Referans)) { ist.Referans = string.Empty; } _repoIst.Insert(ist); } }
public FrmViewData WithQuestionVisit(QuestionVisit item) { this.QuestionVisit = item; return(this); }