public int?Visit(uint avatar_id, DbLotVisitorType visitor_type, int lot_id) { try { //Stored procedure will handle erroring any active visits that should no longer be active return(Context.Connection.Query <int>("SELECT `fso_lot_visits_create`(@avatar_id, @lot_id, @type)", new { avatar_id = avatar_id, lot_id = lot_id, type = visitor_type.ToString() }).First()); }catch (Exception ex) { return(null); } }
public void RecordStartVisit(IVoltronSession session, DbLotVisitorType visitorType) { if (Context.JobLot) { return; } using (var da = DAFactory.Get) { var id = da.LotVisits.Visit(session.AvatarId, visitorType, Context.DbId); if (id != null && id.HasValue) { session.SetAttribute("visitId", id.Value); } } }