コード例 #1
0
 public IEnumerable <PlotsFeatures.Properties> GetProperties()
 {
     using (Plots collections = Plots.GetPlots())
     {
         return(collections.Proprties);
     }
 }
コード例 #2
0
        public void SinchroRun()
        {
            Console.WriteLine(DateTime.Now.ToString("HH:mm:ss tt"));

            using (Plots collections = Plots.GetPlots())
            {
                var props = collections.Proprties;
                var end   = table.Lenght;
                var it    = 1;
                Console.Write("Чтение данных:     [");
                while (it < end)
                {
                    mapInfo.Do(@"Fetch Rec " + it + @" From " + table.Name);
                    var doc          = mapInfo.Eval(table.Name + @".VRI_DOC");
                    var cadNum       = mapInfo.Eval(table.Name + @".CAD_NUM");
                    var areaAsString = mapInfo.Eval(@"Int( Area( " + table.Name + @".Obj, ""sq m"") )");
                    var area         = Convert.ToInt32(areaAsString);
                    var lo           = mapInfo.Eval(table.Name + @".lo_lvl");
                    var lo_lvl       = (lo == "true") ? true : false;
                    var mid          = mapInfo.Eval(table.Name + @".mid_lvl");
                    var mid_lvl      = (mid == "true") ? true : false;
                    var hi           = mapInfo.Eval(table.Name + @".hi_lvl");
                    var hi_lvl       = (hi == "true") ? true : false;
                    var klass        = mapInfo.Eval(table.Name + @".VRI_KLASSI");

                    if (doc.Length == 254)
                    {
                        doc = props.FirstOrDefault(p => p.CadNum.Equals(cadNum)).VriDoc;
                    }
                    var inputData = new InputData(klass, area, "", lo_lvl, mid_lvl, hi_lvl, doc);
                    var factory   = new Factory(inputData);
                    factory.Execute();


                    var rowid = it.ToString();

                    mapInfo.Do(@"Update " + table.Name + @" Set VRI_List = """ + factory.outputData.VRI_List + @""" Where RowID = " + rowid);
                    mapInfo.Do(@"Update " + table.Name + @" Set VRI_Sorted = """ + factory.outputData.VRI_List + @""" Where RowID = " + rowid);
                    mapInfo.Do(@"Update " + table.Name + @" Set Matches = """ + factory.outputData.Matches + @""" Where RowID = " + rowid);
                    mapInfo.Do(@"Update " + table.Name + @" Set fs_tip = """ + factory.outputData.Type.ToString() + @""" Where RowID = " + rowid);
                    mapInfo.Do(@"Update " + table.Name + @" Set fs_vid = """ + factory.outputData.Kind.ToString() + @""" Where RowID = " + rowid);

                    it++;
                    if (it % (table.Lenght / 20) == 0)
                    {
                        Console.Write(".");
                    }
                }
            }
            Console.WriteLine("]    OK");
            Console.WriteLine(DateTime.Now.ToString("HH:mm:ss tt"));
        }