示例 AnalysisMaps的部分代码

 

运行位置:

http://www.rgbfox.cn/default.aspx

 

效果:

 

http://www.rgbfox.cn/Chart_Map.aspx?userid=1&type=swf

 

复制代码
 public static AnalysisMaps.Model.tb_placeinfo GetPlaceInfo(string ip)
        {
            
string sql = @"(instr('{0}',placename)>0)";
            sql 
= string.Format(sql, GetPlaceByIPAddress(ip));
            Keel.DBHelper
<AnalysisMaps.Model.tb_placeinfo> tpi = new Keel.DBHelper<tb_placeinfo>();
            AnalysisMaps.Model.tb_placeinfo ret 
= tpi.SelectEntity (sql) as AnalysisMaps.Model.tb_placeinfo;
            
return ret;
        }
        
public static AnalysisMaps.Model.tb_placeinfo GetPlaceInfoByName(string name)
        {
            
string sql = @"(instr('{0}',placename)>0)";
            sql 
= string.Format(sql,  name );
            Keel.DBHelper
<AnalysisMaps.Model.tb_placeinfo> tpi = new Keel.DBHelper<tb_placeinfo>();
            AnalysisMaps.Model.tb_placeinfo ret 
= tpi.SelectEntity(sql) as AnalysisMaps.Model.tb_placeinfo;
            
return ret;
        }
        
public static ArrayList GetPlaces()
        {
            Keel.DBHelper
<tb_placeinfo> tpi = new Keel.DBHelper<tb_placeinfo>();
            ArrayList al 
=new ArrayList( tpi.SelectEntitys().ToArray());
            
return al;

        }
        
public static ArrayList GetPlaces(string userid)
        {
            Keel.DBHelper
<AnalysisMaps.Model.tb_placeinfo> tpi = new Keel.DBHelper<tb_placeinfo>();
            ArrayList al 
= new ArrayList(tpi.SelectEntitys(string.Format("placename in (  SELECT  infcity from   tb_usemapinfo  where userid ={0})", userid)));
            
return al;

        }
        
public static void UpdateInfosss(string ip,string userid)
        {
            tb_placeinfo dmt 
= BLL.Query.GetPlaceInfo(ip);
            
if (dmt == null)
            {
                dmt 
= BLL.Query.LookupCiyt(ip);
                
if (dmt == null)
                {
                    
return ;

                }
            }
            
bool isnew = BLL.Query.IsNewAndUpdateVisitInfo(userid, dmt.placename);
        }

        
public static string  GetChatMapInfo(string userid)
        {
            
            
string[] Citys = Properties.Resources.Citys.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            Keel.DBHelper
<AnalysisMaps.Model.tb_usemapinfo> tmi = new Keel.DBHelper<tb_usemapinfo>();
            tb_usemapinfo tu
=new tb_usemapinfo();
            tu.userid 
=int.Parse( userid) ;
            Keel.DBOperator
<Keel.DB.Common> cdbo = new Keel.DBOperator<Keel.DB.Common>();
            
//List<tb_usemapinfo> lt = tmi.SelectEntitys(tu);
            string param = "?Data=";
            
foreach (var item in Citys )
            {
                
int it = 0;
                
string ct;
                
if (item.Contains("("))
                {
                      ct 
= item.Substring(0, item.IndexOf('('));
                    
object o =tmi.ExecuteScalar("  sum(cityvisitcount) "string.Format(" userid={0} and infcity in {1}", tu.userid, item.Substring(item.IndexOf('('))));
                   
int.TryParse(o.ToString (),out it );
                }
                
else
                {
                    ct 
=item.Trim ();
                }
                param 
+= string.Format("{0},{1};", ct, it);

            }
            
return param ;

        }
复制代码

 

posted on   KeelKit  阅读(221)  评论(0编辑  收藏  举报

编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix

导航

< 2009年4月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 1 2
3 4 5 6 7 8 9
点击右上角即可分享
微信分享提示