Beispiel #1
0
        private void Init(AxMapControl mc, int programID)
        {
            gp = new Geoprocessor();
            mapControl = mc;
            UpdateMapLayerNameList(mapLayerNameList, mapControl);
            program = new Program();
            program.id = programID;
            program.select();
            project = new Project();
            project.id = program.projectID;
            project.select();
            netSize = program.getRelatedNetSize();
            conditionList = program.getAllRelatedCondition();
            baseFeature = GisUtil.GetBaseFeature(mapControl, project.baseMapIndex);
            mapFolder = System.IO.Path.GetDirectoryName(project.path);
            targetFolder = generateFolder(mapFolder);
            foreach (Condition condition in conditionList)
            {
                if (condition.type == C.CONFIG_TYPE_STANDARD)
                {
                    totalStandardValue += condition.value;
                }
            }
            fishnetPolygonName = "polygon.shp";
            fishnetName = "fishnet.shp";
            fishnetWidth = netSize.width;
            fishnetHeight = netSize.height;

            featureList = new List<Feature>();
        }
 public bool isDirty()
 {
     int netSizeID = netSize.id;
     NetSize netSizeCopy = new NetSize();
     netSizeCopy.id = netSizeID;
     netSizeCopy.select();
     return !netSize.compare(netSizeCopy);
 }
        public void init(int programID)
        {
            Program program = new Program();
            program.id = programID;
            netSize = program.getRelatedNetSize();
            if (netSize == null)
            {
                netSize = new NetSize();
                netSize.programID = programID;
                netSize.saveWithoutCheck();
                netSize.id = NetSize.GetLastNetSizeID();
            }

            Ut.bind(netSize, "width", BindingMode.TwoWay, NetSizeWidthTextBox, TextBox.TextProperty
                , new List<ValidationRule>() { new PositiveDoubleValidationRule() }, "NetSizeBindingGroup");
            Ut.bind(netSize, "height", BindingMode.TwoWay, NetSizeHeightTextBox, TextBox.TextProperty
                , new List<ValidationRule>() { new PositiveDoubleValidationRule() }, "NetSizeBindingGroup");
        }
Beispiel #4
0
 public NetSize getRelatedNetSize()
 {
     if (!isValid(new List<string>() { "prName", "pID" }))
         return null;
     string sqlCommand = String.Format(@"select nsID from NetSize where prID={0}", prID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectNetSizeIDByPrID(sqlCommand);
     if (!reader.HasRows)
         return null;
     reader.Read();
     NetSize netSize = new NetSize();
     netSize.id = Int32.Parse(reader[0].ToString());
     netSize.select();
     return netSize;
 }
Beispiel #5
0
 public bool compare(NetSize netSize)
 {
     if (id != netSize.id)
         return false;
     if (prID != netSize.programID)
         return false;
     if (nsWidth != netSize.width)
         return false;
     if (nsHeight != netSize.height)
         return false;
     return true;
 }