Пример #1
0
        public string  GetModelList2(string ParentId, string RoleID)
        {
            if (ParentId == null)
            {
                ParentId = "0";
            }
            EntityProviderOP <EAP_Resource> _op = new EntityProviderOP <EAP_Resource>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("EAP_MOUDLE");

            _search["parentid"] = ParentId;

            SearchResult <EAP_Resource> _rs = _op.Search(_search);

            // var  list = m_BLL.GetListByParentId(id);

            List <TreeBase> _ls = new List <TreeBase>();

            foreach (EAP_Resource r in _rs.Items)
            {
                TreeBase c = new TreeBase();
                c.id      = r.ID;
                c.text    = r.Name;
                c.ischeck = r.Checked;
                c.state   = (r.HasChild_G == 1) ? "closed" : "open";
                _ls.Add(c);
            }
            string mm = Newtonsoft.Json.JsonConvert.SerializeObject(_ls);

            // string  Newtonsoft.Json.JsonConvert
            // JsonResult  jr=  Json(_ls, JsonRequestBehavior.AllowGet);

            return(mm);
        }
Пример #2
0
 //[Dependency]
 //public static ISysLogBLL logBLL { get; set; }
 /// <summary>
 /// 写入日志
 /// </summary>
 /// <param name="oper">操作人</param>
 /// <param name="mes">操作信息</param>
 /// <param name="result">结果</param>
 /// <param name="type">类型</param>
 /// <param name="module">操作模块</param>
 public static void WriteServiceLog(string oper, string mes, string result, string type, string module)
 {
     App.Models.Sys.siteconfig siteConfig = new App.BLL.SysConfigBLL().loadConfig(Utils.GetXmlMapPath("Configpath"));
     //后台管理日志开启
     if (siteConfig.logstatus == 1)
     {
         APP_Log o = new APP_Log();
         o.Message    = mes;
         o.LOGTYPE    = type;
         o.ModuleName = module;
         o.OPERATOR   = oper;
         o.LOGRESULT  = result;
         EntityProviderOP <APP_Log> _op = new EntityProviderOP <APP_Log>(null, DataProvider.GetEAP_Provider());
         int k = _op.Save(o);
         // UtilOP op=new UtilOP()
         //ValidationErrors errors = new ValidationErrors();
         //SysLog entity = new SysLog();
         //entity.Id = ResultHelper.NewId;
         //entity.Operator = oper;
         //entity.Message = mes;
         //entity.Result = result;
         //entity.Type = type;
         //entity.Module = module;
         //entity.CreateTime = ResultHelper.NowTime;
         //using (SysLogRepository logRepository = new SysLogRepository())
         //{
         //    logRepository.Create(entity);
         //}
     }
     else
     {
         return;
     }
 }
Пример #3
0
        public List <Gmeta> GetLayerID(List <Gmeta> gmeta)
        {
            List <servicClassD> list               = new List <servicClassD>();
            LoginInfo           _login             = (LoginInfo)(Session["loginuser"]);
            EntityProviderOP <gis_layerDefine> _op = new EntityProviderOP <gis_layerDefine>(_login, DataProvider.GetEAP_Provider());

            SearchCriteria _searchBase = new SearchCriteria("GIS_LAYERDEFINE");

            _searchBase.PageSize = -1;

            SearchResult <gis_layerDefine> _rs = _op.Search(_searchBase);

            for (int i = 0; i < gmeta.Count; i++)
            {
                foreach (gis_layerDefine d in _rs.Items)
                {
                    if (gmeta[i].layername == d.LAYERCODE)
                    {
                        gmeta[i].layername = d.ID.ToString();
                        break;
                    }
                }
            }
            return(gmeta);
        }
Пример #4
0
        public JsonResult GetTreeStruct()
        {
            EntityProviderOP <EAP_Org> _op     = new EntityProviderOP <EAP_Org>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria             _search = new SearchCriteria("EAP_ORG");

            SearchResult <EAP_Org> _rs = _op.Search(_search);


            List <TreeBase> _ls = BuildTree <EAP_Org>(_rs.Items);

            return(Json(_ls, JsonRequestBehavior.AllowGet));;
        }
