Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string pkid = Request.QueryString["PKID"];

            BLL = new XmxxBLL(WorkUser);
            if (!this.IsPostBack)
            {
                this.db_PKID.Text = pkid;
                DataTable dt = BLL.GetXmxx(pkid);
                if (dt.Rows.Count > 0)
                {
                    List <IDataItem> list = dt.Rows[0].ToDataItem();
                    this.SetControlValue(list);
                }
            }
        }
Ejemplo n.º 2
0
        public string SetLxxmGIS(HttpContext context)
        {
            XmxxBLL BLL  = new XmxxBLL(WorkUser);
            string  PKID = context.Request.Form["PKID"];
            string  x    = context.Request.Form["x"];
            string  y    = context.Request.Form["y"];

            StringBuilder str = new StringBuilder();

            if (string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y))
            {
                str.Append("{\"isSuccess\":false,\"Msg\":\"经纬度坐标不合法!\"}");
                return(str.ToString());
            }

            DataTable dt = BLL.GetXmxx(PKID);

            if (dt.Rows.Count > 0)
            {
                dt.Rows[0]["jd"]     = x;
                dt.Rows[0]["wd"]     = y;
                dt.Rows[0]["isSgbz"] = 1;

                if (BLL.SaveXmxx(dt))
                {
                    str.Append("{\"isSuccess\":true,\"Msg\":\"标注成功!\"}");
                }
                else
                {
                    str.Append("{\"isSuccess\":false,\"Msg\":\"标注失败!\"}");
                }
            }
            else
            {
                str.Append("{\"isSuccess\":false,\"Msg\":\"没有记录!\"}");
            }

            return(str.ToString());
        }
Ejemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int     allRecordCount = 0;
            string  json           = "";
            string  sortname       = context.Request.Params["sortname"];
            string  sortorder      = context.Request.Params["sortorder"];
            int     page           = Convert.ToInt32(context.Request.Params["page"]) - 1; // 系统的索引从0开始,所以此处需要减1
            int     pagesize       = Convert.ToInt32(context.Request.Params["pagesize"]);
            string  fromWhere      = context.Request.QueryString["fromwhere"];
            string  rowid          = context.Request.QueryString["rowid"];
            object  sessionAppUser = context.Session[ConfigManager.GetSignInAppUserSessionName()];
            AppUser workUser       = (AppUser)sessionAppUser;

            xmxxBLL = new XmxxBLL(workUser);
            //排序
            string orderby = @" " + sortname + " " + sortorder + " ";
            //通过检索翻译 生成查询条件
            FilterTranslator ft = ContextExtension.GetGridData(context);
            //分页
            DataTable dt = new DataTable();

            switch (fromWhere)
            {
            case "xmLocation":
                dt = xmxxBLL.GetXmxx(ft, pagesize, page, orderby, out allRecordCount);
                break;
            }
            ft.Parms.Clear();

            string result = JSONHelper.DataTableToJson(dt);

            //result = Regex.Replace(result, @"[/n/r]", ""); //去掉字符串里所有换行符
            //result = result.TrimEnd((char[])"\n\r".ToCharArray());  //去掉换行符
            json = @"{""Rows"":[" + result + @"],""Total"":""" + allRecordCount + @"""}";
            context.Response.Write(json);
            context.Response.End();
        }
Ejemplo n.º 4
0
        public string GetXmxx(HttpContext context)
        {
            XmxxBLL BLL = new XmxxBLL(WorkUser);

            string        ssdq   = context.Request.Params["ssdq"];
            string        xmdjrq = context.Request.Params["xmdjrq"];
            string        xmmc   = context.Request.Params["xmmc"];
            StringBuilder str    = new StringBuilder();

            try
            {
                str.Append("[");
                DataTable dt = BLL.GetXmxx(ssdq, xmdjrq, xmmc);

                foreach (DataRow row in dt.Rows)
                {
                    str.Append("{");
                    str.AppendFormat("\"title\":\"{0}\",\"point\":\"{1}|{2}\",\"xmmc\":\"{3}\",\"jsdw\":\"{4}\",\"sgdw\":\"{5}\",\"jldw\":\"{6}\",\"kcdw\":\"{7}\",\"sjdw\":\"{8}\",\"kgrq\":\"{9}\",\"jsgm\":\"{10}\",\"xmztz\":\"{11}万元\",\"prjNum\":\"{12}\",\"isSgbz\":{13},\"PKID\":\"{14}\"",
                                     "工程项目概要信息", row["jd"], row["wd"], row["PrjName"].ToString().Replace("\"", ""), row["BuildCorpName"]
                                     , row["SgzcbCorpNames"] == DBNull.Value ? "" : row["SgzcbCorpNames"].ToString2().Trim(';')
                                     , row["JLCorpNames"] == DBNull.Value ? "" : row["JLCorpNames"].ToString2().Trim(';')
                                     , row["EconCorpNames"] == DBNull.Value ? "" : row["EconCorpNames"].ToString2().Trim(';')
                                     , row["DesignCorpNames"] == DBNull.Value ? "" : row["DesignCorpNames"].ToString2().Trim(';')
                                     , row["BDate"] == DBNull.Value ? "" : row["BDate"].ToDateTime().ToString("yyyy-MM-dd")
                                     , row["PrjSize"], row["AllInvest"] == DBNull.Value ? "0" : row["AllInvest"].ToString2()
                                     , row["PrjNum"], row["isSgbz"].ToInt32(0), row["PKID"]);
                    str.Append("},");
                }

                return(str.ToString().TrimEnd(',') + "]");
            }
            catch (Exception ex)
            {
                str.Append(ex.Message);
            }
            return(str.ToString());
        }