Ejemplo n.º 1
0
        //[WebInvoke(UriTemplate = "GetStreetInArea2", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
        //public IList<Area_V> GetStreetInArea2(Area_V param)
        //{
        //__AjaxDataService ajaxDateService = new __AjaxDataService();

        //IList<Area_V> user_areas2 = ajaxDateService.GetAreasAsParent();//取sysdictionaryItem所有区域
        //IList<Area> user_areas4 = ajaxDateService.GetArea();//取pub_area所有区域
        //IList<DictItem> user_areas5 = ajaxDateService.GetCityAndAreaInProvince("00012");//取sysdictionaryItem相关区域
        //IList<string> user_areas = ajaxDateService.GetUserArea(NormalSession.UserId);
        //IList<DictItemEx> user_areas3 = ajaxDateService.GetStreetAndCommunityInArea(user_areas[0]);//取pub_area相关区域

        //IList<Area_V> streetData = BuilderFactory.DefaultBulder().List<Area_V>(new Area_V { ParentId = AreaId ,Status=1,Levels=4});
        //IList<Area_V> result = new List<Area_V> { };
        //try
        //{
        //    StringObjectDictionary filters = new StringObjectDictionary();
        //    if (param.instance != null)
        //    {
        //        filters = param.instance.ToStringObjectDictionary(false);
        //    }

        //    gridCollectionPager.EasyUIgridDoPage<Area_V>(BuilderFactory.DefaultBulder().List<Area_V>(filters), param, ref result);
        //}
        //catch (Exception ex)
        //{
        //    result.Success = false;
        //    result.ErrorMessage = ex.Message;
        //}
        //return result;
        //}

        #region --私有方法--
        private int _GetTerminalCount(string areaId)
        {
            int    count   = 0;
            string str_sql = "select CallNo from oca_oldmanbaseinfo a inner join oca_oldmanconfiginfo b on a.OldManId=b.OldManId and callno is not null";
            Area_V areaObj = BuilderFactory.DefaultBulder(GlobalManager.getConnectString()).Load <Area_V, Area_VPK>(new Area_VPK {
                AreaId = areaId
            });

            if (areaObj.Levels == 3)//区县
            {
                str_sql += string.Format(" where AreaId='{0}'", areaId);
            }
            else if (areaObj.Levels == 4)//街道
            {
                str_sql += string.Format(" where AreaId2='{0}'", areaId);
            }
            else if (areaObj.Levels == 5)//社区
            {
                str_sql += string.Format(" where AreaId3='{0}'", areaId);
            }
            else
            {
                return(count);//根据oca_oldmanbaseinfo只能查这三级
            }
            count = BuilderFactory.DefaultBulder(GlobalManager.getConnectString()).ExecuteNativeSqlForCount(str_sql);
            return(count);
        }
Ejemplo n.º 2
0
        public string GetAreaName(string areaId)
        {
            Area_V area = BuilderFactory.DefaultBulder(GlobalManager.getConnectString()).Load <Area_V, Area_VPK>(new Area_VPK {
                AreaId = areaId
            });

            if (area.AreaId != null)
            {
                return(area.AreaName);
            }
            return("");
        }