public IList QueryByTypeAndPID(MSObject msObject)
 {
     string sql = base.GetRuntimeSql(base.GetMapper(),
         "MSObject_DefaultSelectByTypeAndPID",
         msObject);
     return base.GetMapper().QueryForList("MSObject_DefaultSelectByTypeAndPID", msObject) as IList;
 }
示例#2
0
        public string CreateProject2(string prjName)
        {
            //Project----------------------------------
            MSObject prjObj = new MSObject();
            prjObj.Name = prjName;
            prjObj.CiType = CiType.Project;
            prjObj.Flag = Flag.OK;
            dao.Insert(prjObj);
            //Pkg----------------------------------
            MSObject prjPKG = new MSObject();
            prjPKG.Name = prjName + ".pkg.html";
            prjPKG.ParentGuid = prjObj.Guid;
            prjPKG.CiType = CiType.  PkgHtml;
            prjPKG.Content = this.GetPkgHtml(prjName);
            prjPKG.Flag = Flag.OK;
            dao.Insert(prjPKG);

            //Pkg----------------------------------
            MSObject prjHttpdd = new MSObject();
            prjHttpdd.Name = prjName + ".conf";
            prjHttpdd.ParentGuid = prjObj.Guid;
            prjHttpdd.CiType = CiType.HttpddConf;
            prjHttpdd.Content = this.GetHttdd(prjName);
            prjHttpdd.Flag = Flag.OK;
            dao.Insert(prjHttpdd);

            List<object> lstObjects = new List<object>();
            {
                lstObjects.Add(new { text = prjObj.Name, leaf = false, guid = prjObj.Guid, parentguid = "", citype = CiType.Project.ToString() });
            }
            return JsonConvert.SerializeObject(lstObjects);
        }
示例#3
0
 public string LoadJsonString(string guid, string parentguid, CiType citype)
 {
     if (citype == CiType.AllProjects)
     {
         var qObj = new MSObject() { CiType = CiType.Project };
         var lst = this.dao.Query(qObj);
         List<object> lstObjects = new List<object>();
         foreach (MSObject o in lst)
         {
             lstObjects.Add(new { text = o.Name, leaf = false, guid = o.Guid, parentguid = o.ParentGuid, citype = o.CiType.ToString() });
         }
         return JsonConvert.SerializeObject(lstObjects);
     }
     else if (citype == CiType.Project)
     {
         List<object> lstObjects = new List<object>();
         {
             lstObjects.Add(new { text = "pkg", leaf = false, guid = guid, parentguid = guid, citype = CiType.Pkg.ToString() });
             lstObjects.Add(new { text = "app", leaf = false, guid = guid, parentguid = guid, citype = CiType.App.ToString() });
             lstObjects.Add(new { text = "httpdd", leaf = false, guid = guid, parentguid = guid, citype = CiType.Httpdd.ToString() });
         }
         return JsonConvert.SerializeObject(lstObjects);
     }
     else if (citype == CiType.App)
     {
         List<object> lstObjects = new List<object>();
         {
             lstObjects.Add(new { text = "Layers", leaf = false, guid = guid, parentguid = guid, citype = CiType.Layers.ToString() });
             lstObjects.Add(new { text = "Fonts", leaf = false, guid = guid, parentguid = guid, citype = CiType.Fonts.ToString() });
             lstObjects.Add(new { text = "Map", leaf = false, guid = guid, parentguid = guid, citype = CiType.Map.ToString() });
             lstObjects.Add(new { text = "Sysmols", leaf = false, guid = guid, parentguid = guid, citype = CiType.Symbols.ToString() });
             lstObjects.Add(new { text = "Etc", leaf = false, guid = guid, parentguid = guid, citype = CiType.Etc.ToString() });
             lstObjects.Add(new { text = "Data", leaf = false, guid = guid, parentguid = guid, citype = CiType.Data.ToString() });
             lstObjects.Add(new { text = "Graphics", leaf = false, guid = guid, parentguid = guid, citype = CiType.Graphics.ToString() });
         }
         return JsonConvert.SerializeObject(lstObjects);
     }
     else if (citype == CiType.Pkg)
     {
         return GetJsonNode(guid, CiType.PkgHtml);
     }
     else if (citype == CiType.Httpdd)
     {
         return GetJsonNode(guid, CiType.HttpddConf);
     }
     else if (citype == CiType.Layers )
     {
         return GetJsonNode(guid, CiType.LayerXML);
     }
     else if (citype == CiType.Map)
     {
         return GetJsonNode(guid, CiType.MapXML);
     }
     else if (citype == CiType.Symbols)
     {
         IList<CiType> lst = new List<CiType>() { CiType.SymbolXML, CiType.SymbolFile };
         return GetJsonNode(guid, lst);
     }
     else if (citype == CiType.PkgHtml || citype == CiType.Httpdd || citype == CiType.LayerXML
         || citype == CiType.SymbolXML || citype == CiType.SymbolFile
         || citype == CiType.GraphicImg || citype == CiType.MapXML)
     {
         var qObj = new MSObject() { ParentGuid = guid, CiType = citype };
         var lst = this.dao.QueryByTypeAndPID(qObj);
         List<object> lstObjects = new List<object>();
         foreach (MSObject o in lst)
         {
             lstObjects.Add(new { text = o.Name, leaf = true, guid = o.Guid, parentguid = o.ParentGuid, citype = o.CiType.ToString() });
         }
         return JsonConvert.SerializeObject(lstObjects);
     }
     else return "";
 }
