示例#1
0
        public ActionResult SaveMarker(int id, string wuYeYongTu, double ptX, double ptY)
        {
            if (ptX == 0 || ptY == 0)
            {
                return(this.Direct());
            }

            IUnitOfWork uow = RepositoryHelper.GetUnitOfWork();

            switch (wuYeYongTu)
            {
            case "ZhuZhai":
            {
                var zhuZhaiService = new ZhuZhaiService(uow);
                var jichuXinXi     = zhuZhaiService.GetZhuZhaiJiChuXinXiById(id);
                jichuXinXi.Px = ptX;
                jichuXinXi.Py = ptY;
                break;
            }

            case "ShangYe":
            {
                var shangYeService = new ShangYeService(uow);
                var jichuXinXi     = shangYeService.GetShangYeJiChuXinXiById(id);
                jichuXinXi.Px = ptX;
                jichuXinXi.Py = ptY;
                break;
            }

            case "BanGong":
            {
                var banGongService = new BanGongService(uow);
                var jichuXinXi     = banGongService.GetBanGongJiChuXinXiById(id);
                jichuXinXi.Px = ptX;
                jichuXinXi.Py = ptY;
                break;
            }

            case "JingYingXingYongDi":
            {
                var jingYingXingYongDiService = new JingYingXingYongDiService(uow);
                var jichuXinXi = jingYingXingYongDiService.GetJingYingXingYongDiById(id);
                jichuXinXi.Px = ptX;
                jichuXinXi.Py = ptY;
                break;
            }

            default:
                break;
            }
            uow.Commit();
            return(this.Direct());
        }