Пример #5
0
        public JsonResult GetList(GridPager pager, string queryStr)
        {
            EntityProviderOP <EAP_User> _op = new EntityProviderOP <EAP_User>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search          = new SearchCriteria("EAP_USER");

            ToSearchCriteria(pager, ref _search);
            _search["TrueName"] = queryStr;

            SearchResult <EAP_User> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json, JsonRequestBehavior.AllowGet));

            /*
             * List<SysUserModel> list = userBLL.GetList(ref pager, queryStr);
             * var json = new
             * {
             *  total = pager.totalRows,
             *  rows = (from r in list
             *          select new SysUserModel()
             *          {
             *
             *              Id=r.Id,
             *              UserName=r.UserName,
             *              TrueName=r.TrueName,
             *              MobileNumber=r.MobileNumber,
             *              PhoneNumber=r.PhoneNumber,
             *              QQ=r.QQ,
             *              EmailAddress=r.EmailAddress,
             *              OtherContact=r.OtherContact,
             *              Province=r.Province,
             *              City=r.City,
             *              Village=r.Village,
             *              Address=r.Address,
             *              State=r.State,
             *              CreateTime=r.CreateTime,
             *              CreatePerson=r.CreatePerson.ToString(),
             *              RoleName=r.RoleName
             *
             *          }).ToArray()
             *
             * };
             * return Json(json, JsonRequestBehavior.AllowGet);
             * */
        }
Пример #6
0
        public string inserintolayer(string logininfo, List <Glayer> layers)
        {
            LoginInfo _login = (LoginInfo)(Session["loginuser"]);

            if (_login == null)
            {
                _login = LoginInfo.Parse <LoginInfo>(logininfo);
            }
            if (_login != null)
            {
                EntityProviderOP <gis_layerDefine> _op = new EntityProviderOP <gis_layerDefine>(_login, DataProvider.GetEAP_Provider());
                try
                {
                    foreach (Glayer g in layers)
                    {
                        gis_layerDefine l       = null;
                        SearchCriteria  _search = new SearchCriteria("GIS_LAYERDEFINE");
                        //LAYERCODENEW是精确查询
                        _search["LAYERCODENEW"] = g.ename;
                        SearchResult <gis_layerDefine> _rs = _op.Search(_search);
                        //有则修改,没有新增
                        if (_rs.Items.Count > 0)
                        {
                            l        = _rs.Items[0];
                            l.EDITBY = _login.User.UserName;
                        }
                        else
                        {
                            l       = new gis_layerDefine();
                            l.ADDBY = _login.User.UserName;
                        }
                        l.LAYERCODE = g.ename;
                        l.LAYERNAME = g.cname;
                        int _dt = 0;
                        int.TryParse(g.datatype, out _dt);
                        l.DATATYPE = _dt;
                        int _st = 0;
                        int.TryParse(g.shptype, out _st);
                        l.SHPTYPE = _st;
                        int k = _op.Save(l);
                    }

                    return("1");
                }
                catch (Exception ee)
                {
                    return("0");
                }
            }
            return("0");
        }
Пример #7
0
        public string inserintometa(string logininfo, List <Gmeta> gmeta)
        {
            List <Gmeta> gmetanew = GetLayerID(gmeta);

            LoginInfo _login = (LoginInfo)(Session["loginuser"]);

            if (_login == null)
            {
                _login = LoginInfo.Parse <LoginInfo>(logininfo);
            }
            if (_login != null)
            {
                EntityProviderOP <gis_layerdefine_sub> _op = new EntityProviderOP <gis_layerdefine_sub>(_login, DataProvider.GetEAP_Provider());
                try
                {
                    foreach (Gmeta g in gmetanew)
                    {
                        gis_layerdefine_sub l       = new gis_layerdefine_sub();
                        SearchCriteria      _search = new SearchCriteria("GIS_LAYERDEFINE_SUB");
                        ////LAYERCODENEW是精确查询
                        _search["LAYERID"]  = g.layername;// 说明:此处layername 实际存储了layerid
                        _search["PROPNAME"] = g.propname;
                        SearchResult <gis_layerdefine_sub> _rs = _op.Search(_search);
                        ////有则修改,没有新增
                        if (_rs.Items.Count > 0)
                        {
                            l = _rs.Items[0];
                            // l.EDITBY = _login.User.UserName;
                        }
                        else
                        {
                            l = new gis_layerdefine_sub();
                            // l.ADDBY = _login.User.UserName;
                        }
                        l.PROPNAME  = g.propname;
                        l.PROPVALUE = g.propvalue;
                        l.LAYERID   = g.layername;

                        int k = _op.Save(l);
                    }

                    return("1");
                }
                catch (Exception ee)
                {
                    return("0");
                }
            }
            return("0");
        }