示例#4
0
        /// <summary>
        /// 返回json字符串
        /// </summary> 
        public string Insert(string name, string parentguid, CiType icitype,string content)
        {
            var qObj = new MSObject()
            {
                Name = name,
                CiType = icitype,
                ParentGuid = parentguid,
                Flag = Flag.OK,
                Content = content
            };
            this.dao.Insert(qObj);

            List<object> lstObjects = new List<object>();
            {
                lstObjects.Add(new { text = qObj.Name, leaf = true, guid = qObj.Guid, parentguid = qObj.ParentGuid, citype = qObj.CiType.ToString() });
            }
            return JsonConvert.SerializeObject(lstObjects);
        }
示例#5
0
 public string GetJsonNode(string guid, CiType citype)
 {
     var qObj = new MSObject() { ParentGuid = guid, CiType = citype };
     var lst = this.dao.QueryByTypeAndPID(qObj);
     List<object> lstObjects = new List<object>();
     foreach (MSObject o in lst)
     {
         lstObjects.Add(new { text = o.Name, leaf = true, guid = o.Guid, parentguid = o.ParentGuid, citype = o.CiType.ToString() });
     }
     return JsonConvert.SerializeObject(lstObjects);
 }
        public string GetProjJsonLayers(string pguid)
        {
            var qObj = new MSObject() { ParentGuid = pguid, CiType = CiType.LayerXML };
            var lst = base.dao.QueryByTypeAndPID(qObj);
            List<object> lstObjects = new List<object>();
            foreach (MSObject o in lst)
            {
                Layer layer = Utility.XMLUtil.DeserializeXML<Layer>(o.Content);
                lstObjects.Add(new {guid=o.Guid, name = layer.name, status = layer.status, type = layer.type });
            }

            return JsonConvert.SerializeObject(lstObjects);
        }
 public void Update(MSObject msObject)
 {
     msObject.LastModifiedTime = DateTime.Now;
     base.GetMapper().Update("MSObject_DefaultUpdate", msObject);
 }
 public IList Query(MSObject msObject)
 {
     return base.GetMapper().QueryForList("MSObject_DefaultSelect", msObject) as IList;
 }
 public void Insert(MSObject msObject)
 {
     msObject.Guid = Guid.NewGuid().ToString();
     msObject.LastModifiedTime = DateTime.Now;
     base.GetMapper().Insert("MSObject_DefaultInsert", msObject);
 }