Exemplo n.º 1
0
        public PartialViewResult Edit()
        {
            var model       = gxXlzxBusiness.Find(ConvertUtility.ToDecimal(Request["id"]));
            var ysxmxxModel = gxYsxmxxBusiness.FindEntity(ConvertUtility.ToDecimal(model.XMYSXXID));

            ViewData["gcbh"]        = ysxmxxModel == null ? "" : ysxmxxModel.GCBH;
            ViewData["gcmc"]        = ysxmxxModel == null ? "" : ysxmxxModel.GCBH;
            ViewData["photoGrally"] = gxPhotogalleryBusiness.Find(ConvertUtility.ToDecimal(Request["id"]));
            return(PartialView(model));
        }
        public HttpResponseMessage Post([FromBody] CoordinatesModel parameter)
        {
            try
            {
                GxRjxxBusiness gxRjxxBusiness = new GxRjxxBusiness();
                var            entity         = gxRjxxBusiness.Find(parameter.Id);
                if (entity == null)
                {
                    var loginResult = new DataResult <string>();
                    loginResult.ErrorCode = "404";
                    loginResult.Result    = false;
                    loginResult.Message   = "未找到人井信息";
                    return(Request.CreateResponse(HttpStatusCode.OK, loginResult));
                }
                entity.LONGITUDE  = parameter.Longitude;
                entity.LATITUDE   = parameter.Latitude;
                entity.MODIFYBY   = "接口数修改";
                entity.MODIFYTIME = DateTime.Now;
                gxRjxxBusiness.Update(entity);

                var dataResult = new DataResult <string>();
                if (gxRjxxBusiness.SaveChange() > 0)
                {
                    dataResult.ErrorCode = "200";
                    dataResult.Result    = true;
                    dataResult.Message   = "人井坐标信息修改成功";
                    dataResult.Data      = "";
                    return(Request.CreateResponse(HttpStatusCode.OK, dataResult));
                }
                else
                {
                    dataResult.ErrorCode = "500";
                    dataResult.Result    = false;
                    dataResult.Message   = "人井坐标信息修改失败";
                    dataResult.Data      = "";
                    return(Request.CreateResponse(HttpStatusCode.OK, dataResult));
                }
            }
            catch (Exception ex)
            {
                DataResult <string> dataResult = new DataResult <string>();
                dataResult.ErrorCode = "100101";
                dataResult.Result    = false;
                dataResult.Message   = "获取数据异常:" + (ex.InnerException == null ? ex.Message : ex.InnerException.Message);
                return(Request.CreateResponse(HttpStatusCode.OK, dataResult));
            }
        }
        /// <summary>
        /// 获取人井名称
        /// </summary>
        /// <param name="rjid"></param>
        /// <returns></returns>
        public string GetRjmcById(string rjid)
        {
            var model = rjxxBusiness.Find(ConvertUtility.ToDecimal(rjid));

            return(model == null ? "" : model.RJMC);
        }