예제 #1
0
        public string API_GetPointObjectImgSizeFromData(int iObjServerId)
        {
            string     strObjInfo = "";
            JSONHelper jsonHelper = new JSONHelper();

            string  strSql    = "select iObjImgWidth,iObjImgHeight from ObjTable where id = " + iObjServerId.ToString();
            string  strConn   = YimaDataBase.GetSqlConnectionString();
            DataSet ds        = YimaDataBase.ExecuteSqlReDataSet(strSql, strConn);
            int     iObjCount = ds.Tables[0].Rows.Count;


            if (iObjCount > 0)
            {
                string objImgWidth  = ds.Tables[0].Rows[0]["iObjImgWidth"].ToString();
                string objImgHeight = ds.Tables[0].Rows[0]["iObjImgHeight"].ToString();
                jsonHelper.AddItem("objImgWidth", objImgWidth);
                jsonHelper.AddItem("objImgHeight", objImgHeight);
                jsonHelper.ItemOk();
            }


            strObjInfo = jsonHelper.ToString();

            return(strObjInfo);
        }
예제 #2
0
        public string API_GetAllObjectInfoFromData()
        {
            string strObjInfo = "";


            string     strSql     = "select id,iObjLayerId,strObjName,strObjContent,strObjGeo,dtObjDate,strCompany,iObjStyleId,strObjImgUrl,iObjImgWidth,iObjImgHeight from ObjTable order by iObjLayerId ";
            string     strConn    = YimaDataBase.GetSqlConnectionString();
            DataSet    ds         = YimaDataBase.ExecuteSqlReDataSet(strSql, strConn);
            int        iObjCount  = ds.Tables[0].Rows.Count;
            JSONHelper jsonHelper = new JSONHelper();

            for (int i = 0; i < iObjCount; i++)
            {
                string strServerId     = ds.Tables[0].Rows[i]["id"].ToString();
                string strObjLayerId   = ds.Tables[0].Rows[i]["iObjLayerId"].ToString();
                string strObjName      = ds.Tables[0].Rows[i]["strObjName"].ToString();
                string strObjContent   = ds.Tables[0].Rows[i]["strObjContent"].ToString();
                string strObjGeo       = ds.Tables[0].Rows[i]["strObjGeo"].ToString();
                string strObjDate      = ds.Tables[0].Rows[i]["dtObjDate"].ToString();
                string strCompany      = ds.Tables[0].Rows[i]["strCompany"].ToString();
                string strObjStyleId   = ds.Tables[0].Rows[i]["iObjStyleId"].ToString();
                string strObjImgUrl    = ds.Tables[0].Rows[i]["strObjImgUrl"].ToString();
                string strObjImgWidth  = ds.Tables[0].Rows[i]["iObjImgWidth"].ToString();
                string strObjImgHeight = ds.Tables[0].Rows[i]["iObjImgHeight"].ToString();

                jsonHelper.AddItem("strServerId", strServerId);
                jsonHelper.AddItem("strObjLayerId", strObjLayerId);
                jsonHelper.AddItem("strObjName", strObjName);
                jsonHelper.AddItem("strObjContent", strObjContent);
                jsonHelper.AddItem("strObjGeo", strObjGeo);
                jsonHelper.AddItem("strObjDate", strObjDate);
                jsonHelper.AddItem("strObjStyleId", strObjStyleId);
                jsonHelper.AddItem("strObjImgUrl", strObjImgUrl);
                jsonHelper.AddItem("strObjImgWidth", strObjImgWidth);
                jsonHelper.AddItem("strObjImgHeight", strObjImgHeight);
                jsonHelper.ItemOk();
            }


            strObjInfo = jsonHelper.ToString();

            return(strObjInfo);
        }