Beispiel #1
0
 public Evaluation(string expr)
 {
     this._expr = expr;
     _conn = new SdeConnection();
     _sdeConn = (ISdeConnectionInfo)_conn;
     _conf = CurrentConfig.CallMe();
     _fcName = new TnFeatureClassName(_sdeConn.Workspace);
     _tblName = new TnTableName(_sdeConn.Workspace);
     _dicParams = new Dictionary<string, object>();
 }
Beispiel #2
0
        void ILandpriceView.LoadPrice()
        {
            if (_conn == null)
            {
                _conn = new SdeConnection();
                _sdeConn = (ISdeConnectionInfo)_conn;
                _fw = (IFeatureWorkspace)_sdeConn.Workspace;
                _fcName = new TnFeatureClassName(_sdeConn.Workspace);
                _tblName = new TnTableName(_sdeConn.Workspace);

            }
            //MessageBox.Show(string.Format("line 122 GLandPriceView layerCount={0}", _mapView.GetMapControl().LayerCount));
            //if (_mapView.GetMapControl().LayerCount == 0)
            //{
            //    MessageBox.Show(string.Format("line 125 GLandPriceView layerCount={0}", _mapView.GetMapControl().LayerCount));
            //    _tgdName = string.Format("{0}_{1}", DataNameTemplate.Thua_Gia_Dat, _conf.NamApDung);
            //    IFeatureClass fc = _fw.OpenFeatureClass(_tgdName);
            //    IFeatureLayer fl = new FeatureLayerClass();
            //    fl.FeatureClass = fc;
            //    fl.Name = fc.AliasName;
            //    ILayer layer = (ILayer)fl;
            //    _mapView.AddLayer(layer);
            //}

            _controller.LoadPrice();
        }
Beispiel #3
0
 void IQueryThuaView.Query()
 {
     //this.Cursor = Cursors.AppStarting;
     if (_conn == null)
     {
         _conn = new SdeConnection();
         _sdeConn = (ISdeConnectionInfo)_conn;
         _fcName = new TnFeatureClassName(_sdeConn.Workspace);
     }
     _info.SetWorkspace(_sdeConn.Workspace);
     _controller.Query() ;
 }
Beispiel #4
0
        void ILandprice.LoadPriceFromKey()
        {
            _conn = new SdeConnection();
            _sdeConn = (ISdeConnectionInfo)_conn;
            _fw = (IFeatureWorkspace)_sdeConn.Workspace;
            IQueryFilter qrf = new QueryFilterClass();
            _fcName = new TnFeatureClassName(_sdeConn.Workspace);
            _nameOfThuaGiaDat = string.Format("{0}_{1}", _tableName, _conf.NamApDung);
            try
            {
                _thuaGiaDatFc = _fw.OpenFeatureClass(_nameOfThuaGiaDat);
                _thuaGiaDatTable = (ITable)_thuaGiaDatFc;
            }
            catch { MessageBox.Show(string.Format("Không tìm thấy bảng {0}", _nameOfThuaGiaDat)); }

            _fcName.FC_THUA_GIADAT.NAME = _nameOfThuaGiaDat;
            _fcName.FC_THUA_GIADAT.InitIndex();

            List<ThuaGiaDatInfo> thuaGiaDat = new List<ThuaGiaDatInfo>();
            if (this._mathua != null)
            {
                //object giadat;
                //object dongia;
                //object dientich;
                //object dientichpl;
                //object giadatTheoDientich;
                int khoaGia;
                //int khoaGiaTay;
                //int khoaGiaTuDong;
                //object khoaViTri;
                //object soMatTien;
                //object soMatHem;
                //object cachtinh;

                qrf.WhereClause = string.Format("{0}='{1}'", _fcName.FC_THUA_GIADAT.MA_THUA, _mathua);
                //MessageBox.Show(string.Format("line 139 {0}", qrf.WhereClause));
                IFeatureCursor fcur = _thuaGiaDatFc.Search(qrf, false);
                IFeature ft = null;
                bool result = false;
                try
                {
                    int i = 0;
                    while ((ft = fcur.NextFeature()) != null)
                    {
                        thuaGiaDat.Add(new ThuaGiaDatInfo());
                        //MessageBox.Show(string.Format("line 147 - {0}_{1}",thuaGiaDat.Count,i));
                        thuaGiaDat[i].Mathua = this._mathua;
                        thuaGiaDat[i].Oid = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.OID));
                        thuaGiaDat[i].Dongia = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.DON_GIA));
                        thuaGiaDat[i].Giadat = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.GIA_DAT));
                        result = int.TryParse(ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.LOCKED)).ToString(), out khoaGia);
                        if (!result)
                        {
                            khoaGia = 0;
                        }
                        thuaGiaDat[i].Khoagia = khoaGia;
                        thuaGiaDat[i].Hesovitri = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.HE_SO_K));
                        thuaGiaDat[i].Cachtinh = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.CACH_TINH));
                        thuaGiaDat[i].Dientich = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.DIEN_TICH));
                        thuaGiaDat[i].Dientichpl = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.DIEN_TICH_PHAP_LY));
                        thuaGiaDat[i].Maduong = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.MA_DUONG));
                        thuaGiaDat[i].Mahem = ft.get_Value(ft.Fields.FindField(_fcName.FC_THUA_GIADAT.MA_HEM));
                        i++;
                    }
                    //MessageBox.Show(string.Format("line 157 - {0}_{1}", thuaGiaDat.Count, i));
                    if (thuaGiaDat.Count > 0)
                    {
                        _view.UpDate(thuaGiaDat);
                    }
                }
                catch (Exception e1) { MessageBox.Show(string.Format("Line 167 - GLandprice - {0}", e1)); }
                finally { Marshal.ReleaseComObject(fcur); }
            }
        }
 public SdeConnectionController(ISdeConnectionInfo sdeConn, IConnectionView sdeConnView)
 {
     this._sdeConn = sdeConn;
     this._sdeConnView = sdeConnView;
 }
Beispiel #6
0
        private void iniMvc()
        {
            //_connView = (IConnectionView)this;
            this._sdeUserInfo = new SdeUserInfo();
            this._userInfoController = new UserInfoController(_sdeUserInfo, this);
            this._connSde = new SdeConnection(this._sdeUserInfo);
            this._connectionController = new SdeConnectionController(this._connSde, this);
            this._connectionController.DoWork += new com.g1.arcgis.ChangedEventHandler(_connectionController_DoWork);
            //FrmMainRibbonExtensible fr = new FrmMainRibbonExtensible();

            //_mainSwitch = (IMainSwitch)fr;
        }