Пример #8
0
        public JsonResult getlayerSubList(GridPager pager, string id)
        {
            ViewBag.Perm = GetPermission();
            EntityProviderOP <gis_layerdefine_sub> _op = new EntityProviderOP <gis_layerdefine_sub>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("GIS_LAYERDEFINE_SUB");

            ToSearchCriteria(pager, ref _search);
            _search["LAYERID"] = id;

            SearchResult <gis_layerdefine_sub> _rs = _op.Search(_search);
            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #9
0
        public JsonResult GetRoleList(GridPager pager)
        {
            EntityProviderOP <EAP_Role> _op = new EntityProviderOP <EAP_Role>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search          = new SearchCriteria("EAP_ROLE");

            ToSearchCriteria(pager, ref _search);
            // _search["RoleName"] = queryStr;

            SearchResult <EAP_Role> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #10
0
        public JsonResult GetList(GridPager pager, string queryStr)
        {
            EntityProviderOP <EAP_Role> _op = new EntityProviderOP <EAP_Role>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search          = new SearchCriteria("EAP_ROLE");

            ToSearchCriteria(pager, ref _search);
            _search["RoleName"] = queryStr;

            SearchResult <EAP_Role> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
            // ToGrigPagerCount(_rs.TotalCount ,ref pager);


            /*
             * List<SysRoleModel> _list = new List<SysRoleModel>();// m_BLL.GetList(ref pager, queryStr);
             *
             * foreach (EAP_Role r in _rs.Items)
             * {
             *  SysRoleModel _o = new SysRoleModel()
             *          {
             *              Id = r.ID.ToString(),
             *              Name = r.RoleName,
             *              Description = r.Description,
             *              CreateTime = r.AddOn,
             *              CreatePerson = r.AddBy
             *          };
             *  foreach (EAP_User u in  r.Users)
             *  {
             *      _o.UserName = _o.UserName + "【" + u.UserName + "】";
             *  }
             *  _list.Add(_o);
             *
             * }
             */
        }
Пример #11
0
        public JsonResult GetDetailList(GridPager pager, string classID)
        {
            EntityProviderOP <gis_LayerClassD> _op = new EntityProviderOP <gis_LayerClassD>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("GIS_LAYERCLASSD");

            ToSearchCriteria(pager, ref _search);
            _search["CLASSID"] = classID;

            SearchResult <gis_LayerClassD> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #12
0
        public JsonResult GetList(GridPager pager, string queryStr)
        {
            EntityProviderOP <gis_layerclass> _op = new EntityProviderOP <gis_layerclass>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("GIS_LAYERCLASS");

            ToSearchCriteria(pager, ref _search);
            _search["CLASSNAME"] = queryStr;

            SearchResult <gis_layerclass> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #13
0
        public JsonResult GetLoginList(GridPager pager, string queryStr)
        {
            EntityProviderOP <APP_Login> _op = new EntityProviderOP <APP_Login>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search           = new SearchCriteria("APP_LOGIN");

            ToSearchCriteria(pager, ref _search);
            _search["USERNAME"] = queryStr;

            SearchResult <APP_Login> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #14
0
        public JsonResult GetLayerList(GridPager pager, string ClassId, string queryStr)
        {
            EntityProviderOP <gis_layerDefine> _op = new EntityProviderOP <gis_layerDefine>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("GIS_LAYERDEFINE");

            ToSearchCriteria(pager, ref _search);
            _search["LAYERNAME"] = queryStr;

            SearchResult <gis_layerDefine> _rs = _op.Search(_search);



            EntityProviderOP <gis_LayerClassD> _detailop = new EntityProviderOP <gis_LayerClassD>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _Detailsearch = new SearchCriteria("GIS_LAYERCLASSD");

            _Detailsearch.PageSize   = -1;
            _Detailsearch["CLASSID"] = ClassId;

            SearchResult <gis_LayerClassD> _Deatilrs = _detailop.Search(_Detailsearch);

            //设置图层的选中状态;
            if (_Deatilrs.Items.Count > 0)
            {
                foreach (gis_LayerClassD o in _Deatilrs.Items)
                {
                    gis_layerDefine obj = _rs.Items.Find((m) => { return(m.ID == o.LAYERID); });

                    if (obj != null)
                    {
                        obj.IsCheck_G = (obj.ID == o.LAYERID);
                    }
                }
            }

            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #15
0
        public List <Glayer> GetLayerList(string logininfo, string layername = "")
        {
            LoginInfo _login = (LoginInfo)(Session["loginuser"]);

            if (_login == null)
            {
                _login = LoginInfo.Parse <LoginInfo>(logininfo);
            }
            if (_login != null)
            {
                EntityProviderOP <gis_layerDefine> _op = new EntityProviderOP <gis_layerDefine>(_login, DataProvider.GetEAP_Provider());
                SearchCriteria _search = new SearchCriteria("GIS_LAYERDEFINE");
                if (string.IsNullOrEmpty(layername))
                {
                    //不指定条件,只返回50条记录
                    _search.PageSize  = 50;
                    _search.PageIndex = 0;
                }
                else
                {
                    _search.PageSize = -1;
                    //LAYERCODE是模糊查询
                    _search["LAYERCODE"] = layername;
                }



                SearchResult <gis_layerDefine> _rs = _op.Search(_search);

                List <Glayer> mm = new List <Glayer>();
                foreach (gis_layerDefine d in _rs.Items)
                {
                    mm.Add(new Glayer()
                    {
                        ename = d.LAYERCODE, cname = d.LAYERNAME, datatype = d.DATATYPE.ToString(),
                    });
                }
                return(mm);
            }
            return(null);
        }
Пример #16
0
        public JsonResult GetRoleList(GridPager pager)
        {
            EntityProviderOP <EAP_Role> _op = new EntityProviderOP <EAP_Role>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search          = new SearchCriteria("EAP_ROLE");

            ToSearchCriteria(pager, ref _search);
            // _search["RoleName"] = queryStr;

            SearchResult <EAP_Role> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));

            /*
             * List<SysRoleModel> list = sysRoleBLL.GetList(ref pager, "");
             * var json = new
             * {
             *  total = pager.totalRows,
             *  rows = (from r in list
             *          select new SysRoleModel()
             *          {
             *
             *              Id = r.Id,
             *              Name = r.Name,
             *              Description = r.Description,
             *              CreateTime = r.CreateTime,
             *              CreatePerson = r.CreatePerson
             *
             *          }).ToArray()
             *
             * };
             *
             * return Json(json);
             */
        }
Пример #17
0
        public JsonResult getColsList(GridPager pager, string id)
        {
            ViewBag.Perm = GetPermission();
            EntityProviderOP <gis_layerVersionCol> _op = new EntityProviderOP <gis_layerVersionCol>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("GIS_LAYERVERSIONCOL");

            ToSearchCriteria(pager, ref _search);
            _search["LayerID"] = id;

            SearchResult <gis_layerVersionCol> _rs = _op.Search(_search);


            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
            //SysRoleModel entity = m_BLL.GetById(id);
        }
Пример #18
0
        public JsonResult GetLayerListByClass(GridPager pager, string clsid)
        {
            EntityProviderOP <gis_LayerClassD> _op = new EntityProviderOP <gis_LayerClassD>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("GIS_LAYERCLASSD");

            ToSearchCriteria(pager, ref _search);
            _search["CLASSID"] = clsid;
            SearchResult <gis_LayerClassD> _rs = _op.Search(_search);

            if (string.IsNullOrEmpty(clsid))
            {
                return(null);
            }
            var json = new
            {
                total = _rs.TotalCount,
                rows  = _rs.Items.ToArray()
            };

            return(Json(json));
        }
Пример #19
0
        public JsonResult GetOptListByModule(GridPager pager, string mid)
        {
            if (string.IsNullOrEmpty(mid))
            {
                mid = "0";
            }


            EntityProviderOP <EAP_Resource> _op = new EntityProviderOP <EAP_Resource>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("EAP_RESOURCEOP");

            _search["parentid"] = mid;

            SearchResult <EAP_Resource> _rs = _op.Search(_search);

            List <SysModuleOperateModel> ls = new List <SysModuleOperateModel>();

            foreach (EAP_Resource r in _rs.Items)
            {
                SysModuleOperateModel _m = new SysModuleOperateModel()
                {
                    Id       = r.ID.ToString(),
                    KeyCode  = r.PageId,
                    Name     = r.Name,
                    ModuleId = r.ParentId.ToString(),
                    Sort     = r.SortBy,
                    IsValid  = !r.Flag_Delete
                };
                ls.Add(_m);
            }


            var json = new
            {
                total = ls.Count,
                rows  = ls.ToArray()
            };

            return(Json(json));
        }
Пример #20
0
        public T GetObjByID <T>(string Id, string SearchID = "", string KeyField = "ID") where T : EntityBase
        {
            if (string.IsNullOrEmpty(SearchID))
            {
                Type t = typeof(T);
                SearchID = t.Name.ToUpper();
            }

            EntityProviderOP <T> _op = new EntityProviderOP <T>(LoginUser, DataProvider.GetEAP_Provider());

            SearchCriteria _search = new SearchCriteria(SearchID);

            _search[KeyField] = int.Parse(Id);

            SearchResult <T> _rs = _op.Search(_search);

            if (_rs.Items.Count > 0)
            {
                return(_rs.Items[0]);
            }
            return(null);
        }
Пример #21
0
        public CommandResult SaveObj <T>(T obj) where T : EntityBase
        {
            CommandResult r = new CommandResult();

            try
            {
                if (obj.ID > 0)
                {
                    obj._S = obj.S = EntityStatus.Modified;
                }
                else
                {
                    obj._S = obj.S = EntityStatus.New;
                }
                EntityProviderOP <T> _op = new EntityProviderOP <T>(LoginUser, DataProvider.GetEAP_Provider());
                r.IntResult = _op.Save(obj);
            }
            catch (Exception ee)
            {
                r.Message = ee.Message;
            }
            return(r);
        }
Пример #22
0
        public JsonResult GetGridList(string id)
        {
            if (id == null)
            {
                id = "0";
            }

            EntityProviderOP <EAP_Org> _op     = new EntityProviderOP <EAP_Org>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria             _search = new SearchCriteria("EAP_ORG");

            _search["parentid"] = id;

            SearchResult <EAP_Org> _rs = _op.Search(_search);

            // var  list = m_BLL.GetListByParentId(id);

            var json = new List <SysStructModel>();

            foreach (EAP_Org r in _rs.Items)
            {
                SysStructModel _m = new SysStructModel()
                {
                    Id         = r.ID.ToString(),
                    Code       = r.Code,
                    Name       = r.Name,
                    ParentId   = r.ParentID.ToString(),
                    Sort       = r.SortBy,
                    Enable     = (r.Status == 1),
                    Remark     = r.Remark,
                    CreateTime = r.AddOn,
                    state      = (r.HasChild_G == 1) ? "closed" : "open"
                };
                json.Add(_m);
            }

            return(Json(json));
        }
Пример #23
0
        public JsonResult GetList(string id)
        {
            if (id == null)
            {
                id = "0";
            }
            EntityProviderOP <EAP_Area2> _op = new EntityProviderOP <EAP_Area2>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search           = new SearchCriteria("EAP_AREA");

            _search["PCODE"] = id;

            SearchResult <EAP_Area2> _rs = _op.Search(_search);

            foreach (EAP_Area2 _o in _rs.Items)
            {
                _o.state = (_o.HasChild_G > 0) ? "closed" : "open";
            }
            //List<SysAreasModel> list = null;// m_BLL.GetList(id);
            //var json = from r in list
            //           select new SysAreasModel()
            //           {
            //               Id = r.Id,
            //            Name = r.Name,
            //            ParentId = r.ParentId,
            //            Sort = r.Sort,
            //            Enable = r.Enable,
            //            IsMunicipality = r.IsMunicipality,
            //            IsHKMT = r.IsHKMT,
            //            IsOther = r.IsOther,
            //               CreateTime = r.CreateTime,
            //              // state = (m_BLL.GetList(r.Id).Count > 0) ? "closed" : "open"
            //           };


            return(Json(_rs.Items.ToArray()));
        }
Пример #24
0
        public JsonResult GetModelList(string id)
        {
            if (id == null)
            {
                id = "0";
            }
            EntityProviderOP <EAP_Resource> _op = new EntityProviderOP <EAP_Resource>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("EAP_MOUDLE");

            _search["parentid"] = id;

            SearchResult <EAP_Resource> _rs = _op.Search(_search);

            // var  list = m_BLL.GetListByParentId(id);

            var json = new List <SysModuleModel>();

            foreach (EAP_Resource r in _rs.Items)
            {
                SysModuleModel _m = new SysModuleModel()
                {
                    Id         = r.ID.ToString(),
                    Url        = r.PageId,
                    Name       = r.Name,
                    ParentId   = r.ParentId.ToString(),
                    Sort       = r.SortBy,
                    Enable     = !r.Flag_Delete,
                    CreateTime = r.AddOn,
                    IsLast     = (r.HasChild_G == 0),
                    state      = (r.HasChild_G == 1) ? "closed" : "open"
                };
                json.Add(_m);
            }

            return(Json(json));
        }
Пример #25
0
        public string inserintolayerCol(string logininfo, string layername, List <Glayercol> layerCols)
        {
            LoginInfo _login = (LoginInfo)(Session["loginuser"]);

            if (_login == null)
            {
                _login = LoginInfo.Parse <LoginInfo>(logininfo);
            }
            if (_login != null)
            {
                try
                {
                    EntityProviderOP <gis_layerDefine> _oplayer = new EntityProviderOP <gis_layerDefine>(_login, DataProvider.GetEAP_Provider());

                    gis_layerDefine l            = null;
                    SearchCriteria  _searchalyer = new SearchCriteria("GIS_LAYERDEFINE");
                    //LAYERCODENEW是精确查询
                    _searchalyer["LAYERCODENEW"] = layername;
                    SearchResult <gis_layerDefine> _rslayer = _oplayer.Search(_searchalyer);
                    if (_rslayer.Items.Count > 0)
                    {
                        l = _rslayer.Items[0];
                    }
                    else
                    {
                        return("01");
                    }


                    EntityProviderOP <gis_layerVersionCol> _op = new EntityProviderOP <gis_layerVersionCol>(_login, DataProvider.GetEAP_Provider());
                    int _ordernum = 0;
                    foreach (Glayercol g in layerCols)
                    {
                        _ordernum = _ordernum + 1;
                        gis_layerVersionCol col = null;

                        SearchCriteria _search = new SearchCriteria("GIS_LAYERVERSIONCOL");
                        _search["LAYERID"] = l.ID;
                        _search["COLCODE"] = g.colename;
                        SearchResult <gis_layerVersionCol> _rs = _op.Search(_search);
                        //有则修改,没有新增
                        if (_rs.Items.Count > 0)
                        {
                            col        = _rs.Items[0];
                            col.EDITBY = _login.User.UserName;
                        }
                        else
                        {
                            col         = new gis_layerVersionCol();
                            col.ADDBY   = _login.User.UserName;
                            col.LayerID = l.ID;
                        }
                        col.COLCODE = g.colename;
                        col.COLNAME = g.colcname;

                        col.COLTYPE  = g.coltype.ToString();
                        col.ColLen   = g.colLen;
                        col.ColXSLen = g.colXSLen;
                        col.ODERNUM  = _ordernum;

                        int k = _op.Save(col);
                    }

                    return("1");
                }
                catch (Exception ee)
                {
                    return("02");
                }
            }
            return("03");
        }
Пример #26
0
        public JsonResult GetList(string id)
        {
            if (id == null)
            {
                id = "0";
            }


            EntityProviderOP <EAP_Resource> _op = new EntityProviderOP <EAP_Resource>(LoginUser, DataProvider.GetEAP_Provider());
            SearchCriteria _search = new SearchCriteria("EAP_MOUDLE");

            _search["parentid"] = id;

            SearchResult <EAP_Resource> _rs = _op.Search(_search);

            // var  list = m_BLL.GetListByParentId(id);

            var json = new List <SysModuleModel>();

            foreach (EAP_Resource r in _rs.Items)
            {
                SysModuleModel _m = new SysModuleModel()
                {
                    Id         = r.ID.ToString(),
                    Url        = r.PageId,
                    Name       = r.Name,
                    ParentId   = r.ParentId.ToString(),
                    Sort       = r.SortBy,
                    Enable     = !r.Flag_Delete,
                    Remark     = r.Description,
                    Iconic     = r.Image,
                    CreateTime = r.AddOn,
                    IsLast     = (r.HasChild_G == 0),
                    state      = (r.HasChild_G == 1) ? "closed" : "open"
                };
                json.Add(_m);
            }

            return(Json(json));

            /*
             * if (id == null)
             *  id = "0";
             * List<SysModuleModel> list = m_BLL.GetList(id);
             * var json = from r in list
             *         select new SysModuleModel()
             *         {
             *             Id = r.Id,
             *             Name = r.Name,
             *             EnglishName = r.EnglishName,
             *             ParentId = r.ParentId,
             *             Url = r.Url,
             *             Iconic = r.Iconic,
             *             Sort = r.Sort,
             *             Remark = r.Remark,
             *             Enable = r.Enable,
             *             CreatePerson = r.CreatePerson,
             *             CreateTime = r.CreateTime,
             *             IsLast = r.IsLast,
             *             state = (m_BLL.GetList(r.Id).Count > 0) ? "closed" : "open"
             *         };
             *
             *
             * return Json(json);
             */
        }