Exemple #1
0
        private void buttonZoom_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(t_gush_num.Text) &&
                !String.IsNullOrEmpty(t_parcel_num.Text))
            {
                IMapDocument  mxd    = CancelParcelEditor10_5.ArcMap.Application.Document as IMapDocument;
                IMap          map    = mxd.get_Map(0);
                IFeatureLayer flayer = AO.getLayerFromMxd(map, "חלקות להכנסה");

                string query = "GUSHNUM = " + Convert.ToInt32(t_gush_num.Text).ToString() +
                               " AND PARCEL_FINAL = " + Convert.ToInt32(t_parcel_num.Text).ToString();

                AO.ZoomToSelection(mxd, flayer, query);
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            IMapDocument mxd = ZoomNextError.ArcMap.Application.Document as IMapDocument;
            IMap         map = mxd.get_Map(0);
            string       gdb = AO.getLayerPathFromMxd(map, "חלקות לעריכה");



            if (String.IsNullOrEmpty(gdb))
            {
                MessageBox.Show("שכבת חלקות לעריכה אינה קיימת במפה");
            }
            if (String.IsNullOrEmpty(gdb))
            {
                MessageBox.Show("שכבת חלקות לעריכה אינה קיימת במפה");
            }
            else
            {
                ITable table     = AO.open_table(gdb, "Errors");
                int    sum_items = table.RowCount(null);
                if (table != null)
                {
                    counter_items++;
                    int     counter = 0;
                    ICursor cursor  = AO.create_table_cursor_with_query(table, "\"OBJECTID\" > " + current_OID.ToString());
                    IRow    row     = cursor.NextRow();
                    while (counter < 1 && row != null)
                    {
                        if (counter_items < sum_items)
                        {
                            counter++;
                            current_OID = row.OID;
                            //MessageBox.Show(current_OID.ToString());
                            string GushNum        = row.Value[row.Fields.FindField("GushNum")];
                            string ParcelNum      = row.Value[row.Fields.FindField("ParcelNum")];
                            string GushSfx        = row.Value[row.Fields.FindField("GushSfx")];
                            object ErrDescription = row.Value[row.Fields.FindField("ErrDescription")];

                            string query = "OBJECTID < 0";
                            if (GushNum == "0" && ParcelNum == "0" && ErrDescription != null)
                            {
                                if (ErrDescription.ToString().Contains("OID:"))
                                {
                                    //MessageBox.Show(System.Text.RegularExpressions.Regex.Match(ErrDescription.ToString(), @"\d+").Value);
                                    string oid = System.Text.RegularExpressions.Regex.Match(ErrDescription.ToString(), @"\d+").Value;
                                    query = "OBJECTID = " + oid;
                                }
                            }
                            else
                            {
                                query = "GUSH_NUM = " + GushNum +
                                        " AND PARCEL = " + ParcelNum +
                                        " AND GUSH_SUFFIX = " + GushSfx;
                            }


                            IFeatureLayer flayer = AO.getLayerFromMxd(map, "חלקות לעריכה");

                            AO.ZoomToSelection(mxd, flayer, query);
                            List_acc.Add(row.OID);
                            //MessageBox.Show(get(List_acc));
                            row = cursor.NextRow();

                            if (ErrDescription != null)
                            {
                                label3.Text = ErrDescription.ToString();
                                label5.Text = sum_items.ToString() + " / " + List_acc.Count.ToString();
                            }
                            else
                            {
                                label3.Text = "ללא תיאור";
                                label5.Text = "";
                            }
                        }
                        else
                        {
                            current_OID   = -1;
                            counter_items = 0;
                        }
                    }
                }
            }
        }