public ActionResult Insert(ZhuZhaiTaoFangZongHeXinXi entity)
        {
            if (ModelState.IsValid)
            {
                if (_service.GetZhuZhaiTaoFangZongHeXinXiByDanYuanBianHao(entity.DanYuanBianHao) == null)
                {
                    var louDongXiuZheng = _service.GetZhuZHaiLouDongXiuZhengByZhuangBianHao(entity.LouDongBianHao);
                    entity.LouPanBianHao   = louDongXiuZheng.WuYeBianHao;
                    entity.LouPanMingCheng = louDongXiuZheng.WuYeMingCheng;
                    entity.OrgNamePath     = GetOrganizationNamePath();
                    entity.CreatedBy       = GetCurrentUserName();
                    entity.CreatedDate     = DateTime.Now;

                    _service.AddZhuZhaiTaoFangZongHeXinXi(entity);
                    _service.Save();
                }
                else
                {
                    X.Msg.Alert(MsgInfo.TI_SHI, MsgInfo.INSERT_CHECK_EXIT).Show();
                    return(this.Direct());
                }

                this.GetCmp <Window>("windowZhuZhaiTaoFangZongHeXinXi").Hide();
                this.GetCmp <Store>("storeZhuZhaiTaoFangZongHeXinXi").Reload();

                return(this.Direct());
            }
            return(this.Direct());
        }
        public ActionResult Delete(int id)
        {
            if (id == -1)
            {
                return(this.Direct());
            }

            _service.DeleteZhuZhaiLouDongXiuZheng(id);
            _service.Save();
            return(View("Index", GetToolarPermission()));
        }
Exemplo n.º 3
0
        public ActionResult SaveMarkerLouDong(int id, double ptX, double ptY)
        {
            if (ptX == 0 || ptY == 0)
            {
                return(this.Direct());
            }
            var uow     = RepositoryHelper.GetUnitOfWork();
            var service = new ZhuZhaiService(uow);
            var entity  = service.GetZhuZhaiLouDongXiuZhengById(id);

            if (entity != null)
            {
                entity.JingWeiDu = string.Format("{0},{1}", ptX, ptY);
                service.UpdateZhuZhaiLouDongXiuZheng(entity);
                service.Save();
                return(this.Direct());
            }
            return(this.Direct());
        }