예제 #1
0
        public JsonResult Edit(Roadbasicinfo model, string gridStage)
        {
            model.LastModifiedUser = UserSession.Current.UserCode == null ? "" : UserSession.Current.UserCode.ToString();
            model.LastModifiedTime = DateTime.Now;
            var result = (new YhRoadbasicinfoManager()).Update(model);

            return(Json(new ResponseMessage()
            {
                IsSuccess = true
            }));
        }
예제 #2
0
        //
        // GET: /RoadBasicInfo/  YhRoadbasicinfoManager
        public ActionResult Detail(int id)
        {
            Roadbasicinfo enity = new Roadbasicinfo();

            if (id > 0)
            {
                enity = (new YhRoadbasicinfoManager()).GetItemByKey(id);
                if (enity != null)
                {
                    enity.RoadMunicipalInfoList = (new YhRoadMunicipalInfoManager()).GetItemByRoadId(id);
                    enity.SanitationInfoList    = (new YhSanitationInfoManager()).GetItemByRoadId(id);
                    enity.GenLandInfoList       = (new YhGreenLandInfoManager()).GetItemByRoadId(id);
                    enity.SewerinfoInfoList     = (new YhSewerinfoInfoManager()).GetItemByRoadId(id);
                    enity.BridgeInfoList        = (new YhBridgeinfoManager()).GetItemByRoadId(id);
                    enity.StreetTreeInfoList    = (new YhStreetTreeInfoManager()).GetItemByRoadId(id);
                    enity.ImgInfoList           = (new YhImgInfoManager()).GetImgByRoadId(id);
                    enity.StreetTreeDtlInfoList = (new YhStreetTreeDtlManager()).GetItemByRoadId(id);
                }
                ViewBag.entity = enity;
                if (enity.ImgInfoList != null)
                {
                    ViewBag.RoadBasicInfoImgList     = enity.ImgInfoList.Where(t => t.imgModule.Equals("RoadBasicInfo")).ToList();
                    ViewBag.BridgeInfoImgList        = enity.ImgInfoList.Where(t => t.imgModule.Equals("BridgeInfo")).ToList();
                    ViewBag.RoadMunicipalInfoImgList = enity.ImgInfoList.Where(t => t.imgModule.Equals("RoadMunicipalInfo")).ToList();
                    ViewBag.SanitationInfoImgList    = enity.ImgInfoList.Where(t => t.imgModule.Equals("SanitationInfo")).ToList();
                    ViewBag.SewerInfoImgList         = enity.ImgInfoList.Where(t => t.imgModule.Equals("SewerInfo")).ToList();
                    ViewBag.StreetTreeInfoImgList    = enity.ImgInfoList.Where(t => t.imgModule.Equals("StreetTreeInfo")).ToList();
                    ViewBag.GreenLandInfoImgList     = enity.ImgInfoList.Where(t => t.imgModule.Equals("GreenLandInfo")).ToList();
                    ViewBag.StreetTreeDtlInfoImgList = enity.ImgInfoList.Where(t => t.imgModule.Equals("StreetTreeDtlInfo")).ToList();
                }
                else
                {
                    ViewBag.RoadBasicInfoImgList     = null;
                    ViewBag.BridgeInfoImgList        = null;
                    ViewBag.RoadMunicipalInfoImgList = null;
                    ViewBag.SanitationInfoImgList    = null;
                    ViewBag.SewerInfoImgList         = null;
                    ViewBag.StreetTreeInfoImgList    = null;
                    ViewBag.GreenLandInfoImgList     = null;
                    ViewBag.StreetTreeDtlInfoList    = null;
                }
            }
            return(View(enity));
        }
예제 #3
0
        public JsonResult Add(Roadbasicinfo model)
        {
            model.CreateUser       = UserSession.Current.UserCode;
            model.CreateTime       = DateTime.Now;
            model.LastModifiedUser = UserSession.Current.UserCode;
            model.LastModifiedTime = DateTime.Now;
            var result = (new YhRoadbasicinfoManager()).Add(model);

            if (result > 0)
            {
                return(Json(new ResponseMessage()
                {
                    IsSuccess = true
                }));
            }
            else
            {
                return(Json(new ResponseMessage()
                {
                    IsSuccess = false, ErrorCode = (int)result, Message = "新增失败"
                }));
            }
        }