public DefaultMaster() { this._categoryRT = new CategoryRT(); this._userInformationRT = new UserInformationRT(); this._visitorCounterRT = new VisitorCounterRT(); this._visitorCounter = new VisitorCounter(); }
/// <summary> /// Delete /// </summary> /// <param name="visitorCounter"></param> public void Delete(VisitorCounter visitorCounter) { if (visitorCounter == null) { throw new ArgumentNullException(nameof(visitorCounter)); } _vistorCounteRepository.Delete(visitorCounter); _eventPublisher.EntityDeleted(visitorCounter); }
public void UpdateVisitorCounter(VisitorCounter visitorCounter) { try { VisitorCounter objVisitor = _OiiOMartDBDataContext.VisitorCounters.SingleOrDefault(d => d.IID == visitorCounter.IID); DatabaseHelper.Update <VisitorCounter>(_OiiOMartDBDataContext, visitorCounter, objVisitor); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void AddVisitorCounter(VisitorCounter visitorCounter) { try { DatabaseHelper.Insert <VisitorCounter>(visitorCounter); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void DeleteVisitorCounterByIID(long Id) { try { VisitorCounter objVisitor = _OiiOMartDBDataContext.VisitorCounters.SingleOrDefault(x => x.IID == Id); DatabaseHelper.Delete(_OiiOMartDBDataContext, objVisitor); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext) { // www-form try { ContentTransform(ref request); } catch (Exception ex) { LogHelper.Info(ex.Message + ex.StackTrace); } if (DEBUG) { QZ.RealTimeRequestLogService.RequestLog log = LogInccomingRequest(request); return(log); } var res = Util.Get_RemoteIp().ToMaybe().Do(ip => counter.AddRec(ip)) .Select <VisitorCounter.IpInfo, string>( ip => counter.GetIpInfo(ip, false).ToMaybe(), (ip, info) => { if (counter.IsMechineIpInfo(info)) { counter.AddRecCount(ip, 0x1000); } if (!counter.IsIpAuthorized(ip)) { if (VisitorCounter.GetReqPath().ToLower() == "orgcompany/branch/select/page") { throw new WebFaultException <string>(string.Format("{0} Unauthorized!", ip), System.Net.HttpStatusCode.Unauthorized); } } return(string.Empty); } ); return(null); }
protected void Page_Load(object sender, EventArgs e) { if (AccessControl.IsLoggedIn(this.Page)) { user = "******" + AccessControl.GetLoggedUser(this.Page); // all the buttons are invisible at first logoutButton.Visible = true; updateButton.Visible = true; galleryButton.Visible = true; } else { loginButton.Visible = true; registrationButton.Visible = true; } if (AccessControl.IsAdmin(this.Page)) { adminButton.Visible = true; } VisitorCounter.LogPageLoad(this.Page); }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { using (var db = new ApplicationDbContext()) { string controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToUpper(); ViewBag.CurrentController = controller; var vendors = db.Vendors //.Where(x => x.IsPublish.HasValue && x.IsPublish.Value) .OrderBy(x => x.OrderNo) .ToList(); ViewBag.Vendors = vendors; var cofig = db.ConfigSettings.FirstOrDefault(); if (cofig == null) { cofig = new ConfigSetting(); } ViewBag.ConfigSetting = cofig; var productCategories = db.ProductCategories.ToList(); ViewBag.ProductCategories = productCategories; var visitorCounter = db.VisitorCounters.FirstOrDefault(); if (visitorCounter == null) { visitorCounter = new VisitorCounter(); } ViewBag.VisitorCounter = visitorCounter; var plugins = db.Plugins .Where(x => x.Show) .OrderBy(x => x.OrderNo) .ToList(); ViewBag.Plugins = plugins; } }
// This will load after MasterPage.On_Load() protected override void OnLoadComplete(EventArgs e) { visitors = VisitorCounter.GetCount(this); base.OnLoadComplete(e); }
public VisitorCounterController(VisitorCounter visitorCounter) { _visitorCounter = visitorCounter; }
static VisitorStatisticHandler() { counter = new VisitorCounter(null); DEBUG = System.Configuration.ConfigurationManager.AppSettings["Debug"].ToLower() == "true"; }
public override string ToString() { return(Year.ToString() + "\t" + HomeWinCounter.ToString() + "\t" + VisitorCounter.ToString() + "\t" + ((int)(HomeWinPercentage * 100)).ToString()); }